Closed
Bug 1253738
Opened 9 years ago
Closed 9 years ago
ServiceWorkerManager stores a single RegistrationDataPerPrincipal for all principals with same origin attributes
Categories
(Core :: DOM: Service Workers, defect)
Core
DOM: Service Workers
Tracking
()
RESOLVED
FIXED
mozilla48
People
(Reporter: bkelly, Assigned: bkelly)
References
Details
Attachments
(3 files, 2 obsolete files)
(deleted),
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
While investigating another bug I found that we are not actually storing separate RegistrationDataPerPrincipal structures for each principal. Instead we are storing a single struct for all principals with the same extended origin attributes. In desktop this mean nearly all principals end up with a single struct.
This will mostly work, but it means all domains are sharing job queues, etc. We also have much slower lookup of registrations by scope since its O(n) across all registrations in the system.
Assignee | ||
Comment 1•9 years ago
|
||
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8726949 -
Attachment is obsolete: true
Assignee | ||
Comment 3•9 years ago
|
||
Try is looking pretty green:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a7c9f05f070e
I'm going to clean up the patch for review.
Assignee | ||
Comment 4•9 years ago
|
||
In preparation for using something other than origin attributes for the scope key, require all clients to pass a full nsIPrincipal when looking up a registration.
Attachment #8727547 -
Attachment is obsolete: true
Attachment #8727607 -
Flags: review?(amarchesini)
Assignee | ||
Comment 5•9 years ago
|
||
Also rename variable to use the "scope key" terminology instead of referencing the origin suffix.
I stopped short of creating an opaque ScopeKey type because its nice to be able to just pass strings around.
Attachment #8727608 -
Flags: review?(amarchesini)
Assignee | ||
Comment 6•9 years ago
|
||
Change PrincipalToScopeKey() to use nsIPrincipal::GetOrigin(). This ensures that the hash table keys for different principals do not collide. The origin string produced by nsIPrincipal is guaranteed to contain the suffix if present.
Also assert that we are not setting empty scope keys in the future.
Attachment #8727609 -
Flags: review?(amarchesini)
Assignee | ||
Comment 7•9 years ago
|
||
Updated•9 years ago
|
Attachment #8727607 -
Flags: review?(amarchesini) → review+
Updated•9 years ago
|
Attachment #8727608 -
Flags: review?(amarchesini) → review+
Updated•9 years ago
|
Attachment #8727609 -
Flags: review?(amarchesini) → review+
Comment 9•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e35f587fa328
https://hg.mozilla.org/mozilla-central/rev/ffb0e778ab75
https://hg.mozilla.org/mozilla-central/rev/8ccab7d6447f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•