Closed Bug 1624269 Opened 5 years ago Closed 4 years ago

Make mHasStorageAccess in nsGlobalWindowOuter Fission-Compatible

Categories

(Core :: Privacy: Anti-Tracking, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla78
Fission Milestone M6a
Tracking Status
firefox78 --- fixed

People

(Reporter: timhuang, Assigned: dimi)

References

Details

Attachments

(5 files, 1 obsolete file)

See here, the permission observer here won't work in Fission since the storage permission could be put under a cross-origin principal under the current design of the storage permission in ETP. We need to fix this too.

Tracking ETP bugs for Fission Nightly (M6) milestone

Fission Milestone: --- → M6
Priority: -- → P2
Assignee: nobody → dlee
Status: NEW → ASSIGNED
Assignee: dlee → nobody
Status: ASSIGNED → NEW
Assignee: nobody → dlee
Status: NEW → ASSIGNED
Depends on: 1612376

CookieBehavior should be the same for all the frames in the same tab,
we don't have to get its value for every browsing context in the same
browsing context tree.

CookieBehavior should be the same for all the frames in the same tab,
we don't have to get its value for every browsing context in the same
browsing context tree.

Before this patch, in non-fission mode, we cache storage access granted result
in the top-level window so we don't have to iterate all the browsing contexts
in the same tree while syncing the storage permission granted decision.

However, since we plan to rely on the current update mechanism to sync
mHasStorageAccess flag for different documents in the same tab (instead of using
the syncing mechanism of permission manager), we will eventually need to iterate
the browsing context tree to find all the documents to sync. Base on this,
we no longer have to maintain different method for fission and non-fission.

In this patch, we store the permission granted result in the inner
window instead of using permission key and store the key in the top-level
window.

Depends on D73709

We already have an architecture to sync the storage access granted
result to all 3rd-party frames with the same tracking origin.
We use the same way to sync HasStorageAccess flag instead of relying
on permission manager update permissions to child processes.

Depends on D73710

Attachment #9145518 - Attachment is obsolete: true

Before this patch, we only call StorageAccessGranted on windows that
triggers the storage heuristics. So even if we sync storage permission to the
other frames, their data will not be refreshed. For example, if a document
has a worker, we don't propagate the permission to the worker.

In this patch, we call ::StorageAccessGranted as long as we update
the window's storage permission.

Depends on D73710

Attachment #9145522 - Attachment description: Bug 1624269 - P3. Not using permission manager to sync HasStorageAccess. → Bug 1624269 - P4. Not using permission manager to sync HasStorageAccess.

Depends on D73711

Fission Milestone: M6 → M6a
Priority: P2 → P1
Attachment #9145520 - Attachment description: Bug 1624269 - P1. Only get CookieBehavior once → Bug 1624269 - P1. Only get CookieBehavior once r=timhuang
Attachment #9145521 - Attachment description: Bug 1624269 - P2. Cache access granted result in the 3rd-party window instead of top-level window in fission mode. → Bug 1624269 - P2. Cache access granted result in the 3rd-party window instead of top-level window in fission mode. r=timhuang
Attachment #9145522 - Attachment description: Bug 1624269 - P4. Not using permission manager to sync HasStorageAccess. → Bug 1624269 - P4. Not using permission manager to sync HasStorageAccess. r=timhuang
Pushed by dlee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/599db5acefe1 P1. Only get CookieBehavior once r=timhuang,baku https://hg.mozilla.org/integration/autoland/rev/81420bca683c P2. Cache access granted result in the 3rd-party window instead of top-level window in fission mode. r=timhuang,baku https://hg.mozilla.org/integration/autoland/rev/be697a5bc0fd P3. Inform all the windows whose storage permission is granted. r=timhuang,baku https://hg.mozilla.org/integration/autoland/rev/23b5c53f4be8 P4. Not using permission manager to sync HasStorageAccess. r=timhuang,baku https://hg.mozilla.org/integration/autoland/rev/59cdba115447 P5. Testcase r=timhuang,baku

Backed out for browser-chrome failures on browser_storageAccessWithHeuristics.js

backout: https://hg.mozilla.org/integration/autoland/rev/98d6f183d5241ebd0e32dc767c33e83f602faa0f

push: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedTaskRun=L3xZWkacQfiADFrUMSGe1g-0&searchStr=linux%2C18.04%2Cx64%2Casan%2Copt%2Cmochitests%2Ctest-linux1804-64-asan%2Fopt-mochitest-browser-chrome-e10s-16%2Cm%28bc16%29&revision=59cdba115447e5687ee020224923fbefd6ed19e4

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=302718551&repo=autoland&lineNumber=1841

[task 2020-05-18T10:28:46.341Z] 10:28:46 INFO - Let's do another window.open()
[task 2020-05-18T10:28:46.342Z] 10:28:46 INFO - Console message: [JavaScript Warning: "Storage access automatically granted for origin “https://tracking.example.org” on “https://tracking.example.org”."]
[task 2020-05-18T10:28:46.343Z] 10:28:46 INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "https://tracking.example.org/browser/toolkit/components/antitracking/test/browser/3rdPartyOpen.html" line: 0}]
[task 2020-05-18T10:28:46.343Z] 10:28:46 INFO - Buffered messages finished
[task 2020-05-18T10:28:46.344Z] 10:28:46 INFO - TEST-UNEXPECTED-FAIL | toolkit/components/antitracking/test/browser/browser_storageAccessWithHeuristics.js | Has storage access - false == true - got false, expected true (operator ==)
[task 2020-05-18T10:28:46.345Z] 10:28:46 INFO - Stack trace:
[task 2020-05-18T10:28:46.345Z] 10:28:46 INFO - ok@resource://specialpowers/SpecialPowersSandbox.jsm:87:21
[task 2020-05-18T10:28:46.346Z] 10:28:46 INFO - msg@chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/browser_storageAccessWithHeuristics.js:151:15
[task 2020-05-18T10:28:46.346Z] 10:28:46 INFO - EventListener.handleEvent*@chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/browser_storageAccessWithHeuristics.js:143:17
[task 2020-05-18T10:28:46.347Z] 10:28:46 INFO - @chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/browser_storageAccessWithHeuristics.js:136:13
[task 2020-05-18T10:28:46.347Z] 10:28:46 INFO - execute@resource://specialpowers/SpecialPowersSandbox.jsm:141:12
[task 2020-05-18T10:28:46.347Z] 10:28:46 INFO - _spawnTask@resource://specialpowers/SpecialPowersChild.jsm:1734:15
[task 2020-05-18T10:28:46.347Z] 10:28:46 INFO - receiveMessage@resource://specialpowers/SpecialPowersChild.jsm:281:21
[task 2020-05-18T10:28:46.348Z] 10:28:46 INFO - JSActor queryreceiveMessage@resource://specialpowers/SpecialPowersParent.jsm:1119:12
[task 2020-05-18T10:28:46.348Z] 10:28:46 INFO - JSActor query
spawn@resource://specialpowers/SpecialPowersChild.jsm:1689:17
[task 2020-05-18T10:28:46.349Z] 10:28:46 INFO - testDoublyNestedWindowOpenHeuristic@chrome://mochitests/content/browser/toolkit/components/antitracking/test/browser/browser_storageAccessWithHeuristics.js:115:23
[task 2020-05-18T10:28:46.349Z] 10:28:46 INFO - AsyncTester_execTest/<@chrome://mochikit/content/browser-test.js:1064:34
[task 2020-05-18T10:28:46.349Z] 10:28:46 INFO - async
Tester_execTest@chrome://mochikit/content/browser-test.js:1104:11
[task 2020-05-18T10:28:46.349Z] 10:28:46 INFO - nextTest/<@chrome://mochikit/content/browser-test.js:927:14
[task 2020-05-18T10:28:46.350Z] 10:28:46 INFO - SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:918:23

Flags: needinfo?(dlee)
Pushed by dlee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f9edbff92af5 P1. Only get CookieBehavior once r=timhuang,baku https://hg.mozilla.org/integration/autoland/rev/6cf0a879475e P2. Cache access granted result in the 3rd-party window instead of top-level window in fission mode. r=timhuang,baku https://hg.mozilla.org/integration/autoland/rev/302d7f2d05a7 P3. Inform all the windows whose storage permission is granted. r=timhuang,baku https://hg.mozilla.org/integration/autoland/rev/b4d9fdb09028 P4. Not using permission manager to sync HasStorageAccess. r=timhuang,baku https://hg.mozilla.org/integration/autoland/rev/94cc5975ab11 P5. Testcase r=timhuang,baku
Flags: needinfo?(dlee)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: