To sync Gecko's text with Java text correctly, I would like to add more text
and selection check each `InputConnection.setComposingText` call.
Differential Revision: https://phabricator.services.mozilla.com/D83464
Added private/protected, unimplemented versions of the necessary Java
classes for the menus API, set up event dispatching and listening.
Differential Revision: https://phabricator.services.mozilla.com/D82383
When using the `tabs.query` API in a popup (e.g. a browserAction popup)
extensions expects to refer to the window where the popup is.
On mobile we don't really have a concept of window in the way that extensions
expect us to have, we also treat all tabs as belonging to separate tabs.
To make the behavior of the extension API more consistent with desktop, we
pretend that the popup belongs to whatever the top tab is at the time.
Differential Revision: https://phabricator.services.mozilla.com/D82769
We use this object on the Java side to open the popup and without this change
we don't look at the default popup URL when the tab-specific one is not
defined.
Differential Revision: https://phabricator.services.mozilla.com/D82767
mozStorage used to read prefs on service init, because they could only be read
on the main-thread. When service init was moved earlier, it started trying
to read prefs too early, before the profile was set up, thus it ended up always
reading the default value.
This patch moves the only relevant pref to mirrored StaticPrefs that can be accessed
from different threads, and removes two preferences that apparently are not necessary
(they have been broken from a long time) for now.
In particular, providing a global synchronous setting is a footgun, each consumer should
decide about their synchronous needs, rather than abusing a dangerous "go fast" setting.
The page size is something we don't change from quite some time, and it's unlikely to be
used to run experiments in the wild before doing local measurements first, for which Try
builds are enough.
The remaining exclusiveLock pref is a bit controversial, because in general exclusive lock
is better for various reasons, and mostly it is necessary to use WAL on network shares.
Though developers may find it useful for debugging, and some third parties are doing
dangerous things (like copying over databases) to work around it, for which it's safer to
provide a less dangerous alternative.
Note exclusive lock only works on Unix-derived systems for now (no Windows implementation).
Finally, this introduces a fallback to exclusive lock, so that if a third party is using our
databases, so that we can't get an exclusive lock, we'll fallback to normal locking.
Differential Revision: https://phabricator.services.mozilla.com/D82717
The problem here is that sometimes the test clicks on the two links too quickly
and only the second click goes through the onBeforeUnload path and the first
one is ignored.
Differential Revision: https://phabricator.services.mozilla.com/D82442
The problem here is that sometimes the test clicks on the two links too quickly
and only the second click goes through the onBeforeUnload path and the first
one is ignored.
Differential Revision: https://phabricator.services.mozilla.com/D82442
If client script wants to commit composition string per input, it sometimes
use the following script.
```
let input = document.getElementById('input');
input.addEventListener('input', () => {
input.blur();
input.focus();
});
```
Since `blur` will commit composition string, this script can commit text. But
since Gecko has an optimization for this situation, focus won't be lost
completely.
Although GeckoView synchronizes Java text and selection with Gecko text when
getting focus, this sample may be failed due to timing issue. `blur` tries to
commit string, but result is never returned since focus is lost as temporary
(although text is finally committed in Gecko.). Then, GeckoView are waiting
for result that is never returned forever, So this synchronization is failed.
When getting focus again, we should synchronize it at force.
Differential Revision: https://phabricator.services.mozilla.com/D80147
I intend to uplift this patch to v79, so the changelog references 79 and the
version for removal is indicated as v82.
Differential Revision: https://phabricator.services.mozilla.com/D82033
Note: These comments reference GeckoView 82 instead of GeckoView 83 because I
plan to uplift this to GeckoView 79. Ditto for the changelog entry.
Tests that use the parcelable functionality are flagged to ignore deprecation
warnings.
Differential Revision: https://phabricator.services.mozilla.com/D81768
Note: These comments reference GeckoView 82 instead of GeckoView 83 because I
plan to uplift this to GeckoView 79. Ditto for the changelog entry.
Tests that use the parcelable functionality are flagged to ignore deprecation
warnings.
Differential Revision: https://phabricator.services.mozilla.com/D81768
The profiler can be "paused", which stops sampling, and since bug 1578329 stops markers as well.
Some test suites use pausing between tests (to better differentiate the tests, to keep the profiler ready to run, and to lower the amount of recorded data). But this causes problems with some tracing markers, as their matching ends have not been recorded (e.g., an end marker is missing), which show up as very loooong markers.
To solve this, we need to be able to pause sampling only, but keep recording markers.
But we still need to be able to pause the whole profiler, in particular before capturing, to avoid recording anything around that time.
This big patch is mostly mechanical changes: Wherever there are "Pause" and "Unpause/Resume" profiler functions, we add matching "PauseSampling" and "UnpauseSampling/ResumeSampling" functions that only impact the periodic sampling loop; And existing "Pause/Unpause/Resume" imply pausing sampling as well.
Exceptions and extra work:
- nsIProfiler (the JS API) already had `Pause/ResumeSampling()`, which misleadingly paused everything! Now they do the right thing, and we have `Pause/Resume()` as well.
- All tests using `Pause/ResumeSampling()` now use `Pause/Resume()`, except for Talos tests that only pause sampling between tests; Added some extra `Pause()` calls to pause everything before capturing profiles.
- GeckoJavaSampler doesn't handle pausing/resuming everything, this should be done in a follow-up bug.
- Sampling-only pauses are not streamed into JSON. If needed, we should follow-up, with potential work on the front-end to deal with these.
Differential Revision: https://phabricator.services.mozilla.com/D81492
Because jar_maker is not in the libs tier, we also rename the libs-%
targets for l10n repacks to l10n-%, which make it clearer what they are
for.
And because multilocale.txt is both a GeneratedFile and a file that is
generated (and installed) via manual build rules, keeping it in the misc
target actually breaks building in toolkit/locales during l10n repacks,
so move it to libs for now.
Differential Revision: https://phabricator.services.mozilla.com/D81766
The only fallout from part 1 is a single test where we run `evaluateJS` on a session, serialize it to a `Parcel`,
deserialize it to new, distinct `GeckoSession` object, and then perform additional `evaluateJS` on the latter.
Since the deserialization of the `Parcel` transferred the session's contents from the original session to the new
session, we also need to transfer the `WebExtension.Port` used by `evaluateJS` to the new session.
Note that this fix is kind of hacky, but because we are going to deprecate the parcelability of `GeckoSession`, I
do not believe that it is worth the effort to implement a "perfect" fix; that would likely involve adding new APIs
to support another API that we are going to deprecate anyway.
Depends on D81746
Differential Revision: https://phabricator.services.mozilla.com/D81748
Because `GeckoSession`'s overrides of `hashCode` and `equals` look solely at session ID, this may cause
strange behaviors if a `GeckoSession` is reloaded with session state from a previous instance, and the
previous instance still exists. For example, suppose the previous instance is closed and the new instance is
open. As far as the Android runtime is concerned, both objects are equivalent. Trying to insert both objects
into the same container will not work as expected.
In this patch, we revert those overrides. To ensure that we still have a short-circuit path in
`GeckoView.restoreSession`, we add and utilize a new, `package`-scoped, `equalsId` method.
Differential Revision: https://phabricator.services.mozilla.com/D81746
The only fallout from part 1 is a single test where we run `evaluateJS` on a session, serialize it to a `Parcel`,
deserialize it to new, distinct `GeckoSession` object, and then perform additional `evaluateJS` on the latter.
Since the deserialization of the `Parcel` transferred the session's contents from the original session to the new
session, we also need to transfer the `WebExtension.Port` used by `evaluateJS` to the new session.
Note that this fix is kind of hacky, but because we are going to deprecate the parcelability of `GeckoSession`, I
do not believe that it is worth the effort to implement a "perfect" fix; that would likely involve adding new APIs
to support another API that we are going to deprecate anyway.
Depends on D81746
Differential Revision: https://phabricator.services.mozilla.com/D81748
Because `GeckoSession`'s overrides of `hashCode` and `equals` look solely at session ID, this may cause
strange behaviors if a `GeckoSession` is reloaded with session state from a previous instance, and the
previous instance still exists. For example, suppose the previous instance is closed and the new instance is
open. As far as the Android runtime is concerned, both objects are equivalent. Trying to insert both objects
into the same container will not work as expected.
In this patch, we revert those overrides. To ensure that we still have a short-circuit path in
`GeckoView.restoreSession`, we add and utilize a new, `package`-scoped, `equalsId` method.
Differential Revision: https://phabricator.services.mozilla.com/D81746
We don't use it and causes confusion when `mach install` fails because the
signature of `geckoview_example.test` doesn't match.
Differential Revision: https://phabricator.services.mozilla.com/D81606