:whimboo found this, apparently if something else holds a reference to
permanentKey we will leak the window. To avoid this happening we use the JSM
global instead.
For more context see Bug 1501789.
Differential Revision: https://phabricator.services.mozilla.com/D138451
Android has no full-page zoom, so we are not meaningfully changing behavior.
However, these values are exposed to the GeckoView JS api, surprisingly, yet
viewport scaling and so on can change the CSS to device pixel ratio...
Shouldn't we expose device pixels there instead? Or do the api consumers assume
that those CSS pixels are scaled to the device scale factor somehow (and that's
not working)?
Depends on D138037
Differential Revision: https://phabricator.services.mozilla.com/D138038
Android has no full-page zoom, so we are not meaningfully changing behavior.
However, these values are exposed to the GeckoView JS api, surprisingly, yet
viewport scaling and so on can change the CSS to device pixel ratio...
Shouldn't we expose device pixels there instead? Or do the api consumers assume
that those CSS pixels are scaled to the device scale factor somehow (and that's
not working)?
Depends on D138037
Differential Revision: https://phabricator.services.mozilla.com/D138038
If the android system kills the GPU process then ChildCrashHandler.jsm
gets invoked but an empty dump ID. Currently we generate a crash
report anyway, which is resulting in lots of "EMPTY: no crashing
thread identified; ERROR_NO_MINIDUMP_HEADER" crashes.
Instead, we should return early before starting the crash reporter if
the dump ID is empty. We already do this for content processes, so
this patch makes us do so for every type of process.
Differential Revision: https://phabricator.services.mozilla.com/D138766
Make the ScreenOrientation part of the screen struct, as it should. Stop
using HAL to propagate just screen orientation updates, use the more
general screen manager.
Instead of HAL observers, add a simple observer service notification,
and clean a bunch of the code.
This will simplify bug 1754802 a bit, and is generally simpler.
Shouldn't change behavior. I've tested the events and some common
orientation locking use cases like Youtube, and they behave the same.
Differential Revision: https://phabricator.services.mozilla.com/D138477
Right now the title is "Welcome to GeckoView’s documentation!" which looks out
of place given that all the other titles are just the name of the product like
"libpref" or "WebIDL"
Differential Revision: https://phabricator.services.mozilla.com/D138818
BACKGROUND and FOREGROUND priority lead to the identical oom_adj value of 11
when the app is in the background. Because all non-content processes are
restartable without losing any state, we should prioritize them lower than the
current active tab, which will be prioritized to FOREGROUND when Bug 1753700 is
fixed.
Differential Revision: https://phabricator.services.mozilla.com/D138810
In bug 1750569 we attempted to ensure that following a GPU process
crash outstanding screen pixels requests would be fulfilled. While
this usually worked there was a race condition between sending the
request to the new compositor and the content process sending the
display list to the new compositor, which meant that sometimes we
would screenshot an empty screen instead of the page content.
As a GPU process crash is an extraordinary circumstance and
screenshots are non-critical, the best solution is to simply return an
error if a GPU process crash occurs while there is an outstanding
request (or if a new request is made whilst the GPU process is
restarting). This patch also updates the junit test to check for this
error rather than expecting a screenshot to be returned.
Differential Revision: https://phabricator.services.mozilla.com/D138323
isTopLevel is used for ENV_TYPE_CONTENT_SCRIPT to let embedders know if an
iframe is sending messages to the app. For extension environments we don't need
this extra check so we can always set the value to true.
Differential Revision: https://phabricator.services.mozilla.com/D137776
Make the SurfaceAllocator save a reference to all Surfaces it has
allocated. When the connection to the remote allocator dies, mark all
of those surfaces as released. Ensure subsequent attempts to allocate
new Surfaces will connect to the new compositor process (either GPU or
parent).
For webgl, when we detect we are using a Surface that has been
released, clear the pool of Surfaces used for the swapchain so that
we automatically reallocate new ones.
For video, if we encounter an error in RemoteVideoDecoder and can see
that Surface has been released, then report a
NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER in place of the potentially fatal
error code we get from the java decoder. This will ensure a new
decoder is created, which will in turn allocate a new Surface to
decode in to.
On the Android emulator (so potentially real devices too) the java
decoder doesn't actually report any errors in response to the Surface
being released. Therefore we also check for the Surface being released
in ProcessOutput(), and manually raise the NEED_NEW_ENCODER error from
there if so.
Differential Revision: https://phabricator.services.mozilla.com/D133108
There are two things that make an element not be a combobox:
* <select multiple>
* <select size=N> where N > 1
I was only handling the former. Expose the gecko-internal method we have
for this via WebIDL to get this fully right forever.
The other issue reported in this bug is not a GeckoView issue, it's an
android-components issue, will file / maybe fix there if I figure out
how.
Differential Revision: https://phabricator.services.mozilla.com/D137295
When user/App rotates screen 180 degree, `onConfigurationChanged` isn't called.
But If API is 17+, we can use `DisplayManager.DisplayListener` to detect
rotation change instead.
Also, since orientation value in `android.content.res.Configuration` won't be
updated immediately, we shouldn't use it, excepting to `onConfigurationChanged`.
Differential Revision: https://phabricator.services.mozilla.com/D136869
Two issues:
* Set the openInParentProcess flag in GeckoViewPrompt.jsm for
dropdowns. This avoids needing two taps to re-open the dropdown.
* Make the "input" event composed, see bug 1734040.
Differential Revision: https://phabricator.services.mozilla.com/D137038
WebRender retains about 50MBs of memory for every window. When switching
between lots of tabs on Android (where 1 tab = 1 window), this can cause
problems as the app will consume a significant amount of memory.
To avoid this problem, we send a memory pressure event whenever a session is
deactivated, which signals to WebRender that it should deallocate the memory.
This message is sent on a delay of 10s to avoid interfering with tab switching,
and we cancel the message if the tab becomes active again before we fire the
memory pressure event.
Co-Authored-By: Cathy Lu <calu@mozilla.com>
Co-Authored-By: Jonathan Almeida [:jonalmeida] <jonalmeida942@gmail.com>
Differential Revision: https://phabricator.services.mozilla.com/D136965
We had zero coverage for this, apparently. Upon writing tests, the only
test we had for this was `@Ignore`d :(
Write better tests for this. Add tests for <select multiple> which I
broke because the mozshowdropdown events only fire for dropdown selects.
I'm sorry anyways, I should've tested manually, but I was traveling and
found issues when trying to do an artifact build so I relied on try, oh
well.
Differential Revision: https://phabricator.services.mozilla.com/D136772
After bug 1744009 Gecko will consistently fire these events. This allows
activating stuff via keyboard on Android like in every other OS (if you
have a keyboard attached of course) and is generally more consistent.
We remove MOZ_USE_NATIVE_POPUP_WINDOWS since it's unused.
Differential Revision: https://phabricator.services.mozilla.com/D136073
This patch refactors the memory handling code for child processes into
MemoryController and applies the same logic for the main process.
This patch also makes it so we respond to `onLowMemory` and `onTrimMemory` for
non-background processes too, since we have reports that this might cause
problems when switching between tabs in Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D136383
The web-platform-tests of Screen orientation API is often failure due to
"Request for fullscreen was denied because requesting element is not in the
currently focused tab.". Because, when orientation is changed, activity is
restarted.
So we should prevent restarting activity when changing it.
Differential Revision: https://phabricator.services.mozilla.com/D136441
This patch refactors the memory handling code for child processes into
MemoryController and applies the same logic for the main process.
This patch also makes it so we respond to `onLowMemory` and `onTrimMemory` for
non-background processes too, since we have reports that this might cause
problems when switching between tabs in Fenix.
Differential Revision: https://phabricator.services.mozilla.com/D136383
Although this test is included in `testing/web-platform/tests/screen-orientation/lock-basic.html`,
it is still timed out until fixing bug 1750147.
Differential Revision: https://phabricator.services.mozilla.com/D136118
This ensures that geckoview's startup() calls
Blocklist.loadBlocklistAsync(). Due to bug 1730026, this is run for
each new tab rather than just once, so we also ensure that we only
check for new entries the first time the blocklist is loaded.
We also add a mochitest that simply ensures that the gfx blocklist is
initialized. We already have extensive xpcshell tests to test the
blocklist functionality. And due to the fact the blocklist is lazily
initialized, attempting to do more extensive testing would initialize
the blocklist even if it wasn't initialized in startup, negating the
value of the test.
Differential Revision: https://phabricator.services.mozilla.com/D135607
On Android we use SurfaceTextures and Surfaces to render video and
webgl. These are allocated by content processes using the
SurfaceAllocator, which connects to a SurfaceAllocatorService running
in the parent process. The content process renders in to the
Surface (by attaching it to a media codec, or creating a GL context
with it for webgl), and the compositor renders the output
SurfaceTexture in the parent process.
With the GPU process this poses a difficulty, as we need to allocate
SurfaceTextures in either the parent process or GPU process, depending
on whether the GPU process is enabled. Additionally, we don't want to
run extra android Services in child processes such as the GPU process,
as process management is tricky and we want to contain it to a single
place.
This patch makes it so that SurfaceAllocatorService is not really an
android Service any more, just an singleton object which implements
the ISurfaceAllocator interface. It is renamed to
RemoteSurfaceAllocator to reflect that. A new method
getProcessManager() is added to the IProcessManager interface, which
child processes can use to fetch the surface allocator. It returns
either the parent process instance, or fetches the instance from the
GPU process using IChildProcess.getSurfaceAllocator().
Differential Revision: https://phabricator.services.mozilla.com/D133107
When looking test failure, I found that `onOrientationLock` always returned
null in geckoview-junit since default method is called.
We should use use `delegateDuringNextWait` instead of `waitUntilCalled`.
Differential Revision: https://phabricator.services.mozilla.com/D135574
`OrientationDelegateTest#orientationLockedExistingOrientation` often timed out
since Gecko's orientation information and GeckoView's aren't same value.
If `GeckoScreenOrientation.update()` is called during `mShouldNotify` is false,
GeckoView doesn't notify Gecko of current orientation information.
Then, `GeckoScreenOrientation.enableNotifications()` also doesn't notify it
since `mShouldNotify` was false. So then, when `update()` is called by lock
screen, since cached orientation information in GeckoView is same value,
GeckoView doesn't notify it even if Gecko's orientation information and
GeckoView's information aren't same value.
So we should notify Gecko of current orientation information to all processes
when `enableNotifications` is called.
Differential Revision: https://phabricator.services.mozilla.com/D135855
Not sure how this code came to be, but it produces an empty javadoc jar.
The patch fixes the javadoc jar task so that it actually collects the javadoc
files.
Differential Revision: https://phabricator.services.mozilla.com/D135752
In Bug 1724480, a change was made to not sync libraries if there is no compile
environment.
This change did not account for artifact builds, for which there is no compile
environment but do have libraries anyway.
Differential Revision: https://phabricator.services.mozilla.com/D135721
geckoview-exoplayer2 does not differ between lite and omni builds so we don't
publish an -omni version.
The dependency to exoplayer2, however, does specify the -omni suffix so
geckoview ends up depending on a non-existent geckoview-exoplayer2-omni.
To fix this we don't add the -omni suffix in geckoview-exoplayer2 and keep it
only for geckoview.
Differential Revision: https://phabricator.services.mozilla.com/D135707