Closed Bug 1536411 Opened 5 years ago Closed 5 years ago

Experiment with StoragePrincipal

Categories

(Core :: Privacy: Anti-Tracking, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: baku, Assigned: baku)

References

Details

Attachments

(10 files, 1 obsolete file)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

This experiment wants to introduce a new principal to give access to the site's cookie jar: the StoragePrincipal. For non-tracking resources, the storagePrincipal will be equal to the NodePrincipal, but for 3rd party trackers, it will have the first-party attribute set to the top-level domain.

The StoragePrincipal will be reset to the NodePrincipal's one when the Storage Access permission is granted.

It's very exciting to see this come to fruition and I'm very happy with the strategy arrived at!

Is it possible to try and get some type of explainer document or large comment-block into the tree that builds upon the context provided by your description in https://groups.google.com/d/msg/mozilla.dev.platform/qO6MserGVmk/sT83XseXCgAJ and the greater context of your thread's explanation of the Storage Access API and the StoragePrincipal?

Ideally we could then reference/point-to this via a comment that precedes the addition of mStoragePrincipal instances. Specifically, I'm thinking I could help provide an enhancement to searchfox so that when someone is looking at one of the definition lines of mStoragePrincipal/mStoragePrincipalInfo, they'd see a comment line above it like "see dom/doc/StoragePrincipal.md" or "see dom/doc/StorageAccessAPI.md#StoragePrincipal" or something. And they could click on it and they'd then have your great explainer to look at.

The exact mechanics of the storage principal linkage aren't really a concern at this time, I mainly want:

  1. Your most excellent explanations available to people in-tree.
  2. That people know that the most excellent explanations exist.

And then I and others can iterate on making point 2 more accessible. There's some currently-shelved in-progress work to help provide more direct access to/awareness of block comments in searchfox in the popups that I'm hoping to get back to soon.

It's fine if the first part is a comment in source-code too, but as the searchfox query at https://searchfox.org/mozilla-central/search?q=&case=false&regexp=false&path=.md%24 demonstrates, it's becoming more and more common to put markdown based documentation into the tree and I think it's probably easier to edit a markdown file and provide things like code snippets, etc. that way.

Thanks!

Flags: needinfo?(amarchesini)

Andrea, I did my best to review all parts, but unfortunately I didn't get to parts 6 and 7, sorry about that. Those two would need to wait till Monday...

Attachment #9053521 - Attachment is obsolete: true
Attachment #9053522 - Attachment description: Bug 1536411 - StoragePrincipal - part 7 - Cookies, r?ehsan → Bug 1536411 - StoragePrincipal - part 6 - Cookies, r?ehsan
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/87601ef1d4d4
StoragePrincipal - part 0 - WorkerPrivate::StorageAccess, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/45708d22bb6d
StoragePrincipal - part 1 - Implementation, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/2eb20578159b
StoragePrincipal - part 2 - Worker and StoragePrincipal, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/552c4b588524
StoragePrincipal - part 3 - IDBFactory, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/ccbe1af00fb9
StoragePrincipal - part 4 - BroadcastChannel, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/1107a9767f38
StoragePrincipal - part 5 - Tests, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/f67d157e8baf
StoragePrincipal - part 6 - Cookies, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/c68dc3152faa
StoragePrincipal - part 7 - test for DOMCache and ServiceWorkers, r=Ehsan,asuth
https://hg.mozilla.org/integration/autoland/rev/f94dfbf2476c
StoragePrincipal - part 8 - SharedWorkers, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/eda5854cd7e8
StoragePrincipal - part 9 - documentation, r=ckerschb,asuth
Backout by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a047b64590a4
Backed out 10 changesets for causing leaks in CondVar, MessagePortService, MessagePortServiceData.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=success%2Ctestfailed%2Cbusted%2Cexception&searchStr=browser%2Cchrome&tochange=cb9e9d32e5213700d73b041daa4971f6a4785497&group_state=expanded&fromchange=9a8e3ac367f880c2383561a89944bc6ddeb10477&selectedJob=239730624

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=239730624&repo=autoland&lineNumber=27285

Backout link: https://hg.mozilla.org/integration/autoland/rev/a047b64590a4926c919b299f883cec2e00d1dedd

18:09:35 INFO - TEST-INFO | leakcheck | default leaked 1 nsThread
18:09:35 INFO - TEST-UNEXPECTED-FAIL | leakcheck | default 1240 bytes leaked (CondVar, MessagePortService, MessagePortServiceData, Mutex, SharedJSAllocatedData, ...)
18:09:35 INFO -
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_plugin_pid1105.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, plugin process 1105
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 80 0| 2437 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 43 entries
18:09:35 INFO - TEST-PASS | leakcheck | plugin no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1097.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1097
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 39 0| 814328 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 971 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1098.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1098
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 40 0| 9633264 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 1364 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1099.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1099
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 39 0| 8136745 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 1307 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1100.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1100
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 31 0| 1602788 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 1016 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1101.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1101
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 39 0| 1104619 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 1020 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1102.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1102
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 44 0| 12592 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 393 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1103.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1103
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 44 0| 502307 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 1079 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1104.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1104
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 41 0| 164548 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 927 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1106.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1106
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 41 0| 173408 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 957 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1107.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1107
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 41 0| 186826 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 956 entries
18:09:35 INFO - TEST-PASS | leakcheck | tab no leaks detected!
18:09:35 INFO - leakcheck | Processing leak log file /var/folders/dn/fsrggjbj1dj9vh735pdj820w00000x/T/tmp5Rmzjr.mozrunner/runtests_leaks_tab_pid1108.log
18:09:35 INFO -
18:09:35 INFO - == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS, tab process 1108
18:09:35 INFO -
18:09:35 INFO - |<----------------Class--------------->|<-----Bytes------>|<----Objects---->|
18:09:35 INFO - | | Per-Inst Leaked| Total Rem|
18:09:35 INFO - 0 |TOTAL | 41 0| 172995 0|
18:09:35 INFO -
18:09:35 INFO - nsTraceRefcnt::DumpStatistics: 949 entries

Flags: needinfo?(amarchesini)
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fdd9adb9382f
StoragePrincipal - part 0 - WorkerPrivate::StorageAccess, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/4191e4de46ca
StoragePrincipal - part 1 - Implementation, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/382b8c528545
StoragePrincipal - part 2 - Worker and StoragePrincipal, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/5b98a535f40d
StoragePrincipal - part 3 - IDBFactory, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/8593e3e86772
StoragePrincipal - part 4 - BroadcastChannel, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/ed51986b7628
StoragePrincipal - part 5 - Tests, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/c1074e3a0d5f
StoragePrincipal - part 6 - Cookies, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/9fd7d42e7f55
StoragePrincipal - part 7 - test for DOMCache and ServiceWorkers, r=Ehsan,asuth
https://hg.mozilla.org/integration/autoland/rev/941f963a8fc8
StoragePrincipal - part 8 - SharedWorkers, r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/9603ef15dc04
StoragePrincipal - part 9 - documentation, r=ckerschb,asuth
Assignee: nobody → amarchesini
Depends on: 1547813
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: