Closed
Bug 1067468
Opened 10 years ago
Closed 10 years ago
Add newChannel2 to nsIAboutModule so we can attach a LoadInfo to the created channel
Categories
(Core :: DOM: Security, defect)
Core
DOM: Security
Tracking
()
RESOLVED
FIXED
mozilla36
People
(Reporter: ckerschb, Assigned: ckerschb)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-needed)
Attachments
(2 files, 2 obsolete files)
1.50 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
7.54 KB,
patch
|
ckerschb
:
review+
|
Details | Diff | Splinter Review |
We should add newChannel2() with the following interface to nsIAboutModule;
> nsIChannel newChannel2(in nsIURI aURI,
> in nsIDOMDocument aRequestingDocument,
> in nsIPrincipal aRequestingPrincipal,
> in unsigned long aSecurityFlags,
> in unsigned long aContentPolicyType);
Once that interface is landed we can start migrating consumers to use newChannel2() rather than newChannel() to create a channel.
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → mozilla
Assignee | ||
Comment 1•10 years ago
|
||
Similar to Bug 1067471, this patch just adds NewChannel2 and forwards all calls from newChannel to NewChannel2 using a nullptr-loadinfo.
Attachment #8498893 -
Flags: review?(jonas)
Comment on attachment 8498893 [details] [diff] [review] aboutmodule_newChannel2.patch Review of attachment 8498893 [details] [diff] [review]: ----------------------------------------------------------------- Is it really worth messing with nsIAboutModule at this point? We can add the loadinfo in nsAboutProtocolHandler::NewChannel2, and we can do security checks in nsAboutProtocolHandler::AsyncOpen2 without having to touch nsIAboutModule. The only advantage to adding newChannel2 to nsIAboutModule is that it would allow about modules inspect the loadinfo and change the behavior of newChannel in response to it. But we don't have the need for that yet. In order for any of this code to be used we'll also have to add code to nsAboutProtocolHandler to attempt to call nsIAboutModule.newChannel2, and then fall back to nsIAboutModule.newChannel as needed. And possibly add wrappers if we actually want the various about modules to take responsibility for doing security checks. Also, I think we can simply add another argument to nsIAboutModule.newChannel. No need to introduce a separate nsIAboutModule.newChannel2. JS implementations will simply ignore the extra argument. And we're not relying on them to do anything important anyway. In general, it seems simpler to land this stuff after we have more of the other plumbing in place IMHO. But up to you. But if so, don't add newChannel2.
Attachment #8498893 -
Flags: review?(jonas) → review-
Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Jonas Sicking (:sicking) from comment #2) > Comment on attachment 8498893 [details] [diff] [review] > aboutmodule_newChannel2.patch > > Review of attachment 8498893 [details] [diff] [review]: > ----------------------------------------------------------------- > > Is it really worth messing with nsIAboutModule at this point? We can add the > loadinfo in nsAboutProtocolHandler::NewChannel2, and we can do security > checks in nsAboutProtocolHandler::AsyncOpen2 without having to touch > nsIAboutModule. We could add the loadInfo in nsAboutProtocolHandler::NewChannel2, but since we are already having a ::NewChannel2 in nsAboutProtocolhandler, why not pass the loadInfo along to nsIAboutModule? The reason I prefer this design is that we (at some point, see bug 1087442) attach the loadInfo at creation time of a channel and immediately can inspect the loadinfo. > The only advantage to adding newChannel2 to nsIAboutModule is that it would > allow about modules inspect the loadinfo and change the behavior of > newChannel in response to it. But we don't have the need for that yet. Agreed, not yet, but soon :-) > Also, I think we can simply add another argument to > nsIAboutModule.newChannel. No need to introduce a separate > nsIAboutModule.newChannel2. JS implementations will simply ignore the extra > argument. And we're not relying on them to do anything important anyway. > > In general, it seems simpler to land this stuff after we have more of the > other plumbing in place IMHO. But up to you. But if so, don't add > newChannel2. Agreed, we can simply extend NewChannel with a loadInfo argument. Once that patch has landed, we can attach the loadInfo to the channel in bug 1087442.
Attachment #8498893 -
Attachment is obsolete: true
Attachment #8509693 -
Flags: review?(jonas)
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8509695 -
Flags: review?(jonas)
Attachment #8509693 -
Flags: review?(jonas) → review+
Attachment #8509695 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Carrying over r+. Just forgot to rev the uuid in the idl.
Attachment #8509693 -
Attachment is obsolete: true
Attachment #8509970 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/7497797d45c4 https://hg.mozilla.org/integration/mozilla-inbound/rev/69a8e45a9777
Target Milestone: --- → mozilla36
https://hg.mozilla.org/mozilla-central/rev/7497797d45c4 https://hg.mozilla.org/mozilla-central/rev/69a8e45a9777
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•