This patch begins re-implements ReadableStreams using WebIDL and DOM technology (vs the existing JS streams implementation). Some more background is [here](https://docs.google.com/document/d/1MWRkF32KV60ngOY-Ip4PnKbCMvl6VK_Y9QLED8MJJxg/edit#)
This is guarded under a configure flag `--enable-dom-streams`
1. ByteStreams and ReadableStream.tee will come in future patches.
2. I intentionally crash in other parts of the DOM that require streams (Fetch, Response, Blob), until the integration work is done in future patches.
My current plan for that integration doesn't involve re-creating the alternative 'external streams' API from SpiderMonkey's implementation, but I have yet to do enough development to verify that will work.
Differential Revision: https://phabricator.services.mozilla.com/D122643
- Adding a test to validate behavior on non-tracking first-party requests
- Correct the result of a tracking same-origin request (now hasStorageAccess() == false when cookiePolicy = 2)
- Add check near the top of Document::HasStorageAccess to immediately return false when cookiePolicy is REJECT.
Differential Revision: https://phabricator.services.mozilla.com/D126399
NOTE: this issue in the test_ext_new_tab_processType.html test was not actually the one triggering
the intermittent failures being tracked by this bug, but while investigating the issue I did notice
an unexpected tab in the screenshots attached to the failures and looked into fix it to confirm
if it was related or not to the failures triggered while running test_ext_webrequest_basic.html.
Differential Revision: https://phabricator.services.mozilla.com/D127484
The underlying reasons for the test to fail for a timeout seems to be the same
ones that D94613 was meant to fix:
- a favicon request may be triggered at a random time while one of the test case
in the test file is asserting the intercepted web requests
- a previous run (in particular when running under --verify or as part of a TV job)
may have cached the stylesheet and the resulting webrequest may not match
the properties expected (and asserted) by the test case
The original patch was attached and pushed to autoland from Bug 1633189
(see https://bugzilla.mozilla.org/show_bug.cgi?id=1633189#c46), but it seems that
it has been backed out (https://bugzilla.mozilla.org/show_bug.cgi?id=1633189#c47)
and instead we ended up landing a patch (D123339) that skipped the test in
linux-asan-opt.
NOTE:
- The unexpected favicon request which was making the test case to permafail
on the build infrastructure is only triggered when "browser.chrome.guess_favicon"
is set to true, which is actually explicitly set in mochitest-common.ini, but
apparently those preferences are not being set when the test is executed locally
through `mach mochitest` / `mach test`
- To be able to reproduce the same behavior when running the test locally,
the pref has to be set through the --setpref command line option:
mach mochitest --setpref "browser.chrome.guess_favicon=true" ...
Differential Revision: https://phabricator.services.mozilla.com/D127398
This can be accomplished by the undocumented DWMWA_USE_IMMERSIVE_DARK_MODE.
You can test this by going to "Customize Toolbar" and checking "Title Bar", or
opening any native dialog like e.g. the profile creation window / the profile
manager / etc.
Differential Revision: https://phabricator.services.mozilla.com/D127636
Now that windows is going to support dark colors, we want to make it
behave like other platforms in this regard.
Having a single pref for this seems better.
Differential Revision: https://phabricator.services.mozilla.com/D127624
This patch adds tests for the StoragePrincipalHelper::GetPrincipal() but
only for the version which accepts a channel. The reason why we don't
add tests for window version is because there is no way to setup window
in gTest.
Differential Revision: https://phabricator.services.mozilla.com/D127439
This patch implements the StoragePrincipalHelper::GetPrincipal() which
is designed to be used to get the principal from the window/channel
according to the given principal type.
Differential Revision: https://phabricator.services.mozilla.com/D127438
In order to support always partitioned third-party storage,
like the service worker, in the future, we need to have another
principal type which uses partitioned principal in a third-party context
and regular principal in a first-party context.
Differential Revision: https://phabricator.services.mozilla.com/D127435
Rather than change every use of IntSize/Rect/Point in image/, this patch
attempts to draw the line at the relevant parts of the decoding pipeline
to prevent confusion about which size and orientation we are working
with.
Differential Revision: https://phabricator.services.mozilla.com/D126381
This is a new swizzle operation which allows us process a reorientation
row by row into its new orientation. This will be used in a later part
in the series in the image decoding pipeline.
Differential Revision: https://phabricator.services.mozilla.com/D126379
This patch fixes a leak that I spotted while investigating a separate shutdown leak triggered by D121683
(This one is not strictly related to D121683, but apparently none of the xpcshell tests part of this
stack of patches reported it at a shutdown leak, nevertheless it was detected as a shutdown leak
while running the test_ext_identity.html mochitest on the background service worker, after
the other leak specific to D121683 was fixed, and after investigating it using cc logs and heapgraph's
find_roots.py I confirmed that it's a shutdown leak introduced here in RequestWorkerRunnable::ProcessHandlerResult).
Differential Revision: https://phabricator.services.mozilla.com/D122968
This patch is a test-only follow up to part 8.2, both of the TODOs added in part 8.2 and removed in this patch
depends from the changes introduced in "part 10.1", "part 10.22" and "part 10.3" right before this one.
This patch adds an additional assertion to the smoke tests for the runtime API part of
test_ext_webidl_api_request_handler.js to confirm that the ExtensionPort instance received as the
last parameter of the port.onMessage listener is strictly equal to the `port` the listener was
added on.
Differential Revision: https://phabricator.services.mozilla.com/D122967
The extensions expect that ExtensionPort instances they get in the calls to the
port event listeners to always be the same, and to be also strictly equal to the
object port got from browser.runtime.connect or browser.runtime.onConnect:
```
const port = browser.runtime.connect();
port.onDisconnect.addListener(disconnectedPort => {
// port === disconnectedPort => true
});
```
This patch does add an extension port lookup map in the ExtensionBrowser
class and a new ExtensionBrowser::GetPort method which is responsible of
providing the expected behavior (returning an existing istance if one is
found in the lookup map).
Differential Revision: https://phabricator.services.mozilla.com/D107554
This patch does:
- add to ExtensionBrowser two new data members to keep track of value for the browser.runtime.lastError and if it was checked while
the chrome compatible callback was being executed
- add to ExtensionBrowser 3 new methods to set, get and clear the lastError value
- add a reference to the ExtensionBrowser to all API namespaces and API objects classes, because it has to be then propagated to the
ChromeCompatCallbackHandler instances that are being attached to the promise result of the async API methods calls if the caller did
pass the optional callback parameter
- tweak the ChromeCompatCallbackHandler class to set the lastError value before calling the callback in ChromeCompatCallbackHAndler::RejectedCallback
and then clear it after the call has been completed and report it to the console if it wasn't checked
- change the ExtensionRuntime::GetLastError methhod to restrieve and return the value from the ExtensionBrowser instance
Differential Revision: https://phabricator.services.mozilla.com/D107327