This patch moves the SyncRunEvent logic from GLControllerSupport to
nsAppShell, as it could be useful elsewhere. This patch fixes a race
condition related to shutdown, where a deadlock could occur if Gecko
shuts down when another thread is waiting for a synchronous event to
finish running. This patch also fixes a crash on shutdown when we tried
to create a mutex after the deadlock detector has shut down.
When getting nsAppShell from another thread, there could be a race with
nsAppShell being destroyed on the main thread. This patch makes the raw
nsAppShell pointer only accessible from the main thread, and use a
static mutex to coordinate accessing nsAppShell from other threads.
This patch changes onAttachedToWindow in GeckoView, so that if we have
states that have been restored, we use those states for initialization
instead of creating new states (e.g. opening a new nsWindow). Because
the GLController instance is associated with the nsWindow instance, we
need to keep the GLController instance as part of our saved states. This
patch also adds a reattach method to GeckoView.Window, because
GeckoEditable needs to be notified when its target View changes.
This patch makes GLContextProviderEGL create EGL surfaces through
nsWindow/nsIWidget on Android. nsWindow then calls GLController in Java
to actually create the surface.
GLController instances are associated with a particular nsWindow, rather
than a particular View. Therefore, we need to let GeckoView manage
GLController instances, as part of GeckoView's handling of saving and
restoring states.
One nsWindow will have one corresponding GLController, and using native
GLController methods instead of GeckoEvents lets us control the
compositor for each nsWindow separately.
GeckoViewSupport better reflects the purpose of the class and will match
the GLControllerSupport class that another patch is adding. This patch
also changes the way GeckoViewSupport is constructed in order to be more
encapsulating.
Right now LayerView depends on geckoConnected being called by GeckoApp
or GeckoView during its initialization. However, we can get rid of it
and let LayerView handle the task itself. As part of this change, screen
depth overriding is moved to native code in nsAppShell.
This patch adds auto-generated bindings for LayerRenderer.Frame, and
uses the new bindings in nsWindow, in place of the old manual bindings
in AndroidJavaWrappers.
This also changes aPrintToFileName parameter for BeginDocument to an nsAString& from char16_t*.
Having a char16_t* caused a pain with VS2105 where wchar_t != char16_t (as on VS2103), after it had been sent over IPDL.
This could have been worked around with casting, but this seemed like the tidier solution.
These changes are to make using an off screen surface behind our DrawTarget in the child easier.
It still creates the real printing surface for some of the calculations,
removing this will be required for future tightening of the sandbox.
With APZ we want to be firing scroll events to content more consistently, so
we tie them to the refresh driver tick rather than firing them on paint or
haphazardly on the next spin of the event loop.
Patch by Markus Stange, test fixes by Kartikaya Gupta
We send query text events when flushing IME changes, and sometimes these
events make Gecko commit more pending changes. In that case, we should
try flushing again, so we pick up the new changes.
This patch also makes the process of flushing text changes
transactional, so that if we have to bail due to more pending changes,
nothing will be committed.