Commit Graph

29829 Commits

Author SHA1 Message Date
Aaron Klotz
badc3f721e Bug 1448428 - Part 1d: Change naming scheme for generated source files; r=snorp,nalexander,geckoview-reviewers
We update the name generation code to dump the files into:
```
OBJDIR/widget/android/GeneratedJNI
```

which are then exported to `mozilla/java`

Differential Revision: https://phabricator.services.mozilla.com/D74720
2020-05-13 17:53:17 +00:00
Nick Alexander
468e8ee4f6 Bug 1448428 - Part 1c: Allow incremental transition away from "unified" GeneratedJNI{Natives,Wrappers}.h header. r=snorp,geckoview-reviewers
This establishes a "high-water" mark that will make new files not be
"unified", and will allow to burn down the list of files require
unification.

Depends on D58573

Differential Revision: https://phabricator.services.mozilla.com/D58574
2020-05-13 18:11:06 +00:00
Nick Alexander
73af4ee38b Bug 1448428 - Part 1b: Maintain "unified" GeneratedJNI{Natives,Wrappers}.h header. r=snorp,geckoview-reviewers
It's not trivial to split the existing "unified" include declaration
into granular include declarations, so we continue generating a
unified header that can be incrementally abandoned until it can be
jettisoned.

Depends on D58572

Differential Revision: https://phabricator.services.mozilla.com/D58573
2020-05-13 17:46:54 +00:00
Nick Alexander
fe6281cdc0 Bug 1448428 - Part 1a: Split generated JNI wrappers into multiple files. r=snorp,geckoview-reviewers
This handles the build system bits.

The subsequent patch will restore the "unified"
GeneratedJNI{Natives,Wrappers}.h header files, and will be folded into
this one before landing.

What will still remain is to update the consumers of the .h files (all
the current #include lines) to use the fine-grained imports.  At that
time the "unified" header files can be removed entirely.

Differential Revision: https://phabricator.services.mozilla.com/D58572
2020-05-13 17:46:46 +00:00
John Lin
a76ca42590 Bug 1635446 - cancel async callback for released codec. r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D74991
2020-05-13 15:25:19 +00:00
Agi Sferro
4acba26b6f Bug 1637324 - Clarify native app ids for GeckoView. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D74896
2020-05-13 15:14:29 +00:00
Agi Sferro
29cdfeaa15 Bug 1637324 - Update docs to use installBuiltIn r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D74894
2020-05-13 15:14:17 +00:00
Agi Sferro
10d7d02ef2 Bug 1637324 - Update examples to use installBuiltIn. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D74893
2020-05-13 15:14:37 +00:00
Razvan Maries
2fe860484b Backed out 5 changesets (bug 1448428) for build bustages at SocketProcessParent.cpp. CLOSED TREE
Backed out changeset 192294c1413a (bug 1448428)
Backed out changeset da732f0c37d5 (bug 1448428)
Backed out changeset c48617a975e9 (bug 1448428)
Backed out changeset 92ca5adb7eb3 (bug 1448428)
Backed out changeset 3a3c734343f3 (bug 1448428)
2020-05-13 02:20:24 +03:00
Nick Alexander
212dc32562 Bug 1448428 - Part 2: Transition "HardwareCodecCapabilityUtils" away from "unified" GeneratedJNI{Natives,Wrappers}.h header. r=snorp,geckoview-reviewers
Depends on D58574

Differential Revision: https://phabricator.services.mozilla.com/D58575
2020-05-12 23:04:59 +00:00
Aaron Klotz
2b93310c1b Bug 1448428 - Part 1d: Change naming scheme for generated source files; r=snorp,nalexander,geckoview-reviewers
We update the name generation code to dump the files into:
```
OBJDIR/widget/android/jni/GeneratedJNI{Natives, Wrappers}
```

which are then exported to `mozilla/jni/natives` and `mozilla/jni/wrappers`

Differential Revision: https://phabricator.services.mozilla.com/D74720
2020-05-12 23:04:59 +00:00
Nick Alexander
1332cb4147 Bug 1448428 - Part 1c: Allow incremental transition away from "unified" GeneratedJNI{Natives,Wrappers}.h header. r=snorp,geckoview-reviewers
This establishes a "high-water" mark that will make new files not be
"unified", and will allow to burn down the list of files require
unification.

Depends on D58573

Differential Revision: https://phabricator.services.mozilla.com/D58574
2020-05-12 23:04:59 +00:00
Nick Alexander
ee100fb1bf Bug 1448428 - Part 1b: Maintain "unified" GeneratedJNI{Natives,Wrappers}.h header. r=snorp,geckoview-reviewers
It's not trivial to split the existing "unified" include declaration
into granular include declarations, so we continue generating a
unified header that can be incrementally abandoned until it can be
jettisoned.

Depends on D58572

Differential Revision: https://phabricator.services.mozilla.com/D58573
2020-05-12 23:02:07 +00:00
Nick Alexander
09bb5a923b Bug 1448428 - Part 1a: Split generated JNI wrappers into multiple files. r=snorp,geckoview-reviewers
This handles the build system bits.

The subsequent patch will restore the "unified"
GeneratedJNI{Natives,Wrappers}.h header files, and will be folded into
this one before landing.

What will still remain is to update the consumers of the .h files (all
the current #include lines) to use the fine-grained imports.  At that
time the "unified" header files can be removed entirely.

Differential Revision: https://phabricator.services.mozilla.com/D58572
2020-05-12 23:01:49 +00:00
Mike Conley
e08905a04a Bug 1634703 - Return nsIMediaDevice active devices list from mediaCaptureWindowState. r=jib,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D73479
2020-05-12 14:49:46 +00:00
Aaron Klotz
796d8c15ae Bug 1630229: Part 4 - Register ChildConnection after bind instead of start; r=geckoview-reviewers,snorp
1. `GeckoProcessManager.ConnectionManager.onStartComplete` is called later than
   it ideally should be; it would be better to do this as soon as binding is
   complete, rather than as soon as `start` is complete. To accomplish this:

* We rename `onStartComplete` to `onBindComplete` and call it as soon as we
  have successfully bound.
* We call `IChildProcess.getPid` as soon as we're bound and immediately clean
  up if that fails.
* This implies that `getPid` should always have a pid and should not need to
  call into `IChildProcess` during the remaining lifetime of the connection.
  This allows us to eliminate exception throwing from `getPid`, and thus we may
  also remove `getPidFallible`.
* This also means that we no longer need to explicitly call `getPid` in
  `GeckoProcessManager.preload`.

2. We also use `XPCOMEventTarget.runOnLauncherThread` so that we do not need to
   bounce through the launcher thread's event queue unnecessarily.

3. I noticed that we do not unbind the connection if the start fails but we
   are not retrying. We should be unbinding regardless of whether we are going
   to retry.

Differential Revision: https://phabricator.services.mozilla.com/D74500
2020-05-12 18:59:20 +00:00
Makoto Kato
ec78483903 Bug 1632594 - Use Long.valueOf instead of Integer.valueOf on GeckoSession#onExternalResponse. r=geckoview-reviewers,agi
When content length is over 2GB, `WebResponseInfo.contentLength` is negative
value. Use Long.valueOf instead of Integer.valueOf to pass this value.

Differential Revision: https://phabricator.services.mozilla.com/D74586
2020-05-11 16:21:01 +00:00
Agi Sferro
3655bb2674 Bug 1636581 - Enable tabs_goBack_goForward disabled by mistake. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D74472
2020-05-11 21:47:31 +00:00
Bogdan Tara
8c5c4f1dd7 Backed out 7 changesets (bug 1634703) for testDeviceRecordingEventAudioAndVideo failures CLOSED TREE
Backed out changeset b982f5d74610 (bug 1634703)
Backed out changeset 59229853930e (bug 1634703)
Backed out changeset e017380f5539 (bug 1634703)
Backed out changeset 47a3a96b969b (bug 1634703)
Backed out changeset b4af76cfbdaf (bug 1634703)
Backed out changeset 7ef57434b09d (bug 1634703)
Backed out changeset 9df87d346b0f (bug 1634703)
2020-05-11 23:04:54 +03:00
owlishDeveloper
72cf60fade Bug 1635862 - Add object URI support to WebExecutor r=geckoview-reviewers,snorp
Differential Revision: https://phabricator.services.mozilla.com/D74465
2020-05-11 17:51:05 +00:00
Mike Conley
f77df842d7 Bug 1634703 - Return nsIMediaDevice active devices list from mediaCaptureWindowState. r=jib,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D73479
2020-05-11 17:34:10 +00:00
Nikita Kozhemiakin
2158dd66ed Bug 1523544 - Change exoplayer2 package name. r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D74068
2020-05-11 07:24:57 +00:00
Agi Sferro
6b2ccb034a Bug 1634493 - Re-read the policy object when exporting extensions. r=snorp
WebExtensionPolicy.getByID(id) will return a stub when called earlier during
startup. Once the startup process is complete, this object is sawpped with the
real extension policy.

Before this patch, we used to hold onto the stub object, which makes it so that
we read incorrect values even though we are waiting for the policy to be ready.

To fix this we just read the result value of the readyPromise promise.

Differential Revision: https://phabricator.services.mozilla.com/D74459
2020-05-08 19:59:49 +00:00
Dylan Roeh
cfe61718b3 Bug 1628388 - Add ACCEPT_FIRST_PARTY_AND_ISOLATE_OTHERS to CookieBehavior to support dFPI and add a setting to control it to GVE. r=esawin,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D73473
2020-05-08 15:51:09 +00:00
Atique Ahmed Ziad
0feacb38f7 Bug 1633328 - support tabs.goForward() and tabs.goBack() for Android r=zombie,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D73010
2020-05-08 08:23:43 +00:00
Agi Sferro
40aaada87c Bug 1635914 - Add workaround for docShellIsActive. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D74130
2020-05-06 20:49:39 +00:00
Dylan Roeh
a604ef3384 Bug 1634545 - Update GVE's tracking protection settings to fix some bugs and add more control. r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D73348
2020-05-06 20:19:33 +00:00
John Lin
b873d056bc Bug 1634170 - clear crypto info before reusing recycled sample. r=geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D73989
2020-05-06 12:00:22 +00:00
Simon Giesecke
d3e9abdf69 Bug 1626570 - Improve handling of copying arrays in mobile/. r=geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D73682
2020-05-06 11:50:59 +00:00
Csoregi Natalia
d68addcbf2 Backed out changeset 44a166a4efdb (bug 1555255) for causing bustage of android-sdk-linux because the docs package doesn't exist anymore. CLOSED TREE 2020-05-06 07:12:30 +03:00
Agi Sferro
82fa9ddcde Bug 1601067 - Add deprecation notice for registerWebExtension. r=droeh
Differential Revision: https://phabricator.services.mozilla.com/D73514
2020-05-05 23:02:49 +00:00
Agi Sferro
a017477abe Bug 1601067 - Make the test-support extension installable. r=owlish,snorp
Differential Revision: https://phabricator.services.mozilla.com/D72980
2020-05-05 23:02:51 +00:00
Agi Sferro
2cf1ad60da Bug 1601067 - Use installBuiltIn in tests instead of registerWebExtension. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D72979
2020-05-05 23:02:53 +00:00
Agi Sferro
6122ab6818 Bug 1601067 - Implement installBuiltIn. r=mixedpuppy,owlish,snorp
Differential Revision: https://phabricator.services.mozilla.com/D72978
2020-05-05 23:02:56 +00:00
Agi Sferro
87a2e3d943 Bug 1601067 - Add IDs and nativeMessagingFromContent to tests. r=snorp
This in preparation to making these test extensions installable.

Differential Revision: https://phabricator.services.mozilla.com/D72977
2020-05-05 23:02:58 +00:00
Agi Sferro
ee5f146bcd Bug 1601067 - Add nativeMessagingFromContent privileged permission. r=zombie,snorp
Installed privileged addons in GeckoView sometimes need to send messages from
content scripts. Today we use the in-memory flag `ALLOW_CONTENT_MESSAGING` to
allow a specific built-in addon to send messages from content scripts, but for
installed extensions we need a way to persist this flag.

To do this, this patch introduces a new privileged permission
`nativeMessagingFromContent`, when this permission is present in the manifest,
the addon will be allowed to send native messages from content scripts (note:
the addon will also need `nativeMessaging` as usual).

When the permission is not present, any attempt to send a native message from a
content script will result in an error, similarly to what happens before this
patch.

Differential Revision: https://phabricator.services.mozilla.com/D72976
2020-05-05 23:02:47 +00:00
Agi Sferro
4827a18544 Bug 1601067 - Collect NewTab messages until a delegate is registered. r=snorp
Sometimes extensions call tabs.create immediately on startup. In that case the
delegate may not be attached yet. To avoid losing these messages we store them
until a delegate is attached.

This also includes a refactoring to unify behavior for delegates. Eventually I
want to factor out delegates similarly to what happens in GeckoSession today.

Differential Revision: https://phabricator.services.mozilla.com/D72975
2020-05-05 23:08:01 +00:00
Agi Sferro
596114f140 Bug 1601067 - Only send ActionDelegate:Attached when the delegate is not null. r=snorp
We use this to send a default action to the embedder, but if no one is
listening there's no point, and it causes problems in tests because sometimes
the delegate is attached / reattached too quickly and the second delegate will
end up getting two messages by mistake.

Differential Revision: https://phabricator.services.mozilla.com/D72974
2020-05-05 23:02:44 +00:00
Agi Sferro
25746f1383 Bug 1601067 - Catch exception thrown by newURI. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D73502
2020-05-05 23:02:42 +00:00
Mihai Alexandru Michis
d8308aa13f Backed out 9 changesets (bug 1601067) for causing gv failures in WebExecutorTest.
CLOSED TREE

Backed out changeset a57940d6af63 (bug 1601067)
Backed out changeset d16aa7b33165 (bug 1601067)
Backed out changeset f5d8f660ba87 (bug 1601067)
Backed out changeset 3b4e20521d4b (bug 1601067)
Backed out changeset b396fa314c25 (bug 1601067)
Backed out changeset 62f5d5d34162 (bug 1601067)
Backed out changeset fe94f4277bfa (bug 1601067)
Backed out changeset b15906852fe4 (bug 1601067)
Backed out changeset 23d021ef34c4 (bug 1601067)
2020-05-06 01:58:11 +03:00
Agi Sferro
69645103b4 Bug 1601067 - Add deprecation notice for registerWebExtension. r=droeh
Differential Revision: https://phabricator.services.mozilla.com/D73514
2020-05-05 22:19:42 +00:00
Agi Sferro
d713c54e7d Bug 1601067 - Make the test-support extension installable. r=owlish,snorp
Differential Revision: https://phabricator.services.mozilla.com/D72980
2020-05-05 22:19:30 +00:00
Agi Sferro
699cc8cf70 Bug 1601067 - Use installBuiltIn in tests instead of registerWebExtension. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D72979
2020-05-05 22:19:28 +00:00
Agi Sferro
859bdae8a8 Bug 1601067 - Implement installBuiltIn. r=mixedpuppy,owlish,snorp
Differential Revision: https://phabricator.services.mozilla.com/D72978
2020-05-05 22:19:26 +00:00
Agi Sferro
b86a9bfbf5 Bug 1601067 - Add IDs and nativeMessagingFromContent to tests. r=snorp
This in preparation to making these test extensions installable.

Differential Revision: https://phabricator.services.mozilla.com/D72977
2020-05-05 22:19:23 +00:00
Agi Sferro
f3d0825866 Bug 1601067 - Add nativeMessagingFromContent privileged permission. r=zombie,snorp
Installed privileged addons in GeckoView sometimes need to send messages from
content scripts. Today we use the in-memory flag `ALLOW_CONTENT_MESSAGING` to
allow a specific built-in addon to send messages from content scripts, but for
installed extensions we need a way to persist this flag.

To do this, this patch introduces a new privileged permission
`nativeMessagingFromContent`, when this permission is present in the manifest,
the addon will be allowed to send native messages from content scripts (note:
the addon will also need `nativeMessaging` as usual).

When the permission is not present, any attempt to send a native message from a
content script will result in an error, similarly to what happens before this
patch.

Differential Revision: https://phabricator.services.mozilla.com/D72976
2020-05-05 22:19:13 +00:00
Agi Sferro
5dd2be61eb Bug 1601067 - Collect NewTab messages until a delegate is registered. r=snorp
Sometimes extensions call tabs.create immediately on startup. In that case the
delegate may not be attached yet. To avoid losing these messages we store them
until a delegate is attached.

This also includes a refactoring to unify behavior for delegates. Eventually I
want to factor out delegates similarly to what happens in GeckoSession today.

Differential Revision: https://phabricator.services.mozilla.com/D72975
2020-05-05 22:19:11 +00:00
Agi Sferro
df91383e8d Bug 1601067 - Only send ActionDelegate:Attached when the delegate is not null. r=snorp
We use this to send a default action to the embedder, but if no one is
listening there's no point, and it causes problems in tests because sometimes
the delegate is attached / reattached too quickly and the second delegate will
end up getting two messages by mistake.

Differential Revision: https://phabricator.services.mozilla.com/D72974
2020-05-05 20:54:00 +00:00
Agi Sferro
04097efffa Bug 1601067 - Catch exception thrown by newURI. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D73502
2020-05-05 20:54:00 +00:00
Aaron Klotz
bebfb567e8 Bug 1635173: Add GeckoSessionTestRule.getSessionPid() to junit; r=agi,geckoview-reviewers
To support this API, we do the following:

Additions to `GeckoSessionTestRule`:
* We add an overload to `webExtensionApiCall` that accepts a `GeckoSession`
  argument. Instead of sending the message to the extension's background script,
  this overload instead sends the message to the port for the session's
  content script.
* We add `GeckoSessionTestRule.getSessionPid()` which uses the new
  `webExtensionApiCall` overload. Moving other existing APIs over to use the
  new overload is out of scope for this bug and should be done in follow-ups.

Additions to the `test-support` extension:
* We modify the content script to receive an API call message from the native
  port. It then forwards the request up to the background script. By doing it
  this way, the background script will receive the message along with the
  WebExtension `Tab` object belonging to the sender;
* The background script's message handler merges the tab into the arguments
  to the API as a `tab` property;
* The background script then calls the API and the result is returned to
  the harness using the native port, just like the normal implementation;
* We add a `GetPidForTab` API for resolving top-level PIDs from a webext tab id.

Differential Revision: https://phabricator.services.mozilla.com/D73723
2020-05-05 18:43:56 +00:00