Commit Graph

31144 Commits

Author SHA1 Message Date
Jamie Nicol
8fb7eecd6e Bug 1754334 - Return error when GPU process crash occurs during screen pixels request. r=agi
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
2022-02-09 19:36:49 +00:00
Makoto Kato
926307a1d7 Bug 1753919 - AndroidWebAuthnTokenManager uses GeckoResult directly instead of callback. r=geckoview-reviewers,agi
Since WebAuthnTokenManager uses GeckoReuslt, we can remove callback of WebAuthnTokenManager.

Differential Revision: https://phabricator.services.mozilla.com/D137973
2022-02-09 06:59:52 +00:00
Agi Sferro
552a9e761b Bug 1754244 - Remove deprecated enterpiseRootsEnabled. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D138165
2022-02-08 18:04:26 +00:00
Agi Sferro
b01d2a756c Bug 1750623 - Always set isTopLevel=true for ENV_EXTENSION senders. r=robwu,jonalmeida
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
2022-02-08 17:27:49 +00:00
Sylvestre Ledru
caaedeee98 Bug 1753413 - fx doc: Remove whitespaces, trailing lines & windows CR r=andi,perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D137741
2022-02-03 18:34:58 +00:00
Jamie Nicol
d3e80e9854 Bug 1750234 - Handle GPU process crash when rendering video and webgl on Android. r=jgilbert,jolin
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
2022-02-02 17:01:02 +00:00
William Durand
b459566546 Bug 1751154 - More consistent error handling for frameIds parameter in scripting API. r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D137005
2022-01-28 19:13:05 +00:00
Emilio Cobos Álvarez
1f99c522f0 Bug 1752523 - Fix handling of non-multiple <select> with size >1. r=agi
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
2022-01-28 18:40:13 +00:00
Anastasios Bithas
d756776295 Bug 1751923 - Add targetSdkVersion and minSdkVersion to gradle.build of exoplayer2 r=agi
Adding the targetSdkVersion and minSdkVersion so that the READ_PHONE_STATE android permission is no longer implied.

Differential Revision: https://phabricator.services.mozilla.com/D137072
2022-01-28 16:36:55 +00:00
Makoto Kato
77a88ff153 Bug 1750147 - Use DisplayManager to detect orientation change. r=geckoview-reviewers,agi,calu
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
2022-01-27 06:17:21 +00:00
Agi Sferro
722cb28924 Bug 1750231 - Add WebRequest::beConservative. r=calu,jonalmeida
Differential Revision: https://phabricator.services.mozilla.com/D136387
2022-01-26 20:11:45 +00:00
Agi Sferro
b968f24595 Bug 1750231 - Add bug # to CHANGELOG. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D136385
2022-01-26 20:11:44 +00:00
Emilio Cobos Álvarez
90a0deb6cb Bug 1752133 - Fix a couple more issues with the select dropdown on Android. r=agi
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
2022-01-26 16:48:55 +00:00
Agi Sferro
b1f93026e6 Bug 1745996 - Send a memory pressure event when deactivating sessions. r=jnicol,calu
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
2022-01-26 16:40:56 +00:00
Agi Sferro
bea25df6ff Bug 1751941 - Add version{Code,Name} to geckoview_example, test_runner. r=calu
This allows consumers like Marionette to query the Gecko version for
GeckoViewExample and test_runner.

Differential Revision: https://phabricator.services.mozilla.com/D136937
2022-01-25 20:00:30 +00:00
Emilio Cobos Álvarez
a5779bc197 Bug 1751674 - Appease eslint.
MANUAL PUSH: Trivial tweak CLOSED TREE
2022-01-24 22:18:06 +01:00
Emilio Cobos Álvarez
7aa9538490 Bug 1751674 - Fix a couple issues with my patch for bug 1750395. r=agi
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
2022-01-24 21:07:41 +00:00
Emilio Cobos Álvarez
91bea3f4fb Bug 1750395 - Use mozshowdropdown events to show select dropdown. r=agi
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
2022-01-21 11:08:38 +00:00
Agi Sferro
8dcdd10903 Bug 1750878 - Send low-memory events in main process. r=calu
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
2022-01-20 23:47:15 +00:00
Cristian Tuns
2cb68401e0 Backed out changeset 62ff4a66c1c6 (bug 1750878) for causing Btime failures CLOSED TREE 2022-01-20 04:03:20 -05:00
Makoto Kato
961343254e Bug 1750937 - Don't restart test runner activity when orientation is changed. r=geckoview-reviewers,owlish
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
2022-01-20 02:20:26 +00:00
Agi Sferro
8047880a90 Bug 1750878 - Send low-memory events in main process. r=calu
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
2022-01-19 20:23:14 +00:00
Jamie Nicol
3d79bd207c Bug 1750569 - Add test to ensure screen pixels requests succeed if the GPU process crashes. r=agi
Differential Revision: https://phabricator.services.mozilla.com/D136152
2022-01-19 16:14:30 +00:00
Agi Sferro
9e8a5434d9 Bug 1728742 - Reject invalid schemes in onLoadRequest. r=jonalmeida
Differential Revision: https://phabricator.services.mozilla.com/D135629
2022-01-18 22:14:28 +00:00
Makoto Kato
6881fd9c1b Bug 1750498 - Better support orientation.lock('portrait') and orientation.lock('landscape'). r=geckoview-reviewers,owlish
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
2022-01-18 10:36:25 +00:00
Jamie Nicol
86e768faf8 Bug 1749520 - Ensure remote gfx blocklist is initialized on geckoview. r=robwu,agi
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
2022-01-17 15:24:34 +00:00
Makoto Kato
9e9748390b Bug 1750142 - Support screen.orientation.lock('any') on GeckoView backend. r=geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D135981
2022-01-15 11:19:55 +00:00
Jamie Nicol
012c682e1a Bug 1742569 - Create RemoteSurfaceAllocator in either parent or GPU process. r=agi,gfx-reviewers,aosmond
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
2022-01-14 16:20:59 +00:00
Makoto Kato
df7f7503f4 Bug 1748981 - Use delegateDuringNextWait when returning GeckoResult. r=calu
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
2022-01-14 08:33:14 +00:00
Makoto Kato
71bbf38c5a Bug 1747039 - We should notify Gecko of current orientation information to all process when enableNotifications is called. r=calu
`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
2022-01-14 05:53:34 +00:00
Mike Kaply
0b3cfeaed2 Bug 1733497 - Remove region.properties. r=geckoview-reviewers,m_kato,flod
Differential Revision: https://phabricator.services.mozilla.com/D134427
2022-01-13 21:18:30 +00:00
Agi Sferro
2448786acb Bug 1749838 - Fix typo in CHANGELOG.md. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D135750
2022-01-13 15:58:53 +00:00
Agi Sferro
3d9d9f6607 Bug 1749652 - Actually publish javadoc jar contents. r=calu
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
2022-01-13 15:58:52 +00:00
Alexandru Michis
c5fbfa6ff2 Backed out changeset db861e2fd044 (bug 1749652) as requested by agi.
CLOSED TREE
2022-01-13 17:55:26 +02:00
Hannah Peuckmann
f5c826b962 Bug 1745389 - Split up SecuritySettingsCleaner. r=geckoview-reviewers,pbz,keeler,jonalmeida
Differential Revision: https://phabricator.services.mozilla.com/D134119
2022-01-13 15:04:05 +00:00
Alexandre Lissy
161f130b0a Bug 1731890 - Adding Utility process with basic sandbox r=agi,nika,bobowen
Differential Revision: https://phabricator.services.mozilla.com/D126297
2022-01-12 20:52:58 +00:00
Agi Sferro
24fb67bde3 Bug 1749693 - Include libraries in artifact builds. r=calu,jonalmeida
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
2022-01-12 18:06:13 +00:00
Agi Sferro
41207f7833 Bug 1749729 - Do not include -omni suffix in geckoview-exoplayer2. r=jonalmeida
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
2022-01-12 18:04:09 +00:00
Hannah Peuckmann
de7d505cc3 Bug 1748978 - Clean up CLEAR_APPCACHE flag. r=pbz,geckoview-reviewers,calu
Differential Revision: https://phabricator.services.mozilla.com/D135342
2022-01-12 16:50:23 +00:00
Agi Sferro
f993cdb15f Bug 1749652 - Fix javadoc path in gv-docs. r=calu
The javdoc path changed after Bug 1724480.

Differential Revision: https://phabricator.services.mozilla.com/D135708
2022-01-12 16:37:16 +00:00
Marian-Vasile Laza
d562d1fa70 Backed out 2 changesets (bug 1748981) for causing geckoview test failures. CLOSED TREE
Backed out changeset 5e151bd74f2a (bug 1748981)
Backed out changeset 4df658fcf42d (bug 1748981)
2022-01-12 14:15:25 +02:00
Makoto Kato
caf7db3528 Bug 1748981 - Use delegateDuringNextWait when returning GeckoResult. r=calu
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
2022-01-12 00:12:15 +00:00
Agi Sferro
de1bc2e2d0 Bug 1744855 - Upgrade GeckoView dependencies. r=owlish
Differential Revision: https://phabricator.services.mozilla.com/D133154
2022-01-11 19:16:04 +00:00
Agi Sferro
fe94caaf56 Bug 1743469 - Target android 31. r=jgraham,jnicol,calu
Differential Revision: https://phabricator.services.mozilla.com/D133153
2022-01-11 19:16:03 +00:00
Agi Sferro
3004b12f76 Bug 1745246 - Make @interface classes public. r=jonalmeida
Differential Revision: https://phabricator.services.mozilla.com/D135616
2022-01-11 19:16:03 +00:00
Agi Sferro
53378a9401 Bug 1745246 - Move org/mozilla/thirdparty to it's own module. r=calu
This allows us to decouple GeckoView from exoplayer2, have it's own Java
settings and not pollute GeckoView's dependencies.

Differential Revision: https://phabricator.services.mozilla.com/D133792
2022-01-11 19:16:02 +00:00
Agi Sferro
b27078be09 Bug 1745246 - Move org/mozilla/thirdparty to mobile/android/exoplayer2. r=calu
Temporary commit to help code review.

This patch just moves the files without any further change. Actual build
changes will happen in a later patch.

Differential Revision: https://phabricator.services.mozilla.com/D133791
2022-01-11 19:16:02 +00:00
Agi Sferro
51f42fd9a0 Bug 1745246 - Allow specifying multiple maven artifacts from build. r=calu,ahal
This patch introduces a new field maven-artifacts which allows specifying a
list of maven artifacts that will be generated by a build and published to our
maven repository.

This allows us to split up GeckoView into separate maven packages.

Differential Revision: https://phabricator.services.mozilla.com/D133790
2022-01-11 19:16:01 +00:00
Agi Sferro
024994e801 Bug 1724480 - Upgrade JDK to Java 17. r=glandium,ahal,calu
Differential Revision: https://phabricator.services.mozilla.com/D131972
2022-01-11 19:16:01 +00:00
Agi Sferro
10649c9480 Bug 1724480 - Upgrade to apilint 0.5.1. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D132530
2022-01-11 19:16:01 +00:00