Additional changes needed to observe the "extension-worker-loaded" topics and notify the main process when the background
service worker script has been fully loaded (similarly to how we notify the main process when
the background page has been fully loaded).
Differential Revision: https://phabricator.services.mozilla.com/D124704
This patch includes:
- changed ExtensionAPIRequestHandler to handle the new INIT_WORKER_CONTEXT requestType and create
the ExtensionWorkerContextChild instance and store it in a map keyed by service worker descriptor id.
- simplified handling of all other ExtensionAPIRequest types (by expecting that the
ExtensionWorkerContextChild has been created once when the initExtensionWorker has been called).
- destroy an existing ExtensionWorkerContextChild instance (identified by its service worker descriptor id)
when ExtensionAPIRequestHandler.onExtensionWorkerDestroyed has been called.
Differential Revision: https://phabricator.services.mozilla.com/D124703
This patch introduces a new getRegistrationForAddonPrincipal to nsIServiceWorkerManager.
This method is similar to the existing getRegistrationForPrincipal but:
- similarly to registerForAddonPrincipal it only gets the extension principal as its only
input parameter.
- unlike getRegistrationForPrincipal, it doesn't throw if the registration has not been found
(e.g. because it was already unregistered when the method was called).
Differential Revision: https://phabricator.services.mozilla.com/D124702
This patch includes changes needed to notify the WebExtensions internals
when a background service worker script has been fully loaded, through a
NotifyWorkerLoadedRunnable (dispatched as low priority) that calls a new
mozIExtensionAPIRequestHandler.onExtensionWorkerLoaded method.
Differential Revision: https://phabricator.services.mozilla.com/D124701
This patch adds additional changes needed to notify, from WorkerPrivate ExecutionReady,
the WebExtensions internals that a new background service worker is ready to be executed,
and its related ExtensionWorkerContextChild should be created and initialized.
Differential Revision: https://phabricator.services.mozilla.com/D124700
This patch introduce a new RequestInitWorkerRunnable that calls a new mozIExtensionAPIRequestHandler.initExtensionWorker
method, and a CreateAndDispatchInitWorkerRunnable helper function which will be used to send
this mozIExtensionAPIRequest from the worker thread to the main thread when the background
service worker is ready for being executed (but before its main scripts has been evaluated
in the newly created service worker global scope).
Differential Revision: https://phabricator.services.mozilla.com/D124699
This patch adds the ServiceWorkerInfo descriptor id to the property available in the
mozIExtensionServiceWorkerInfo.
The descriptor ID is an integer assigned on the main process to each ServiceWorkerPrivate instance,
which will allow us to verify in the main process that the worker running in the child process is
part of the expected service worker registration, and it is also still available when the worker
is already being destroyed, which makes it useful as the key used in the map of the extension
service worker context that we keep in the child extension process.
Differential Revision: https://phabricator.services.mozilla.com/D124698
This patch introduces the following changes:
- In WorkerPrivate::ExtensionAPIAllowed: removed assertion on StaticPrefs::extensions_backgroundServiceWorker_enabled_AtStartup,
replaced with just ignoring mExtensionAPIAllowed if the feature is turned out by prefs
- Added a new CreateAndDispatchWorkerDestroyedRunnable helper function to create and dispatch
a runnable (as a low priority one) to call a new mozIExtensionAPIRequestHandler.onExtensionWorkerDestroyed
method.
The service worker that has been destroyed is identified by its descriptor ID (the descriptor ID is an integer,
assigned on the main process to each ServiceWorkerPrivate instance, and still available when the worker is
already being destroyed).
Differential Revision: https://phabricator.services.mozilla.com/D124697
Tidy up MaxMemoryPages(IndexType::I64) so that it returns a value
corresponding to the max buffer byte length. Fix two asserts that
were incorrect and that triggered when making this change.
Add a test that the max memory pages for i64 is indeed at least 8GB.
Drive-by fix to allow a test to OOM without reporting that as a
failure.
Differential Revision: https://phabricator.services.mozilla.com/D130452
Bug 1721849 added 'data' variable which only got called by assertions which are
ignore in opt builds outside Nightly and causes the build to report 'data' as
unused variable.
Differential Revision: https://phabricator.services.mozilla.com/D130456
This replaces use of MCreateThisWithTemplate with MNewPlainObject. This adds a
MIR flag to replace checks for MCreatThisWithTemplate.
Differential Revision: https://phabricator.services.mozilla.com/D130104
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
The preference should be enabled before rolling out "fission for authenticated sites"
to makes sure we have the permissions there when the feature is on.
Differential Revision: https://phabricator.services.mozilla.com/D127107
Right now, all high-value permissions have the same expiration time, but
we might want to set difference expiration time for different
high-value permission type in the future.
Differential Revision: https://phabricator.services.mozilla.com/D127106
Sites that match the following heuristic are considered high-value:
1. Sites that have a password stored in the password manager
2. Sites that we detect that users submit a form with a password
This patch adds LoginDetectionService to detect login attempts.
When LoginDetectionService finds a site that matches any of the above
heuristics, it adds the corresponding high-value permission to the
permission manager.
Differential Revision: https://phabricator.services.mozilla.com/D127105
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
The new 'searchAllLoginsAsync' API works the same as the `getAllLoginsAsync` API.
The purpose of adding the API is to make C++ caller easier to use.
Differential Revision: https://phabricator.services.mozilla.com/D127103
This patch:
1. adds two 'highValueHasSavedLogin' and 'highValueIsLoggedIn' permission
2. moves 'AddHighValuePermission' from HttpBaseChannel to ProcessIsolation
to support more high-value permission type.
Differential Revision: https://phabricator.services.mozilla.com/D127101
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
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
The virutalenv hack is in the fedora-distributed version of
virtualenv... Presumably eventually will become unnecessary once they
provide a proper "venv" distutils?
This patch applies both before and after the bump in comment 5, so your
call.
Differential Revision: https://phabricator.services.mozilla.com/D130410
The telemetry result is written in bug 1706266 comment 1:
https://bugzilla.mozilla.org/show_bug.cgi?id=1706266#c1
`increasefontsize`, `decreasefontsize`, `gethtml`, `heading` and `readonly` are
obviously not used by web apps in the wild. Therefore, they can be disabled
in all channels.
`contentReadOnly` and `insertBrOnReturn` are odd. The usage is really low (less
than 1% of beta users). However, the number of documents which used the command
is about 1k samples. The result of the commands are not tiny (making the editor
not editable or changing the behavior at typing `Enter` key in `<div>`, `<p>`,
etc). Therefore, it's hard to use them in web apps which supports not only
Gecko. So I guess that they are collected the number of used by automated
tests of somebody because of the constant number in other beta versions.
Perhaps, we should disable it only in Nightly channel for now, and after a
couple of releases, we should try to disable those commands too later.
Depends on D130328
Differential Revision: https://phabricator.services.mozilla.com/D130329
It's a DOM API and we are going to change supporting commands for making it
compatible with the other browsers.
Currently, it's used only in `Document::EditingStateChanged()` to initialize the
default paragraph separator from `<br>` to `<p>` or `<div>`. However, the
command, `insertBrOnReturn` is Gecko specific one, and I'd like to stop
supporting it with the following patch. Therefore, we need to do this change
first.
For mozregressions, this patch will be landed separately before landing the
following patch.
Differential Revision: https://phabricator.services.mozilla.com/D130328
I'd like to split utilities for all editors and only for `HTMLEditor`.
This moves some trivial classes into new `HTMLEditHelpers.h`. Perhaps, it's
better if we can move them into `HTMLEditUtils.h`, but it has too many inline
method definitions so that adding new classes into it makes it much bigger.
Depends on D130349
Differential Revision: https://phabricator.services.mozilla.com/D130425