It makes no sense that the first thing in the session would be considered as
wrapping, it was happening only because we were incorrectly failing to find a
"visible" range deep in Gecko (so we started back from the beginning of the
document, wrapping).
Differential Revision: https://phabricator.services.mozilla.com/D71157
No one seems to reference `dom.event.touch.coalescing.enabled` after landing Bug 1291373.
So remove it.
Differential Revision: https://phabricator.services.mozilla.com/D70794
--HG--
extra : moz-landing-system : lando
And batch them when notifying child processes.
This makes RegisterVisitedQuery potentially notify synchronously, but changes
the code to deal with it properly.
Differential Revision: https://phabricator.services.mozilla.com/D69187
--HG--
extra : moz-landing-system : lando
Add a --gpu option to 'mach android-emulator' as a convenient way to over-ride the -gpu argument
passed to the emulator.
Also check the environment for MOZ_EMULATOR_COMMAND_ARGS to allow for additional over-rides
of the emulator command line.
Differential Revision: https://phabricator.services.mozilla.com/D70914
--HG--
extra : moz-landing-system : lando
This allows other front-ends to know which permissions they should prompt for,
like GeckoView.
Differential Revision: https://phabricator.services.mozilla.com/D70102
--HG--
extra : moz-landing-system : lando
This is needed in order to implement `CreateListener()`, which is used
when DocumentChannel is enabled.
Differential Revision: https://phabricator.services.mozilla.com/D67682
--HG--
extra : moz-landing-system : lando
This is a very performance-critical path, so we want to avoid
dispatching the value listener on a future loop iteration.
Differential Revision: https://phabricator.services.mozilla.com/D70247
--HG--
extra : moz-landing-system : lando
Converts layout.framevisibility.numscrollportwidths and layout.framevisibility.numscrollportheights to static prefs.
Differential Revision: https://phabricator.services.mozilla.com/D69615
--HG--
extra : moz-landing-system : lando
The interface changes which GeckoViewNavigation.jsm is being updated for are
performed in earlier parts. This patch just covers the required changes to
frontend code to propagate this information down to the nsFrameLoader when it is
created.
Differential Revision: https://phabricator.services.mozilla.com/D67054
--HG--
extra : moz-landing-system : lando
This is necessary to avoid the use of setOriginAttributesBeforeLoading, which is
being removed in this patch set.
Differential Revision: https://phabricator.services.mozilla.com/D67042
--HG--
extra : moz-landing-system : lando
We change a few things in this patch:
* We modify `ServiceAllocator` to support multiple bindings:
* Since Android distinguishes unique bindings via unique `ServiceConnection`
objects, we add a `Binding` class that provides that bare-bones
distinction but just forwards the `ServiceConnection` callbacks to its
`InstanceInfo` owner.
* Each `InstanceInfo` represents one content process instance, and it holds
references to between 0 and 3 `Binding` objects, one for each possible
priority level.
* After changing the current priority level of an `InstanceInfo`, we call
the `updateBindings` method to add or drop bindings as necessary to
effect the correct level.
* We add code to support the new `Context.updateServiceGroup` API starting
with Android 10. Essentially it describes to Android the relative
importance of multiple services running within the same priority level
(think of it like how we rank our P2 bugs).
* We add `GeckoProcessManager.setProcessPriority` to receive prioritization
changes from Gecko and wire that into the `ServiceAllocator`. We start new
processes with `PriorityLevel.BACKGROUND` and then Gecko subsequently adjusts
as necessary.
* Once this lands we must also set `dom.ipc.processPriorityManager.enabled=true`
to experiment with e10s-multi.
Differential Revision: https://phabricator.services.mozilla.com/D68419
--HG--
extra : moz-landing-system : lando
Per https://developer.android.com/studio/releases/build-tools, the default
version of the build tools used is internal to the Gradle plugin for Android,
which in the current version of Gradle is 28. To use 29, we need to explicitly
specify that in `.gradle` files using `buildToolsVersion`.
We also change the specification of `compileSdkVersion` to obtain that
information from the build configuration.
Differential Revision: https://phabricator.services.mozilla.com/D69632
--HG--
extra : moz-landing-system : lando
The interface changes which GeckoViewNavigation.jsm is being updated for are
performed in earlier parts. This patch just covers the required changes to
frontend code to propagate this information down to the nsFrameLoader when it is
created.
Differential Revision: https://phabricator.services.mozilla.com/D67054
--HG--
extra : moz-landing-system : lando
This is necessary to avoid the use of setOriginAttributesBeforeLoading, which is
being removed in this patch set.
Differential Revision: https://phabricator.services.mozilla.com/D67042
--HG--
extra : moz-landing-system : lando
This is a regression by bug 1509527.
I should set TYPE_TEXT_FLAG_CAP_SENTENCES for `textarea` element and
contenteditable again.
Also, Gecko doesn't set valid type hint for input element yet. So I add a
workaround to test file. It will be fixed by bug 1424284. And this fix removes
unused condition for` textarea`.
Differential Revision: https://phabricator.services.mozilla.com/D69214
--HG--
extra : moz-landing-system : lando
This test verifies that history is preserved when navigating from an extension
page to a web content page.
Today this involves going from the main process to the content process, but
when we enable remote extensions this will involve going from one content
process (the extension process) to another content process (the web process) so
to avoid forgetting about this we can introduce a test now that should still
pass in both scenarios.
Differential Revision: https://phabricator.services.mozilla.com/D69455
--HG--
extra : moz-landing-system : lando
It started, as most things do, with a software upgrade.
Upgrading the Android SDK version produced mysterious build errors:
```
java.lang.RuntimeException: ... Error while executing process /builds/worker/fetches/android-sdk-linux/build-tools/29.0.3/aidl ...
```
Looking a little further back in the log, one found the mysterious
error:
```
/builds/worker/fetches/android-sdk-linux/build-tools/29.0.3/aidl: error while loading shared libraries: /builds/worker/fetches/clang/lib/libc++.so: file too short
```
And when one investigated that file, one found that all `libc++.so` contained
was:
```
INPUT(libc++.so.1 -lc++abi)
```
which was obviously not any kind of loadable shared library.
The `libc++.so` file was meant as a redirect, an artifact placed so people
could say `-lc++` on their compiler command lines and things would Just Work.
The intent was that programs would link to `libc++.so.1` (or whatever other
soversion was in use) and that they wouldn't have to worry about `-lc++abi` or
any other private implementation details of libc++. Why, then, was `aidl`
linking to `libc++.so`?
Looking at `ldd aidl` on a local machine says:
```
...
libc++.so => $HOME/.mozbuild/android-sdk-linux/build-tools/29.0.3/./lib64/libc++.so (0x00007f8b4b2d1000)
...
```
and poking at `aidl` with `readelf --dynamic -W` indicated a partial solution
to the problem:
```
...
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/../lib64:$ORIGIN/lib64]
...
```
`aidl` contained a `DT_RUNPATH` entry for `libc++.so` that specified to the
linker "find my `libc++.so` at a path relative to my current binary location."
Presumably this was done so that `aidl` would link to a specific `libc++.so`
and not pick up a random `libc++.so` from the system on which `aidl` was
running.
...Except that setting `LD_LIBRARY_PATH`, which we specify during our builds for
various reasons, takes precedence over `DT_RUNPATH`. So invoking `aidl` was
looking for `libc++.so` along `LD_LIBRARY_PATH`, finding this linker script
that was meant to be used only by the compiler, and attempting to use it like
a real shared library.
Great, we understand the problem now; what do we do about it?
Unwinding our use of `LD_LIBRARY_PATH` is an involved task. One further
wrinkle that wasn't mentioned above is that not every Android build that we
run failed after the SDK update: our x86-64 fuzzing build was fine, as was the
ARM PGO instrumentation build. Presumably, those builds set `LD_LIBRARY_PATH`
in slightly different ways compared to our other builds, and those differences
in setting `LD_LIBRARY_PATH` contribute to `aidl` somehow not getting invoked
with `LD_LIBRARY_PATH` set. It is not obvious to me how difficult getting a
consistent `LD_LIBRARY_PATH` setting is.
This next part is conjecture -- informed conjecture, but conjecture
nonetheless. When we invoke gradle for the first time, a separate daemon
process is started, presumably to make various Java startup problems go away.
What we would like to have happen, and what appears to happen, is that
everything that gradle does is actually spawned from the daemon itself, not
from the invoked gradle process. So if we could get the daemon invoked with
the correct environment (i.e. no `LD_LIBRARY_PATH` present), everything would
just work, because `aidl` would be launched from an environment that will
respect its `DT_RUNPATH` setting.
This change assumes that gradle does not invoke things that depend on
`LD_LIBRARY_PATH`, which is not at all clear; I think there are cases where we
can go `mach -> gradle -> mach -> ... -> clang`. But those cases don't seem
to come up in automation (perhaps due to every build being a clobber), and if
they come up on local developer machines, local developer machines seem
unlikely to have `LD_LIBRARY_PATH` set (mandatory invocation of xkcd#1172).
All of that is to say that this patch takes a semi-hacky approach to the
problem: when we invoke gradle, we make sure that we're invoking it with an
environment that doesn't contain `LD_LIBRARY_PATH`. And doing so avoids all
of the problems outlined above.
Differential Revision: https://phabricator.services.mozilla.com/D69374
--HG--
extra : moz-landing-system : lando
mozconfig.common.override is supposed to be a way for try pushes to change any options that may have been previously set. To do this effectively, it needs to be the last thing in the mozconfig.
Differential Revision: https://phabricator.services.mozilla.com/D69045
--HG--
extra : moz-landing-system : lando
Gecko uses a canary file to determine if the last startup was succesful or
not and subsequently uses that status to determine if the startup cache
should be used. The file should be deleted either on a clean
exit or after the browser has succesfully started after a delay. On
android there will never be a clean exit and file was not manually being
deleted after startup. To fix this, delete the file after all the idle
startup tasks finish.
Differential Revision: https://phabricator.services.mozilla.com/D68451
--HG--
extra : moz-landing-system : lando
`inputmode` is lower case except to `mozAwesomebar`. So it is unnecessary to
use `equalsIgnoreCase`.
Also, `mozAwesomebar` is for `inputmode`, not `type`. So this changeset has
this fix.
Differential Revision: https://phabricator.services.mozilla.com/D68332
--HG--
extra : moz-landing-system : lando
`inputmode=none` has to close software keyboard. `inputmode` value is lower
case except to `mozAwesomebar` by bug 1618763, so we don't have to use
`equalsIgnoreCase` for `inputmode`.
Differential Revision: https://phabricator.services.mozilla.com/D67459
--HG--
extra : moz-landing-system : lando
This flag allows embedders to know when a onLoadRequest call is generated by
the app or not. Embedders can use this to skip expensive checks in
app-generated onLoadRequest calls.
Differential Revision: https://phabricator.services.mozilla.com/D68595
--HG--
extra : moz-landing-system : lando
We change a few things in this patch:
* We modify `ServiceAllocator` to support multiple bindings:
* Since Android distinguishes unique bindings via unique `ServiceConnection`
objects, we add a `Binding` class that provides that bare-bones
distinction but just forwards the `ServiceConnection` callbacks to its
`InstanceInfo` owner.
* Each `InstanceInfo` represents one content process instance, and it holds
references to between 0 and 3 `Binding` objects, one for each possible
priority level.
* After changing the current priority level of an `InstanceInfo`, we call
the `updateBindings` method to add or drop bindings as necessary to
effect the correct level.
* We add code to support the new `Context.updateServiceGroup` API starting
with Android 10. Essentially it describes to Android the relative
importance of multiple services running within the same priority level
(think of it like how we rank our P2 bugs).
* We add `GeckoProcessManager.setProcessPriority` to receive prioritization
changes from Gecko and wire that into the `ServiceAllocator`. We start new
processes with `PriorityLevel.BACKGROUND` and then Gecko subsequently adjusts
as necessary.
* Once this lands we must also set `dom.ipc.processPriorityManager.enabled=true`
to experiment with e10s-multi.
Differential Revision: https://phabricator.services.mozilla.com/D68419
--HG--
extra : moz-landing-system : lando
We change a few things in this patch:
* We modify `ServiceAllocator` to support multiple bindings:
* Since Android distinguishes unique bindings via unique `ServiceConnection`
objects, we add a `Binding` class that provides that bare-bones
distinction but just forwards the `ServiceConnection` callbacks to its
`InstanceInfo` owner.
* Each `InstanceInfo` represents one content process instance, and it holds
references to between 0 and 3 `Binding` objects, one for each possible
priority level.
* After changing the current priority level of an `InstanceInfo`, we call
the `updateBindings` method to add or drop bindings as necessary to
effect the correct level.
* We add code to support the new `Context.updateServiceGroup` API starting
with Android 10. Essentially it describes to Android the relative
importance of multiple services running within the same priority level
(think of it like how we rank our P2 bugs).
* We add `GeckoProcessManager.setProcessPriority` to receive prioritization
changes from Gecko and wire that into the `ServiceAllocator`. We start new
processes with `PriorityLevel.BACKGROUND` and then Gecko subsequently adjusts
as necessary.
* Once this lands we must also set `dom.ipc.processPriorityManager.enabled=true`
to experiment with e10s-multi.
Differential Revision: https://phabricator.services.mozilla.com/D68419
--HG--
extra : moz-landing-system : lando
This flag allows embedders to know when a onLoadRequest call is generated by
the app or not. Embedders can use this to skip expensive checks in
app-generated onLoadRequest calls.
Differential Revision: https://phabricator.services.mozilla.com/D68595
--HG--
extra : moz-landing-system : lando
We change a few things in this patch:
* We modify `ServiceAllocator` to support multiple bindings:
* Since Android distinguishes unique bindings via unique `ServiceConnection`
objects, we add a `Binding` class that provides that bare-bones
distinction but just forwards the `ServiceConnection` callbacks to its
`InstanceInfo` owner.
* Each `InstanceInfo` represents one content process instance, and it holds
references to between 0 and 3 `Binding` objects, one for each possible
priority level.
* After changing the current priority level of an `InstanceInfo`, we call
the `updateBindings` method to add or drop bindings as necessary to
effect the correct level.
* We add code to support the new `Context.updateServiceGroup` API starting
with Android 10. Essentially it describes to Android the relative
importance of multiple services running within the same priority level
(think of it like how we rank our P2 bugs).
* We add `GeckoProcessManager.setProcessPriority` to receive prioritization
changes from Gecko and wire that into the `ServiceAllocator`. We start new
processes with `PriorityLevel.BACKGROUND` and then Gecko subsequently adjusts
as necessary.
* Once this lands we must also set `dom.ipc.processPriorityManager.enabled=true`
to experiment with e10s-multi.
Differential Revision: https://phabricator.services.mozilla.com/D68419
--HG--
extra : moz-landing-system : lando
`ServiceConnection.onServiceDisconnected` is not called if
`Context.unbindService` finished cleanly. We should be clearing `mService` in
that case.
Furthermore, if the service did die unexpectedly and
`ServiceConnection.onServiceDisconnected` was called, we need to explicitly
unbind so that Android does not automatically reconnect the binding.
Differential Revision: https://phabricator.services.mozilla.com/D68417
--HG--
extra : moz-landing-system : lando
The omni.ja file contains all the javascript code that GeckoView uses
internally. Right now the omni.ja file is compressed in the APK which causes
GeckoView to uncompress the omni.ja file in memory before it can start doing
anything else. This takes a long time, on some profiles it delays startup by
about 400ms.
Storing the omni.ja uncompressed allows GeckoView to just map it in memory
bypassing the uncompress step.
Differential Revision: https://phabricator.services.mozilla.com/D67943
--HG--
extra : moz-landing-system : lando
Converts `security.mixed_content.block_object_subrequest`, `security.mixed_content.block_display_content`, `security.mixed_content.upgrade_display_content`, and `security.mixed_content.block_active_content` to static prefs.
Differential Revision: https://phabricator.services.mozilla.com/D67205
--HG--
extra : moz-landing-system : lando
This ensures that CSS coordinates (which is what the synthesizeTap test case
passes to GeckoSessionTestRule.synthesizeTap()) are equal to Screen coordinates
(which is what that function expects).
An alternative approach would be to query the resolution and convert from CSS
to Screen coordinates, either in the test case or inside synthesizeTap().
Differential Revision: https://phabricator.services.mozilla.com/D67519
--HG--
extra : moz-landing-system : lando
When running mochitests on real hardware, we sometimes lose the network,
causing strange timeouts. It's better if we crash immediately in those
situations to avoid confusion.
Differential Revision: https://phabricator.services.mozilla.com/D67383
--HG--
extra : moz-landing-system : lando
We also don't pass `BYPASS_LOAD_URI_DELEGATE` since it's ignored anyway for
reloads.
Differential Revision: https://phabricator.services.mozilla.com/D67654
--HG--
extra : moz-landing-system : lando
When running mochitests on real hardware, we sometimes lose the network,
causing strange timeouts. It's better if we crash immediately in those
situations to avoid confusion.
Differential Revision: https://phabricator.services.mozilla.com/D67383
--HG--
extra : moz-landing-system : lando
When you type in a textarea, and zoom to position the caret, then click, we'll
scroll all the way to the top of the textarea, via:
IMEStateManager::OnClickInEditor -> SetIMEState -> SetInputContext -> mEditable->NotifyIME(EditableListener::NOTIFY_IME_OPEN_VKB);
Even if the keyboard was already displayed. In this case, we're not moving
focus, and panning to the start causes more issues than it fixes. Prevent
zooming to the start of the input in this case, but still do it if we get the
resize event (and thus toggle the keyboard).
Differential Revision: https://phabricator.services.mozilla.com/D67222
--HG--
extra : moz-landing-system : lando
That data is not the right one anyway, since it comes from the previous page
rather than the current one.
Note: this is also broken on desktop too. It will be fixed once we move to main
process history (hopefully?).
Differential Revision: https://phabricator.services.mozilla.com/D67392
--HG--
extra : moz-landing-system : lando
Converts `security.mixed_content.block_object_subrequest`, `security.mixed_content.block_display_content`, `security.mixed_content.upgrade_display_content`, and `security.mixed_content.block_active_content` to static prefs.
Differential Revision: https://phabricator.services.mozilla.com/D67205
--HG--
extra : moz-landing-system : lando
There are cases when GV is being animated and it ends up being smaller than the
dynamic toolbar for a few frames. When that happens we really don't want to
crash and we can just ignore it.
Differential Revision: https://phabricator.services.mozilla.com/D67364
--HG--
extra : moz-landing-system : lando
Gecko don't commit composition when software keyboard calls
InputConnection.finishComposingText. It is incompatible with Blink's behaviour.
BaseInputConnection.finishComposingText() implementation is the following.
1. Begin batch edit.
2. Remove all composition span flag.
3. End batch edit.
So if no composition after batch edit is finished, we should commit it on Gecko
to synchronize composition state.
Differential Revision: https://phabricator.services.mozilla.com/D66370
--HG--
extra : moz-landing-system : lando
This allows us to asynchronously wait for a given `GeckoThread` state
to be reached.
Differential Revision: https://phabricator.services.mozilla.com/D66585
--HG--
extra : moz-landing-system : lando
The extension background page should be loaded when either an event needs
to be sent to it or after the browser has started up. When an extension
is updated the special startup event listeners do not appear to be built
yet and GeckoView was not sending browser started notification, which meant the
background page never being loaded.
Differential Revision: https://phabricator.services.mozilla.com/D66717
--HG--
extra : moz-landing-system : lando
Make the GeckoResult<WebExtension> returned by WebExtensionControll.install(BuiltIn) cancellable
Differential Revision: https://phabricator.services.mozilla.com/D64953
--HG--
extra : moz-landing-system : lando
This is both for future proofing (fetches could move any time although
they likely won't), and to fix the path on the future Windows PGO
cross builds, where the fetches path is not under $WORKSPACE.
Differential Revision: https://phabricator.services.mozilla.com/D66358
--HG--
extra : moz-landing-system : lando
We'll want to make some changes to this test when we enable e10s-multi by
default, but for now we just need to update the name of the single content
process to reflect the naming changes that were done in part 1 of this
patch series.
Differential Revision: https://phabricator.services.mozilla.com/D65641
--HG--
extra : moz-landing-system : lando
We change a lot of things in this patch:
* `ChildConnection` now inherits from `ServiceAllocator.InstanceInfo`, which
imbues the former with service allocation superpowers.
* We remove the `IBinder.linkToDeath` call and the `IBinder.DeathRecipient`
callback; a close review of the service binding APIs (and the actual
Android source code) clearly shows that
`ServiceConnection.onServiceDisconnected` already performs that role.
* We also greatly simplify unbinding, as a successful `Context.unbindService`
call does not require a subsequent `onServiceDisconnected` notification;
The `ServiceConnection` callbacks should be thought of as pertaining to
the acquisition and loss of `Binder` connections. On that note, to improve
the clarity of what those callbacks do, we now implement them as
`onBinderConnected` and `onBinderConnectionLost` overrides originating from
`ServiceAllocator.InstanceInfo`.
* We add the `ConnectionManager` class which handles the organization of
tracking which processes exist with which pid. Its public methods are named
such that it should be very clear what their purposes are.
* This patch adds a minimal amount of priority management code to
`ConnectionManager`. Right now we assume that everything is running at
`PriorityLevel.FOREGROUND` (i.e. `Context.BIND_IMPORTANT`). This will be
further improved in bug 1620145.
Differential Revision: https://phabricator.services.mozilla.com/D65640
--HG--
extra : moz-landing-system : lando
For testing purposes, we'll only support 3 at the moment.
Note that this does not materially affect our test builds, as e10s-multi is
still govered by the `dom.ipc.processCount` Gecko pref.
Differential Revision: https://phabricator.services.mozilla.com/D65639
--HG--
extra : moz-landing-system : lando
`ServiceAllocator` wraps the various `Context.bindService` APIs and manages
the allocation of service names (in the case of non-isolated services) or
instance names (in the case of isolated services on Android 10+).
During the first allocation of a content process, we construct a policy that
is used for all content process allocations.
The `DefaultContentPolicy` computes the maximum number of content processes
and then allocates those names using a `BitSet`.
The `IsolatedContentPolicy` tracks the number of live content processes, but
simply uses a monotonically-increasing counter for generating instance IDs.
This patch also adds a `ServiceUtils` class that contains numerous functions
relating to generating service names and retrieving information about
service definitions in this package.
* Content processes are now named `tab0` through `tabN`. When a single content
process name is used (either for single-e10s or for the process name
used by isolated services), we always use `tab0`.
* I am not wedded to the names of the priorities used in the `PriorityLevel`
enum -- suggestions welcome!
* Some of the `ServiceUtils` functions could arguably go into `ContextUtils`
instead, but I thought that this was fine since they are fairly specific
to this use case.
* Further modifications will need to be made to support multiple priorities.
This patch is enough to get everything up and running for testing, with
further prioritization work being done in bug 1620145.
Differential Revision: https://phabricator.services.mozilla.com/D65636
--HG--
extra : moz-landing-system : lando
We'll want to make some changes to this test when we enable e10s-multi by
default, but for now we just need to update the name of the single content
process to reflect the naming changes that were done in part 1 of this
patch series.
Differential Revision: https://phabricator.services.mozilla.com/D65641
--HG--
extra : moz-landing-system : lando
We change a lot of things in this patch:
* `ChildConnection` now inherits from `ServiceAllocator.InstanceInfo`, which
imbues the former with service allocation superpowers.
* We remove the `IBinder.linkToDeath` call and the `IBinder.DeathRecipient`
callback; a close review of the service binding APIs (and the actual
Android source code) clearly shows that
`ServiceConnection.onServiceDisconnected` already performs that role.
* We also greatly simplify unbinding, as a successful `Context.unbindService`
call does not require a subsequent `onServiceDisconnected` notification;
The `ServiceConnection` callbacks should be thought of as pertaining to
the acquisition and loss of `Binder` connections. On that note, to improve
the clarity of what those callbacks do, we now implement them as
`onBinderConnected` and `onBinderConnectionLost` overrides originating from
`ServiceAllocator.InstanceInfo`.
* We add the `ConnectionManager` class which handles the organization of
tracking which processes exist with which pid. Its public methods are named
such that it should be very clear what their purposes are.
* This patch adds a minimal amount of priority management code to
`ConnectionManager`. Right now we assume that everything is running at
`PriorityLevel.FOREGROUND` (i.e. `Context.BIND_IMPORTANT`). This will be
further improved in bug 1620145.
Differential Revision: https://phabricator.services.mozilla.com/D65640
--HG--
extra : moz-landing-system : lando
For testing purposes, we'll only support 3 at the moment.
Note that this does not materially affect our test builds, as e10s-multi is
still govered by the `dom.ipc.processCount` Gecko pref.
Differential Revision: https://phabricator.services.mozilla.com/D65639
--HG--
extra : moz-landing-system : lando
`ServiceAllocator` wraps the various `Context.bindService` APIs and manages
the allocation of service names (in the case of non-isolated services) or
instance names (in the case of isolated services on Android 10+).
During the first allocation of a content process, we construct a policy that
is used for all content process allocations.
The `DefaultContentPolicy` computes the maximum number of content processes
and then allocates those names using a `BitSet`.
The `IsolatedContentPolicy` tracks the number of live content processes, but
simply uses a monotonically-increasing counter for generating instance IDs.
This patch also adds a `ServiceUtils` class that contains numerous functions
relating to generating service names and retrieving information about
service definitions in this package.
* Content processes are now named `tab0` through `tabN`. When a single content
process name is used (either for single-e10s or for the process name
used by isolated services), we always use `tab0`.
* I am not wedded to the names of the priorities used in the `PriorityLevel`
enum -- suggestions welcome!
* Some of the `ServiceUtils` functions could arguably go into `ContextUtils`
instead, but I thought that this was fine since they are fairly specific
to this use case.
* Further modifications will need to be made to support multiple priorities.
This patch is enough to get everything up and running for testing, with
further prioritization work being done in bug 1620145.
Differential Revision: https://phabricator.services.mozilla.com/D65636
--HG--
extra : moz-landing-system : lando
Add GeckoSession.PermissionDelegate.PERMISSION_MEDIA_KEY_SYSTEM_ACCESS
for when media.eme.require-app-approval=true
Differential Revision: https://phabricator.services.mozilla.com/D65423
--HG--
extra : moz-landing-system : lando
Currently the preferences for remote profiling are stored on the debuggee. This leads
to a negative user experience, as oftentimes phones do not persist the preferences.
This patch changes the strategy to store one set of preferences for local profiling,
and a second set of preferences for remote profiling.
Differential Revision: https://phabricator.services.mozilla.com/D65148
--HG--
extra : moz-landing-system : lando
This removes the obsolete backend. Notes on some of the less obvious changes
made as part of this patch:
- some of the gFoo style getters in Blocklist.jsm were only used by the XML
version of the blocklist; I've removed them and tried to remove spurious
settings of those properties in the remaining tests.
- some utility methods (e.g. distribution information getters) were also only
used for the XML version (for the update URL).
- it's no longer necessary to test switching implementations.
- in browser/base/content/test/plugins/, we ran some tests from two manifests
in order to run them with both blocklist backends. The simplest way of
reducing this back down to one was to remove the remote-settings one. If I'd
been more future-oriented when I created the duplication, perhaps I would
have moved the XML version out into a different manifest instead, but I
didn't, so now it looks like we're removing the modern one, whereas really
we're going to be running the modern one as part of the "normal" tests and
we're no longer running the "old" tests.
- removed all mentions I could see of extensions.blocklist.url which is no
longer used for anything.
- per https://bugzilla.mozilla.org/show_bug.cgi?id=1016555#c23, updated
references for the OneCRL timing and how it relates to blocklist updates.
Differential Revision: https://phabricator.services.mozilla.com/D64933
--HG--
extra : moz-landing-system : lando
We won't need these suspend states anymore which were used for media control and audio focus on Fennec.
Differential Revision: https://phabricator.services.mozilla.com/D65265
--HG--
extra : moz-landing-system : lando
Mistakenly removed these lines which are still needed until we remove the
deprecated API.
Differential Revision: https://phabricator.services.mozilla.com/D65594
--HG--
extra : moz-landing-system : lando
An extension with an onUpdateAvailable listener should delay automatic
updating of the extension until the app is restarted. Add support for this
state and reject the update result with a new install error code.
Differential Revision: https://phabricator.services.mozilla.com/D65228
--HG--
extra : moz-landing-system : lando
Before this patch, the TabDelegate was "special" as in it had just one global
delegate that receives events for all extensions and sessions. This was done to
allow mochitests to call tabs.create and tabs.remove.
This hack is no longer needed as now we can notify the embedding layer that a
new extension has been installed and we have a way to list currently installed
extensions.
This patch makes TabDelegate behave the same as the other delegates
(ActionDelegate and MessageDelegate) and will allow further simplications of
the WebExtension Delegate code.
Differential Revision: https://phabricator.services.mozilla.com/D64799
--HG--
extra : moz-landing-system : lando
Android does not currently have anything similar to a 'required' state
to indicate that a field or input is required before submission. In this
patch we append a localized "required" string onto the node's hint.
The hint typically has the description of the node. If the node is an
entry the hint will have its label followed by the description.
Differential Revision: https://phabricator.services.mozilla.com/D65215
--HG--
extra : moz-landing-system : lando
Before this patch, the TabDelegate was "special" as in it had just one global
delegate that receives events for all extensions and sessions. This was done to
allow mochitests to call tabs.create and tabs.remove.
This hack is no longer needed as now we can notify the embedding layer that a
new extension has been installed and we have a way to list currently installed
extensions.
This patch makes TabDelegate behave the same as the other delegates
(ActionDelegate and MessageDelegate) and will allow further simplications of
the WebExtension Delegate code.
Differential Revision: https://phabricator.services.mozilla.com/D64799
--HG--
extra : moz-landing-system : lando
|get domFileOrDirectory| is sync so we cannot return a promise from there. We
instead resolve the DOMFile before returning from the file picker callback
which is async already.
Differential Revision: https://phabricator.services.mozilla.com/D65193
--HG--
extra : moz-landing-system : lando
Add a version of GeckoSession.reload that takes LOAD_FLAGS_* so
that it is possible to bypass caches and proxies on reload.
Differential Revision: https://phabricator.services.mozilla.com/D64809
--HG--
extra : moz-landing-system : lando
This class is not technically the thread itself, it's the runnable that the
sampling thread uses. This name is more accurate and clear for it.
Differential Revision: https://phabricator.services.mozilla.com/D64753
--HG--
extra : moz-landing-system : lando
Currently we only profile the Java Main Thread, and don't profile anything
else. This is not ideal, but this is how it works right now. And inside the
code index `0` was hardcoded on the most parts of the code. We can rollback
this patch once we want to implement profiling more than one thread, or we can
think about something more clever.
Differential Revision: https://phabricator.services.mozilla.com/D64752
--HG--
extra : moz-landing-system : lando
Design mode is different for event target, so I turn off it now. But this is enough for input and contenteditable.
Differential Revision: https://phabricator.services.mozilla.com/D64893
--HG--
extra : moz-landing-system : lando
This also makes `GeckoView#onTouchEvent()` always return `true`, because
returning `false` will cause us to not receive any more events for that
touch. We always want to receive events.
Differential Revision: https://phabricator.services.mozilla.com/D64781
--HG--
extra : moz-landing-system : lando
The Android-Gradle build plugin has evolved, as has GeckoView (it now
expects libraries in `libs/` instead of `assets/`), so we need to
ensure the libraries are copied into place at the right time.
To test this, you can use an artifact build. Run `./mach build`, and
then binary edit a string in `$TOPOBJDIR/dist/bin/libxul.so` (I used
Emacs and `bbe` to do that). Run `./mach android
build-geckoview_example`, and then verify the updated string has been
packaged, for example with something like:
```
unzip -c $TOPOBJDIR/gradle/build/mobile/android/geckoview_example/outputs/apk/withGeckoBinaries/debug/geckoview_example-withGeckoBinaries-debug.apk lib/x86_64/libxul.so | strings | grep NEW 'STRING'
```
Coincidentally, this is essentially the same issue as
https://github.com/mozilla/application-services/issues/2659.
Differential Revision: https://phabricator.services.mozilla.com/D64430
--HG--
extra : moz-landing-system : lando
In GeckoView every window has always exactly only one browser. Also selectedTab
is not defined.
Differential Revision: https://phabricator.services.mozilla.com/D64425
--HG--
extra : moz-landing-system : lando
Make it a regular stylesheet.
This allows it to be cached in shared memory if possible, and will allow me to
stop adding the stylesheet based on a pref for bug 1618202.
Differential Revision: https://phabricator.services.mozilla.com/D64377
--HG--
rename : mobile/android/themes/geckoview/content.css => layout/style/res/geckoview.css
extra : moz-landing-system : lando
Make it a regular stylesheet.
This allows it to be cached in shared memory if possible, and will allow me to
stop adding the stylesheet based on a pref for bug 1618202.
Differential Revision: https://phabricator.services.mozilla.com/D64377
--HG--
rename : mobile/android/themes/geckoview/content.css => layout/style/res/geckoview.css
extra : moz-landing-system : lando
Just inline them, they're not that many.
Using CSS variables is observable from content, which is not good. It also means
that we need an @import.
For bug 1618202, I plan to move this stylesheet to the global stylesheet cache.
This is so that I can add them based on prefs, but should also have memory
improvements (the stylesheet would be shared in memory across processes, see bug
1474793).
Differential Revision: https://phabricator.services.mozilla.com/D64375
--HG--
extra : moz-landing-system : lando
We don't need to package tests for builds that we don't actually run
tests from, but it is tricky to align this correctly by setting
MOZ_AUTOMATION_PACKAGE_TESTS=0 in relevant mozconfigs. Instead we can
set the environment variable in the task definition, and use a full
taskgraph verification check to ensure that the flag is only set on
builds that have tests.
The one tricky area is the win64-aarch64 builds, which have a workaround
by specifying the new skip-verify-test-packaging attribute.
In one case, win64-aarch64-shippable has tests that run against it, but
it copies those tests from a win64-aarch64-shippable-no-eme task, which
itself has no tests. Both of those tasks need to skip the verify check
as a result.
In another case, the win64-aarch64-eme task is an artifact build that
grabs test packages from the win64-aarch64 build. Since the win64-aarch64
build doesn't have tests, it needs to skip the verify check.
Differential Revision: https://phabricator.services.mozilla.com/D59426
--HG--
extra : moz-landing-system : lando
We don't need to package tests for builds that we don't actually run
tests from, but it is tricky to align this correctly by setting
MOZ_AUTOMATION_PACKAGE_TESTS=0 in relevant mozconfigs. Instead we can
set the environment variable in the task definition, and use a full
taskgraph verification check to ensure that the flag is only set on
builds that have tests.
The one tricky area is the win64-aarch64 builds, which have a workaround
by specifying the new skip-verify-test-packaging attribute.
In one case, win64-aarch64-shippable has tests that run against it, but
it copies those tests from a win64-aarch64-shippable-no-eme task, which
itself has no tests. Both of those tasks need to skip the verify check
as a result.
In another case, the win64-aarch64-eme task is an artifact build that
grabs test packages from the win64-aarch64 build. Since the win64-aarch64
build doesn't have tests, it needs to skip the verify check.
Differential Revision: https://phabricator.services.mozilla.com/D59426
--HG--
extra : moz-landing-system : lando
GeckoView doesn't need the hidden window loaded eagerly on startup. This
shaves off around ~100ms timing from XRE_main to DOMContentLoaded of
geckoview.xhtml.
Differential Revision: https://phabricator.services.mozilla.com/D63977
--HG--
extra : moz-landing-system : lando
In Bug 1617324 we started receiving calls for in-process windows for
WebBrowserChrome, which means we now have to handle the non-e10s case too. In
non-e10s there's only one process, so shouldLoadURI should always return true.
Differential Revision: https://phabricator.services.mozilla.com/D63748
--HG--
extra : moz-landing-system : lando
Based on crash report data, somehow we are reaching a state where we complete
a `GeckoResult` with a pid of 0.
This patch makes `ChildConnection.getPid()` infallible; it either returns a
valid pid or it throws an exception.
The fallible variant, `ChildConnection.getPidFallible()`, is useful for logging
or other scenarios where an invalid pid is okay.
Note that this patch likely does not conclusively eliminiate all crashes
surrounding invalid pids during child process creation; I have reason to believe
that once this patch lands we will likely see some crashes due to `getPid()`
exceptions out in the wild, but at least this patch will make those crash dumps
more actionable.
Differential Revision: https://phabricator.services.mozilla.com/D63719
--HG--
extra : moz-landing-system : lando
Turns out we have one more copy of the PGO-initializing mozconfig code for
Android, and that one was not enabling LTO.
Differential Revision: https://phabricator.services.mozilla.com/D63721
--HG--
extra : moz-landing-system : lando
If a keyboard-focused accessible is removed, the caret jumps to its
nearest ancestor. To avoid arbitrary accessibility focus moves, ignore
caret events that have no selection and are not focusable items.
Differential Revision: https://phabricator.services.mozilla.com/D63541
--HG--
extra : moz-landing-system : lando
The provision request is executed in background through AsyncTask and will
post the result once finished. However, when the DRM object is released
before onPostExecute() is called, there will be NPE. Use AsyncTask.cancel()
to avoid that.
Differential Revision: https://phabricator.services.mozilla.com/D63526
--HG--
extra : moz-landing-system : lando
The pref does not make a lot more sense now that we check autoplay on every
session.
Differential Revision: https://phabricator.services.mozilla.com/D63273
--HG--
extra : moz-landing-system : lando
This patch: makes the URL bar consistent with the location displayed and
actually switches to a the new tab when content code calls window.open or
tabs.create.
Differential Revision: https://phabricator.services.mozilla.com/D63224
--HG--
extra : moz-landing-system : lando
History is kept locally on the content process (or main process for main
process pages), so when going from one process to the other we need to restore
history. This will eventually be superseded by moving all history to the main
process, but we don't know when that's going to happen so we need to add this
workaround here. Desktop has the same workaround in place and this patch is
based on that code.
There are two places where we need to restore history:
- App navigates to page directly using `loadURI` or similar: in this case we
need to pass down the load details to the content process alongside the
history information so that we can restore and immediatelly navigate to the
new page. This also avoids an extra history reloading that ordinarely happens
when restoring history.
- App calls `goBack`, `goForward`, etc: in this case we don't need to reload a
page but just restore the history and adjust the `historyIndex`. I'm not
entirely sure why we need to add `1` to the `historyIndex` but that's what
Desktop does and it seems to work correctly so I just did it.
This patch changes `updateRemoteTypeForURI` to `updateRemoteAndNavigate` which
more closely matches what that method is doing now, this is similar to what
happens on desktop.
This patch also adds a `window.moduleManager` that can be used in Actors to
access the current `moduleManager`. I expect this to go away when we fully
migrate all modules to actors.
Differential Revision: https://phabricator.services.mozilla.com/D62970
--HG--
extra : moz-landing-system : lando
nsContentTreeOwner uses XULBrowserWindow (which is Desktop-only) to get the
current WebBrowserChrome instance.
This patch adds a lookup for the WebBrowserChrome actor to make sure that the
correct instance is queried on all platforms.
Differential Revision: https://phabricator.services.mozilla.com/D62817
--HG--
extra : moz-landing-system : lando
This patch adds a `onExtensionListUpdated` method to `DebuggerDelegate` which
is called whenever devtools install a new extension.
This method provides an opportunity for apps to refresh the list of installed
extensions and sets appropriate delegates so that the new extension is
correctly recognized.
Differential Revision: https://phabricator.services.mozilla.com/D62333
--HG--
extra : moz-landing-system : lando
***
Bug 1610402 - Use static prefs for view_source.{wrap_long_lines,syntax_highlight,tab_size} r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D63470
--HG--
extra : moz-landing-system : lando
This data was recorded for releases 52-57 when the remote decoding process
mechanism was developed. Enable it again to monitor the data and see if
stagefright still crashes in recent Android versions. If it's no longer the
case, we might deprecate out-of-process decoder and save some IPC overhead.
Differential Revision: https://phabricator.services.mozilla.com/D63257
--HG--
extra : moz-landing-system : lando
LTO was enabled on Android back when the normal Android builds were the
ones we shipped. But now we have separate builds for what is shipped,
*and* they do PGO+LTO.
Differential Revision: https://phabricator.services.mozilla.com/D62872
--HG--
extra : moz-landing-system : lando
This allows `performAction` to immediately return false if a boundary is
reached and allow TalkBack to navigate past the web view.
Change viewport cache listener to reorder since it should catch all tree
mutations in the document.
Differential Revision: https://phabricator.services.mozilla.com/D63117
--HG--
extra : moz-landing-system : lando
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.
Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.
Differential Revision: https://phabricator.services.mozilla.com/D60919
--HG--
extra : moz-landing-system : lando
At bug 1614208, the line style value mapping was changed, but
`GeckoEditable.IME_RANGE_LINE_*` are not updated.
This patch makes the style in `TextRangeStyle` an enum class for making it
type safer, and updates `GeckoEditable.IME_RANGE_LINE_*`, and finally, adds
`FYI` comments in `TextRangeStyle` to make developers realize it requires
manual update.
Differential Revision: https://phabricator.services.mozilla.com/D62883
--HG--
extra : moz-landing-system : lando
`inputConnection` works again even if x86_64 emulator with e10s.
But the following tests still have timing issue and are sometimes failure.
So this is still turned off.
- `inputConnection_bug1133802`
- `inputConnection_setSelection`
Differential Revision: https://phabricator.services.mozilla.com/D61291
--HG--
extra : moz-landing-system : lando
So that the test can receive the expected event triggered by the
setVerticalClipping.
Differential Revision: https://phabricator.services.mozilla.com/D62868
--HG--
extra : moz-landing-system : lando
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.
Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.
Differential Revision: https://phabricator.services.mozilla.com/D60919
--HG--
extra : moz-landing-system : lando
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.
Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.
Differential Revision: https://phabricator.services.mozilla.com/D60919
--HG--
extra : moz-landing-system : lando
Currently the sections regarding mma events and deeplinks are not properly
formatted making the text hard to read, follow and understand.
Use the `.. code-block:: json` formatting for Events. Found this in the history
for the previous documentation from central
Add a newline before the deep links bullet list so that each element would be
properly formatted.
Before and after screenshots of the docs are posted in the ticket.
Depends on D62730
Differential Revision: https://phabricator.services.mozilla.com/D62731
--HG--
extra : moz-landing-system : lando
Now that we don't rely on XPCOM accessibility anymore we shouldn't see
intermittents with accessibility on.
Differential Revision: https://phabricator.services.mozilla.com/D61773
--HG--
extra : moz-landing-system : lando
Wires up the addon manager update process to the GekcoView API. Adds
several basic tests for verifying the udpate steps. Adds a new way to
automatically bundle new test addons into xpi files and registers them
with the example.com server.
Differential Revision: https://phabricator.services.mozilla.com/D61501
--HG--
extra : moz-landing-system : lando
Chrome prunes the subtrees of links and headings (with single text leaf
children) and we mimic this in Gecko. The problem is that sometimes a
heading can be a child of a link, and it would be impossible to reach
when navigating by headings.
The main reason we mimiced chrome is because we would getthe name of the
node and its subtree uttered, so you would hear the name of the node
twice. By using contentDescription we can suppress the subtree from
TalkBack's utterance and preserve the node's children for heading
navigation.
Differential Revision: https://phabricator.services.mozilla.com/D61766
--HG--
extra : moz-landing-system : lando
The fundamental issue here is that `ParentCrashTest` starts a second
`GeckoRuntime` via `RemoteGeckoService` within the same logical Android
Application.
This patch adds `RuntimeCreator.shutdownRuntime()` so that the test can
shut down the existing `GeckoRuntime` before starting up its own.
Differential Revision: https://phabricator.services.mozilla.com/D61249
--HG--
extra : moz-landing-system : lando
These values are not available right away after `onInstallEnded`, but are available after `Management.on("ready")` for the addon. We prefer not complicating the
situation for GV embedders, and instead only resolving the `installExtension` once the addon is ready.
Differential Revision: https://phabricator.services.mozilla.com/D61281
--HG--
extra : moz-landing-system : lando