Closed
Bug 1455695
Opened 6 years ago
Closed 6 years ago
make ServiceWorkerRegistration::Inner only deal with MozPromise and cross-process types
Categories
(Core :: DOM: Service Workers, enhancement, P2)
Core
DOM: Service Workers
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: bkelly, Assigned: bkelly)
References
Details
Attachments
(5 files, 22 obsolete files)
18.44 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
5.98 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
8.44 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
6.09 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
4.46 KB,
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
In order to make use of the inner classes to implement remoting the inner classes must not have dependencies on content process types. So I need to remove stuff like promise, JSContext, etc from ServiceWorkerRegistration::Inner.
Updated•6 years ago
|
Priority: -- → P2
Comment 1•6 years ago
|
||
(In reply to Ben Kelly [:bkelly] from comment #0) > In order to make use of the inner classes to implement remoting the inner > classes must not have dependencies on content process types. So I need to > remove stuff like promise, JSContext, etc from > ServiceWorkerRegistration::Inner. Any long term implications to removing these?
Assignee | ||
Comment 2•6 years ago
|
||
(In reply to Marion Daly [:mdaly] from comment #1) > Any long term implications to removing these? Not really. It just means we have to do some work in ServiceWorkerRegistration.cpp instead of in lower code modules. Its necessary because we can't pass these types across the IPC boundary.
Assignee | ||
Comment 3•6 years ago
|
||
There is a spec incompatibility in our update() method: https://github.com/w3c/ServiceWorker/issues/1304 I think I should probably fix that while I'm touching this code.
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Attachment #8969791 -
Attachment is obsolete: true
Assignee | ||
Comment 7•6 years ago
|
||
Attachment #8969789 -
Attachment is obsolete: true
Assignee | ||
Comment 8•6 years ago
|
||
Attachment #8969796 -
Attachment is obsolete: true
Assignee | ||
Comment 9•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=06af4c51de7bcfbb18d03c254f66ca9d7a9eda5a
Assignee | ||
Comment 10•6 years ago
|
||
Assignee | ||
Comment 11•6 years ago
|
||
Attachment #8969803 -
Attachment is obsolete: true
Assignee | ||
Comment 12•6 years ago
|
||
Attachment #8969793 -
Attachment is obsolete: true
Assignee | ||
Comment 13•6 years ago
|
||
Comment on attachment 8970290 [details] [diff] [review] P0 Expose a GetPrincipal() convenience method on service worker descriptor classes. r=baku Andrea, this patch adds some convenience methods on the ServiceWorker*Descriptor classes that return an nsIPrincipal* instead of PrincipalInfo. This is consistent with what we have on ClientInfo::GetPrincipal().
Attachment #8970290 -
Flags: review?(amarchesini)
Assignee | ||
Comment 14•6 years ago
|
||
Comment on attachment 8970291 [details] [diff] [review] P1 Make ServiceWorkerRegistration::Inner::Update() use MozPromise and IPC-safe types. r=baku This patch moves the binding-level details for ServiceWorkerRegistration.update() into ServiceWorkerRegistration.cpp. The SWM and inner class only deal with MozPromise and portable internal types. Note, this patch does change some behavior. We were previously resolving undefined from an update() call, but the spec requires us to resolve the registration.
Attachment #8970291 -
Flags: review?(amarchesini)
Assignee | ||
Comment 15•6 years ago
|
||
Comment on attachment 8970296 [details] [diff] [review] P2 Fix tests to expect ServiceWorkerRegistration.update() to resolve with a registration. r=baku This patch fixes a mochitest and adds a WPT for the new behavior where we resolve a registration from update().
Attachment #8970296 -
Flags: review?(amarchesini)
Assignee | ||
Comment 16•6 years ago
|
||
Assignee | ||
Comment 17•6 years ago
|
||
Assignee | ||
Comment 18•6 years ago
|
||
Assignee | ||
Comment 19•6 years ago
|
||
Assignee | ||
Comment 20•6 years ago
|
||
Attachment #8970326 -
Attachment is obsolete: true
Assignee | ||
Comment 21•6 years ago
|
||
Attachment #8970329 -
Attachment is obsolete: true
Assignee | ||
Comment 22•6 years ago
|
||
Attachment #8970337 -
Attachment is obsolete: true
Assignee | ||
Comment 23•6 years ago
|
||
Attachment #8970345 -
Attachment is obsolete: true
Assignee | ||
Comment 24•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=736ab12baa124c1d7bc995860b3d8ad402bf774a
Assignee | ||
Comment 25•6 years ago
|
||
Assignee | ||
Comment 26•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=27e4b3d1f4db6392d1df383d0afc200c5c19137e
Comment 27•6 years ago
|
||
Comment on attachment 8970290 [details] [diff] [review] P0 Expose a GetPrincipal() convenience method on service worker descriptor classes. r=baku Review of attachment 8970290 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/serviceworkers/ServiceWorkerDescriptor.cpp @@ +101,5 @@ > +nsCOMPtr<nsIPrincipal> > +ServiceWorkerDescriptor::GetPrincipal() const > +{ > + AssertIsOnMainThread(); > + nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(mData->principalInfo()); How often is this method going to be called? Asking because maybe we could cache the nsIPrincipal object. ::: dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp @@ +136,5 @@ > +nsCOMPtr<nsIPrincipal> > +ServiceWorkerRegistrationDescriptor::GetPrincipal() const > +{ > + AssertIsOnMainThread(); > + nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(mData->principalInfo()); same here.
Attachment #8970290 -
Flags: review?(amarchesini) → review+
Updated•6 years ago
|
Attachment #8970291 -
Flags: review?(amarchesini) → review+
Updated•6 years ago
|
Attachment #8970296 -
Flags: review?(amarchesini) → review+
Assignee | ||
Comment 28•6 years ago
|
||
(In reply to Andrea Marchesini [:baku] from comment #27) > ::: dom/serviceworkers/ServiceWorkerDescriptor.cpp > @@ +101,5 @@ > > +nsCOMPtr<nsIPrincipal> > > +ServiceWorkerDescriptor::GetPrincipal() const > > +{ > > + AssertIsOnMainThread(); > > + nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(mData->principalInfo()); > > How often is this method going to be called? Asking because maybe we could > cache the nsIPrincipal object. I don't think its very hot. And hopefully in the nearish future nsIPrincipal will become threadsafe and we can nuke PrincipalInfo completely. I'd rather not deal with the cached value for now.
Assignee | ||
Comment 29•6 years ago
|
||
I'm going to land the first three patches in a separate bug while I fix orange on the remaining bugs here.
Assignee | ||
Updated•6 years ago
|
Attachment #8970290 -
Attachment is obsolete: true
Assignee | ||
Updated•6 years ago
|
Attachment #8970291 -
Attachment is obsolete: true
Assignee | ||
Updated•6 years ago
|
Attachment #8970296 -
Attachment is obsolete: true
Assignee | ||
Comment 30•6 years ago
|
||
Attachment #8970346 -
Attachment is obsolete: true
Assignee | ||
Comment 31•6 years ago
|
||
Attachment #8970347 -
Attachment is obsolete: true
Assignee | ||
Comment 32•6 years ago
|
||
Attachment #8970348 -
Attachment is obsolete: true
Assignee | ||
Comment 33•6 years ago
|
||
Attachment #8970349 -
Attachment is obsolete: true
Assignee | ||
Comment 34•6 years ago
|
||
Attachment #8970354 -
Attachment is obsolete: true
Assignee | ||
Comment 35•6 years ago
|
||
Attachment #8970636 -
Attachment is obsolete: true
Assignee | ||
Comment 36•6 years ago
|
||
Attachment #8970637 -
Attachment is obsolete: true
Assignee | ||
Comment 37•6 years ago
|
||
Attachment #8970638 -
Attachment is obsolete: true
Assignee | ||
Comment 38•6 years ago
|
||
Attachment #8970639 -
Attachment is obsolete: true
Assignee | ||
Comment 39•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b77074f6a441b1d4f2a9e032439baf2fd78e9743
Attachment #8970641 -
Attachment is obsolete: true
Assignee | ||
Comment 40•6 years ago
|
||
Comment on attachment 8970992 [details] [diff] [review] P1 Make ServiceWorkerRegistration::Inner::Unregister() use MozPromise. r=baku Andrea, this makes ServiceWorkerRegistration::Unregister() use a MozPromise similar to the previous patches for Update().
Attachment #8970992 -
Flags: review?(amarchesini)
Assignee | ||
Comment 41•6 years ago
|
||
Comment on attachment 8970993 [details] [diff] [review] P2 Remove ServiceWorkerRegistration::Inner::GetPushManager(). r=baku This moves the code to get the PushManager out of the Inner and just does it in the binding layer.
Attachment #8970993 -
Flags: review?(amarchesini)
Assignee | ||
Comment 42•6 years ago
|
||
Comment on attachment 8971008 [details] [diff] [review] P3 Remove ServiceWorkerRegistration::Inner::ShowNotification(). r=baku This moves the logic for ShowNotification out of the inner and does it in the binding layer. One tricky bit here was that there is a check for active worker. We can only do this on the main thread for window right now because we have not exposed ServiceWorker objects on worker threads yet.
Attachment #8971008 -
Flags: review?(amarchesini)
Assignee | ||
Comment 43•6 years ago
|
||
Comment on attachment 8971010 [details] [diff] [review] P4 Remove ServiceWorkerRegistration::Inner::GetNotifications(). r=baku This moves GetNotification() logic out of inner and back to the binding layer.
Attachment #8971010 -
Flags: review?(amarchesini)
Assignee | ||
Comment 44•6 years ago
|
||
Comment on attachment 8971013 [details] [diff] [review] P5 Remove unused ErrorResult argument from ServiceWorkerRegistration::Inner::Update(). r=baku This removes an unused variable from Update(). All errors reject the returned MozPromise, so we don't need to pass ErrorResult.
Attachment #8971013 -
Flags: review?(amarchesini)
Updated•6 years ago
|
Attachment #8970992 -
Flags: review?(amarchesini) → review+
Updated•6 years ago
|
Attachment #8970993 -
Flags: review?(amarchesini) → review+
Updated•6 years ago
|
Attachment #8971008 -
Flags: review?(amarchesini) → review+
Updated•6 years ago
|
Attachment #8971010 -
Flags: review?(amarchesini) → review+
Updated•6 years ago
|
Attachment #8971013 -
Flags: review?(amarchesini) → review+
Comment 45•6 years ago
|
||
Pushed by bkelly@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/cd48fe9eb3dd P1 Make ServiceWorkerRegistration::Inner::Unregister() use MozPromise. r=baku https://hg.mozilla.org/integration/mozilla-inbound/rev/8f25c38c4fd6 P2 Remove ServiceWorkerRegistration::Inner::GetPushManager(). r=baku https://hg.mozilla.org/integration/mozilla-inbound/rev/c21114e606e2 P3 Remove ServiceWorkerRegistration::Inner::ShowNotification(). r=baku https://hg.mozilla.org/integration/mozilla-inbound/rev/b31ab5129bfc P4 Remove ServiceWorkerRegistration::Inner::GetNotifications(). r=baku https://hg.mozilla.org/integration/mozilla-inbound/rev/d28c827d1e85 P5 Remove unused ErrorResult argument from ServiceWorkerRegistration::Inner::Update(). r=baku
Comment 46•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cd48fe9eb3dd https://hg.mozilla.org/mozilla-central/rev/8f25c38c4fd6 https://hg.mozilla.org/mozilla-central/rev/c21114e606e2 https://hg.mozilla.org/mozilla-central/rev/b31ab5129bfc https://hg.mozilla.org/mozilla-central/rev/d28c827d1e85
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•