Граф коммитов

31013 Коммитов

Автор SHA1 Сообщение Дата
Olivia Hall 71323994b5 Bug 1682599 - Check if media URL is valid before returning it to onContextMenu. r=geckoview-reviewers,agi
Added a check to see if the media blob URL was valid and could be downloaded.
Added a few general unit tests for ContentDelegateChild.

Differential Revision: https://phabricator.services.mozilla.com/D129859
2021-11-05 17:20:36 +00:00
Dimi 1170d5bd99 Bug 1729640 - P3. Notify event when a form with password is submitted r=sfoster,tgiles,geckoview-reviewers,agi
Notify "passwordmgr-form-submission-detected" when a form with password
is submitted.
The event should be notified regardless of whether the password manager
decides to show the doorhanger or not. To support this, this patch
also refactors _maybeSendFormInteractionMessage function to distinguish
"onFormSubmit" event and "showDoorhanger" event.

Differential Revision: https://phabricator.services.mozilla.com/D127104
2021-11-05 17:11:31 +00:00
Agi Sferro 426b9a2fd8 Bug 1717506 - Re-enable autofillNavigation. r=owlish
There is a potential intermittent where we try to execute javascript in the
page before the page navigates away, causing a hang. To ensure that that is not
possible we also wait for a PageStop event.

Differential Revision: https://phabricator.services.mozilla.com/D130377
2021-11-05 15:58:54 +00:00
Agi Sferro 175a5c05ff Bug 1717506 - Handle out-of-order page{hide,show}. r=owlish
With Fission BFCache, when navigating back the two pages might run in different
processes, even though they belong to the same domain.

This means that `pagehide` and `pageshow` might come out of order. For example,
navigating from `a.html` to `b.html` and back, we might get

```
pageshow b.html
pageshow a.html
pagehide b.html
```

notice we get the `pageshow` event for `a.html` _before_ the `pagehide` event
for `b.html`.

Internally in our test framework, we use `pagehide` and `pageshow` to establish
a connection between a page and the Java layer through a WebExtension port.

Before this patch, we assumed tha all `pageshow` events will match a `pagehide`
event in order, and thus disconnect the port early for `a.html` when getting
the event for `b.html` in the above example.

There is also a separate problem where if a port was established for a given
web page and then a navigation was issued, we would hang waiting for a response
from the page that navigated away (and thus, we would not be able to send
messages anymore).

To fix both of these issues, we keep track of all pending messages and discard
them properly when a Port is disconnected, and make sure that the port that's
disconnecting matches the one that's currently associated with the session (to
ensure that we are not disconnecting because of a out-of-order port event).

Differential Revision: https://phabricator.services.mozilla.com/D130376
2021-11-05 15:58:54 +00:00
Csoregi Natalia d2f8488b6a Backed out 7 changesets (bug 1729640) for causing permafailures on browser_web_process_isolation.js. a=backout
Backed out changeset 5b2a1799ce4e (bug 1729640)
Backed out changeset fcd4b833ad73 (bug 1729640)
Backed out changeset 5ff8d3adc6eb (bug 1729640)
Backed out changeset b8fd0343ca42 (bug 1729640)
Backed out changeset fbd6928e34ef (bug 1729640)
Backed out changeset 4ce2eebab0c4 (bug 1729640)
Backed out changeset c7c50c85f911 (bug 1729640)
2021-11-04 23:44:26 +02:00
Dimi c6f5d58bfb Bug 1729640 - P3. Notify event when a form with password is submitted r=sfoster,tgiles,geckoview-reviewers,agi
Notify "passwordmgr-form-submission-detected" when a form with password
is submitted.
The event should be notified regardless of whether the password manager
decides to show the doorhanger or not. To support this, this patch
also refactors _maybeSendFormInteractionMessage function to distinguish
"onFormSubmit" event and "showDoorhanger" event.

Differential Revision: https://phabricator.services.mozilla.com/D127104
2021-11-04 11:17:03 +00:00
owlishDeveloper dd9d805fa5 Bug 1699845 - Remove cleanup code for app_tmpdir r=geckoview-reviewers,agi,calu
Differential Revision: https://phabricator.services.mozilla.com/D130123
2021-11-02 19:37:33 +00:00
Agi Sferro d4e0174d2c Bug 1529082 - Use bundletool to install apps as aab packages. r=ahal,owlish
This patch adds a new command line argument --aab which allows users to install
GVE as an AAB.

This will also be used in a future patch to install the test runner as AAB.

Differential Revision: https://phabricator.services.mozilla.com/D127323
2021-11-02 18:56:28 +00:00
Agi Sferro dccddb81bc Bug 1529082 - Move TestRunnerActivity to test_runner. r=ahal,owlish
The fact that the test runner app is defined inside the geckoview test package
has always felt like a hack to me. I've mistakenly thought that
TestRunnerActivity was used in GeckoView's junit tests many times (even though
that's not the case).

From what I can see, there's no way to generate an AAB package for androidTest,
so to be able to run Gecko tests as AAB we finally need to define the
TestRunner as an ordinary package instead.

Differential Revision: https://phabricator.services.mozilla.com/D127320
2021-11-02 18:56:26 +00:00
Agi Sferro 088243109c Bug 1529082 - Locate lib folder within the APK. r=owlish
Before this patch, we would load mozglue using the unqualified
`System.loadLibrary("mozglue")` and then we would try to load all the other
native libraries from the path returned from `nativeLibraryDir`.

Note that since the path is unqualified, we might end up loading a library
that's not inside the APK, potentially a malicious one.

Android App Bundles (or AAB) is a new feature of Android where apps can be
split in multiple APKs (called "splits"). Each APK split contains a functinal
part of the app, e.g. a specific resolution asset folder, all the native
libraries for one CPU architecture etc.

For AAB, `nativeLibraryDir` returns an empty folder as the libraries are
stored, uncompressed, inside one of the APK splits, so GeckoView fails to load
libxul and other libraries when starting up.

The current code also doesn't work for any case where `System.loadLibrary`
fails to load mozglue (we do have code that accounts for that, but I'm not sure
how much of it is funcitonal).

To fix that, we locate the mozglue using code ported from Chromium and use that
to locate all the other native libraries.

Note this still doesn't fix the problem of loading an unqualified mozglue
library, but there's not a lot we can do about that right now (and that's not a
new problem, so we can address it in a separate patch).

Differential Revision: https://phabricator.services.mozilla.com/D122909
2021-11-02 18:56:25 +00:00
Agi Sferro 4d6d26edcd Bug 1736433 - Close File Descriptors when disconnecting from a busy service. r=calu,owlish
Failing to close the File Descriptors causes a shutdown hang, as the main
process is not able to detect when the child process dies because we're leaking
the File Descriptors.

Differential Revision: https://phabricator.services.mozilla.com/D128938
2021-11-02 18:17:41 +00:00
Agi Sferro 6825be4e35 Bug 1736433 - Keep log of launch failures in GeckoProcessManager. r=owlish
This patch refactors `GeckoProcessManager`. Before this patch, we would pass
all arguments needed to start a process in every method call, together with the
previous error (if present).

This patch groups the arguments in a class `StartInfo` and keeps the failure
information separately in a list of exceptions that can be used to generate a
log in case of failure.

This patch also fixes two problems:

- We were calling `detachFd` right after connecting to a process, which is
  incorrect when the binding fails, as we still need a reference to the File
  Descriptor to retry the connection. After the patch, we will call detach only
  at the end when we either have established a connection or we have given up.

- We were taking ownership of the File Descriptors from Gecko. This is
  incorrect because Gecko owns them already and calling `close` accidentally
  will crash the app. We now `dup` them instead, using
  `ParcelFileDescriptor.from`.  This also means that the call to `detachFd` is
  now a call to `close`.

Differential Revision: https://phabricator.services.mozilla.com/D128935
2021-11-02 18:17:40 +00:00
Agi Sferro a1ec46fb8c Bug 1736433 - Don't use unneeded Integer.valueOf. r=calu,owlish
The argument is already an `int` so we don't need to call `valueOf`.

Differential Revision: https://phabricator.services.mozilla.com/D128934
2021-11-02 18:17:39 +00:00
Agi Sferro 09be856797 Bug 1736433 - Add InitInfo::builder. r=owlish
This patch adds a builder for InitInfo and allows us to define its members as
final.

This is especially useful for File Descriptors which are all of the same type,
and could be easily swapped in method calls.

Differential Revision: https://phabricator.services.mozilla.com/D128933
2021-11-02 18:17:39 +00:00
Agi Sferro 1b309951d6 Bug 1736433 - Add GeckoResult::finally_. r=owlish,calu
This method is called regardless of whether the GeckoResult completes
successfully or not.

Differential Revision: https://phabricator.services.mozilla.com/D128932
2021-11-02 18:17:38 +00:00
Agi Sferro 69c7fc95b8 Bug 1733423 - Implement getAllLoginsAsync. r=calu,owlish
This patch adds a new API onLoginFetch() which will be called when Gecko needs
access to all logins saved on the device (as opposed to just logins for a
domain).

Differential Revision: https://phabricator.services.mozilla.com/D129862
2021-11-02 15:59:54 +00:00
Norisz Fay 47a4e47af2 Backed out 7 changesets (bug 1729640) for causing Bp-hybrid bustages on LoginDetectionService.o CLOSED TREE
Backed out changeset 4d3532da5652 (bug 1729640)
Backed out changeset 9ec5346cf9d9 (bug 1729640)
Backed out changeset 43dd05680186 (bug 1729640)
Backed out changeset f44a8f37d84c (bug 1729640)
Backed out changeset 66376bee8cef (bug 1729640)
Backed out changeset c7ffe85380d7 (bug 1729640)
Backed out changeset ae9c5de3902a (bug 1729640)
2021-11-02 16:33:01 +02:00
Dimi c31102442d Bug 1729640 - P3. Notify event when a form with password is submitted r=sfoster,tgiles,geckoview-reviewers,agi
Notify "passwordmgr-form-submission-detected" when a form with password
is submitted.
The event should be notified regardless of whether the password manager
decides to show the doorhanger or not. To support this, this patch
also refactors _maybeSendFormInteractionMessage function to distinguish
"onFormSubmit" event and "showDoorhanger" event.

Differential Revision: https://phabricator.services.mozilla.com/D127104
2021-11-02 13:47:48 +00:00
Makoto Kato 1be11f4ee1 Bug 1556983 - Primary pointer capability should be coarse when having touch screen. r=geckoview-reviewers,agi
Many users report that GeckoView returns non-coarse value for primary pointer
capabilities. Actually, we assume that primary pointer device is 1st device by
`InputDevice.getDeviceIds`, but some mobile devices seems not to return touch
screen as 1st item according to user reports.

Also, Android's `InputDevice` API doesn't define what is primary pointer
device, so we cannot assume primary pointer device well.

Other implements are,

- Chrome returns coarse if something input device has coarse capability.
- Firefox for Windows seems to return coarse if it is tablet mode.

So we should return coarse as primary pointer capability when having touch
screen, like Chrome.

But there is still another issue.

When I check some devices (including Android VM on Chrome OS), even if no touch
screen, the `InputDevice`'s source may has `SOURCE_TOUCHSCREEN`. Chrome checks
that fine pointer at first, then it checks coarse pointer. But current GV is
coarse pointer at first. Since the `InputDevice`'s source may have both
`SOURCE_MOUSE` and `SOURCE_TOUCHSCREEN` on touchpad/mouse, GV returns different
result. So we shouldn't check `SOURCE_TOUCHSCREEN` at first.

Differential Revision: https://phabricator.services.mozilla.com/D129901
2021-11-02 02:04:06 +00:00
Sebastian Hengst d21e359bd2 Merge autoland to mozilla-central. a=merge 2021-11-01 22:58:34 +01:00
Agi Sferro 3b13343187 Bug 1738687 - Suggest running ./mach try auto in GV docs. r=calu
Differential Revision: https://phabricator.services.mozilla.com/D130094
2021-11-01 15:54:11 +00:00
Riya ac2ad7e7f2 Bug 1737032 - Removed traces of "remote XUL". r=Gijs,fluent-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D129255
2021-10-25 11:00:47 +00:00
Jan-Erik Rediger ba5c77a572 Bug 1708669 - Register FOG custom pings on Android builds to enable Glean functionality. r=chutten,geckoview-reviewers,agi
This instantiates the FOG service, which in turn registers an idle
observer, which is required for FOG IPC to be triggered occasionally.

Glean itself will be controlled by the surrounding Android application.
Glean symbols are shipped in this GeckoView build.
Any metrics recorded in Gecko will be passed through to the Android
application, e.g. Fenix.

This also re-exports `rlb_flush_dispatcher` to be called by Glean Core from the Kotlin side.

Currently this does not support sending custom pings inside Gecko.
Testing Glean metrics in an Android build will be enabled in subsequent commits.

Differential Revision: https://phabricator.services.mozilla.com/D126799
2021-10-22 08:53:28 +00:00
Gabriel Luong c7a4bab1b6 Bug 1732219 - Add API for fetching the preview image. r=geckoview-reviewers,agi,mconley
Differential Revision: https://phabricator.services.mozilla.com/D128815
2021-10-22 06:04:04 +00:00
Narcis Beleuzu d9da4a1ac6 Backed out changeset bd57366e61d8 (bug 1732219) for bc failures on browser_bad_meta_tags.js. CLOSED TREE 2021-10-22 00:46:39 +03:00
Gabriel Luong 4f70f62317 Bug 1732219 - Add API for fetching the preview image. r=geckoview-reviewers,agi,mconley
Differential Revision: https://phabricator.services.mozilla.com/D128815
2021-10-21 18:48:49 +00:00
owlishDeveloper d308ffcc3a Bug 1733737 - Make sure autocomplete search is initialized with a value r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D128278
2021-10-21 18:35:38 +00:00
Andi-Bogdan Postelnicu 0d12e234b2 Bug 1731582 - Move to clang-13 r=firefox-build-system-reviewers,mhentges,decoder
Join work with glandium.

Differential Revision: https://phabricator.services.mozilla.com/D126208
2021-10-20 12:03:20 +00:00
Butkovits Atila c56f15eca0 Backed out changeset 7de44eaecb13 (bug 1731582) as requested by Andi. CLOSED TREE 2021-10-19 20:52:08 +03:00
Andi-Bogdan Postelnicu 151c81623a Bug 1731582 - Move to clang-13 r=firefox-build-system-reviewers,mhentges,decoder
Join work with glandium.

Differential Revision: https://phabricator.services.mozilla.com/D126208
2021-10-19 14:45:59 +00:00
Timothy Nikkel 35a0a509c6 Bug 1734571. Remove old unused layers tiling left over code bits. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D127787
2021-10-19 10:12:25 +00:00
Marian-Vasile Laza 3883f0ad91 Backed out changeset f3cf8baf4f0a (bug 1731582) for causing build bustages. CLOSED TREE 2021-10-19 12:36:47 +03:00
Andi-Bogdan Postelnicu da72439c02 Bug 1731582 - Move to clang-13 r=firefox-build-system-reviewers,mhentges
Join work with glandium.

Differential Revision: https://phabricator.services.mozilla.com/D126208
2021-10-19 08:00:30 +00:00
Evgenia Kotovich 0d0980ee0d Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-18 09:26:33 +00:00
Noemi Erli 2bba3cec69 Backed out changeset 2ab6bb03dcc1 (bug 1576768) for causing failures in test_double_submit.html CLOSED TREE 2021-10-18 02:05:57 +03:00
Evgenia Kotovich 3e3dff109c Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-17 14:59:14 +00:00
Alexandru Michis dac6815201 Backed out changeset 7c08aa027893 (bug 1576768) for causing multiple failures.
CLOSED TREE
2021-10-15 16:52:43 +03:00
Evgenia Kotovich a8b32926fa Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-15 12:58:11 +00:00
Mike Hommey 7debb35262 Bug 1572618 - Statically link the rlbox library to libxul. r=firefox-build-system-reviewers,nika,andi
We still rely on dynamic loading to find the symbols, but since we get
them from libxul, we don't need to load the library before activating
the process sandbox anymore.

Differential Revision: https://phabricator.services.mozilla.com/D128333
2021-10-15 01:17:58 +00:00
Hiroyuki Ikezoe c61c568d4a Bug 1696785 - Use (400x400) display size in SelectionActionDelegateTest to avoid unexpected multiple updateposition events during the test. r=geckoview-reviewers,agi
SelectionActionDelegateTest does just respond a single event in each test cases,
so if there are multiple events we need to respond, the test stops working since
the response will be discarded in SelectionActionDelegateChild.jsm [1].

We use a lager display size here to avoid the situation, in bug 1735655 the situation
will be eliminated.

[1] https://searchfox.org/mozilla-central/rev/0998b61022a1ece43afe3c750077e5804c6c6392/mobile/android/actors/SelectionActionDelegateChild.jsm#260-264

Differential Revision: https://phabricator.services.mozilla.com/D128418
2021-10-14 02:54:58 +00:00
Michael Comella 94cf414dcd Bug 1734935 - add marker for GeckoSession.onLoadRequest. r=agi
Here is a profile demonstrating the change (debug build) when the request is
resolved UI thread -> Gecko thread -> UI thread:
https://share.firefox.dev/3Aru9NW

Here is a profile when the request is resolved synchronously on the UI thread:
https://share.firefox.dev/3BzGTDs

Differential Revision: https://phabricator.services.mozilla.com/D127989
2021-10-12 21:21:42 +00:00
Agi Sferro e8e0f7e153 Bug 1571899 - Format Java codebase with google-java-formatter. r=owlish
This commit was generated by running |./mach lint -l android-formatter --fix|.

Differential Revision: https://phabricator.services.mozilla.com/D127733
2021-10-11 18:11:56 +00:00
Agi Sferro 2bd64785fc Bug 1571899 - Use google-java-format via spotless to enforce Java formatting. r=ahal,owlish
This change adds a new lint `android-format` which enforces formatting of Java
code using google-java-format.

To run the lint simply run:

./mach lint -l android-format

This command also support automatically fixing all errors running by adding
--fix:

./mach lint -l android-format --fix

This change also removes all the formatting-related checkstyle checks which are
now implicitly enforced by the formatter.

Differential Revision: https://phabricator.services.mozilla.com/D127734
2021-10-11 18:11:55 +00:00
Jamie Nicol 54efd0cd5a Bug 1733732 - Disable display port multiplier on Android. r=tnikkel
On Android we currently apply a 4x multiplier to the size of the
display port. When using the old Layers rendering backend, we would
render the non-multiplied "critical display port" at normal
resolution, and if required we would render the inflated display port
in low resolution. This helped avoid checkerboarding.

With webrender we only render what is currently visible on the
screen, so having an inflated display port is probably less
useful. There are still circumstances when it could help avoid
checkerboarding, for example when the main thread is busy it allows
for more scrolling without a new scene being built. But this benefit
is likely outweighed by the increased display list and scene building
time caused by the larger display port.

As a first step this patch simply sets the layers.low-precision-buffer
pref to false, which will prevent us from increasing the display port
size. This will make the change easy to revert in case it does cause
any issues. If this has the desired effect then we can remove the
relevant code in a follow up patch.

Differential Revision: https://phabricator.services.mozilla.com/D128062
2021-10-11 17:52:14 +00:00
Makoto Kato 9408d87ba5 Bug 1734552 - Don't walk though the accessibility nodes on autofill. r=geckoview-reviewers,agi
When Autofill service runs with compatibility mode [*1] (such as Bitwarden),
`View.onProvideAutofillStructure` walks through the accessibility nodes.
Walking through it spends a lot of times.

When checking Android's source code, the following walks through it.

- `onProvideAutofillVirtualStructure`
- `autofill`
- `isVisibleToUserForAutofill`

Actually, since we already add autofill's virtual nodes, it is unnecessary to
walk through it.

*1 https://developer.android.com/reference/android/service/autofill/AutofillService#compatibility-mode

Differential Revision: https://phabricator.services.mozilla.com/D127952
2021-10-11 13:16:45 +00:00
Tomislav Jovanovic 1b801a123d Bug 1708243 - Part 4: Remove tab-content.js and onExtensionBrowser.js, stop touching .content eagerly r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D127750
2021-10-09 22:45:28 +00:00
Michael Comella 97fefdd3af Bug 1734941 - add marker for EventDispatcher handleMessage. r=agi
Here's a sample profile when loading a page while using this marker (debug
build): https://share.firefox.dev/3Fni5kq

Differential Revision: https://phabricator.services.mozilla.com/D127990
2021-10-08 21:39:36 +00:00
Cathy Lu dcdbccb976 Bug 1708815 - Rename enterpiseRootsEnabled r=geckoview-reviewers,agi,owlish
Differential Revision: https://phabricator.services.mozilla.com/D127729
2021-10-07 19:16:41 +00:00
owlishDeveloper 7a6decb12a Bug 1734028 - Update GeckoView Contributor Guide r=geckoview-reviewers,agi,calu
Differential Revision: https://phabricator.services.mozilla.com/D127493
2021-10-06 16:12:02 +00:00
Agi Sferro 4fa08131c7 Bug 1714945 - Add StorageController::setPrivateBrowsingPermanentPermission. r=owlish
Normally, a private browsing session doesn't store any data permamently. This
extends to permissions, which are cleared at the end of the browsing session
(i.e. when the GeckoRuntime is closed or killed).

There are cases, however, where we want to keep the data around. For example
Focus needs to store tracking protection permissions permanently.

For this reason, this patch introduces a new API that allows embedders to set
permanent permissions for private browsing GeckoSession.

This patch also always sends a tracking protection permission for every page
load, this allows embedders to set the tracking protection permission without
using the deprecated API `setPermission`, this was an oversight during the
implementation of the new StorageController API.

Differential Revision: https://phabricator.services.mozilla.com/D126546
2021-10-05 22:09:59 +00:00