Closed
Bug 1269436
Opened 8 years ago
Closed 8 years ago
Always pass the principal to push observer notifications
Categories
(Core :: DOM: Push Subscriptions, defect)
Core
DOM: Push Subscriptions
Tracking
()
RESOLVED
FIXED
mozilla49
Tracking | Status | |
---|---|---|
firefox49 | --- | fixed |
People
(Reporter: lina, Assigned: lina)
References
Details
(Whiteboard: btpp-active)
Attachments
(1 file, 1 obsolete file)
31.66 KB,
patch
|
lina
:
review+
|
Details | Diff | Splinter Review |
It occurred to me that we don't pass the subscription principal to any of the push observers. I suspect this might be an issue when we eventually start using origin attributes (like `userContextId`). "push-subscription-change" and "push-subscription-refresh" don't currently have a subject, so we can pass the principal directly to them. "push-message" takes an optional nsIPushMessage; for that case, I think we'll want to change nsIPushMessage to a wrapper, and pass the actual data as an attribute. JS callers need to null-check and QI to nsIPushMessage, anyway, so I don't think this makes things any more complicated.
Attachment #8747828 -
Flags: review?(dd.mozilla)
Assignee | ||
Updated•8 years ago
|
Whiteboard: btpp-active
Comment 1•8 years ago
|
||
Comment on attachment 8747828 [details] [diff] [review] pushObserverPrincipals.patch Review of attachment 8747828 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/push/PushNotifier.cpp @@ +472,5 @@ > +PushMessage::GetPrincipal(nsIPrincipal** aPrincipal) > +{ > + if (!aPrincipal) { > + return NS_ERROR_INVALID_ARG; > + } we could use NS_ENSURE_ARG_POINTER here?
Attachment #8747828 -
Flags: review?(dd.mozilla) → review+
Assignee | ||
Comment 2•8 years ago
|
||
(In reply to Dragana Damjanovic [:dragana] from comment #1) > we could use NS_ENSURE_ARG_POINTER here? Good call, thanks! Added NS_ENSURE_ARG{_POINTER} to the other methods, too. Carrying r+ forward. I had to rename "nsIPushMessageData" to "nsIPushData," since it conflicts with the refcount tracing for the WebIDL interface: https://treeherder.mozilla.org/logviewer.html#?job_id=20274692&repo=try It's also shorter. :-)
Assignee | ||
Comment 3•8 years ago
|
||
Attachment #8747828 -
Attachment is obsolete: true
Attachment #8748120 -
Flags: review+
Assignee | ||
Comment 4•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d25c07e2f368
Comment 6•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/aaa6c0e38d61
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in
before you can comment on or make changes to this bug.
Description
•