Closed
Bug 1205112
Opened 8 years ago
Closed 8 years ago
Make `PushEvent.data` nullable
Categories
(Core :: DOM: Push Notifications, defect)
Core
DOM: Push Notifications
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: lina, Assigned: lina)
References
Details
Attachments
(1 file)
This lets us distinguish messages without an entity body from encrypted, blank messages.
Assignee | ||
Comment 1•8 years ago
|
||
Bug 1205112 - Make `PushEvent.data` nullable. r?mt
Attachment #8661523 -
Flags: review?(martin.thomson)
Updated•8 years ago
|
Status: NEW → ASSIGNED
Comment 2•8 years ago
|
||
Comment on attachment 8661523 [details] MozReview Request: Bug 1205112 - Make `PushEvent.data` nullable. r?mt https://reviewboard.mozilla.org/r/19385/#review17423 ::: dom/webidl/PushEvent.webidl:14 (Diff revision 1) > - readonly attribute PushMessageData data; > + readonly attribute PushMessageData? data; Find yourself a DOM peer for this. ::: dom/workers/ServiceWorkerManager.cpp:2305 (Diff revision 1) > SendPushEventRunnable( > WorkerPrivate* aWorkerPrivate, > + nsMainThreadPtrHandle<ServiceWorker>& aServiceWorker) > + : WorkerRunnable(aWorkerPrivate, WorkerThreadModifyBusyCount) > + , mHasData(false) > + , mServiceWorker(aServiceWorker) Use a delegated constructor here. (Yes, I know that it means having yet another constructor, make it private.) ::: dom/workers/ServiceWorkerManager.cpp:2443 (Diff revision 1) > - new SendPushEventRunnable(serviceWorker->GetWorkerPrivate(), data, > + } else { > + r = new SendPushEventRunnable(serviceWorker->GetWorkerPrivate(), > - serviceWorkerHandle); > + serviceWorkerHandle); > + } Please add an assert on optional_argc == 0 here.
Attachment #8661523 -
Flags: review?(martin.thomson) → review+
Assignee | ||
Comment 3•8 years ago
|
||
Comment on attachment 8661523 [details] MozReview Request: Bug 1205112 - Make `PushEvent.data` nullable. r?mt Bug 1205112 - Make `PushEvent.data` nullable. r?mt
Assignee | ||
Comment 4•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=3304b18b01c6
Comment 6•8 years ago
|
||
The spec has non-nullable .data, and the spec seems to even define that if no data was passed, treat it as empty sequence of data. So, why we want this change?
Assignee | ||
Comment 7•8 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #6) > The spec has non-nullable .data, and the spec seems to even define that if > no data was passed, treat it as empty sequence of data. > So, why we want this change? Currently, a service worker can't distinguish between an authenticated blank message and a message without a payload. The latter could indicate a Simple Push-style "ping," or a signal that the data was stripped by the Push server. We're considering this for our server to cut down on storage for stale subscriptions. I opened https://github.com/w3c/push-api/issues/161 to track this; Martin put it on his list to write up.
Comment 8•8 years ago
|
||
This was agreed with Google a long while ago. But I'm slow. https://github.com/w3c/push-api/pull/166 awaits review from my co-editor.
Updated•8 years ago
|
Flags: needinfo?(bugs)
Attachment #8661523 -
Flags: review+
Assignee | ||
Comment 9•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5bf147cea14c
Assignee | ||
Comment 10•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9fafe1d5f32c636106e3adf3d9dd17e41779f7b0 Bug 1205112 - Make `PushEvent.data` nullable. r=mt,smaug
Comment 11•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/9fafe1d5f32c
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in
before you can comment on or make changes to this bug.
Description
•