Closed
Bug 804495
Opened 12 years ago
Closed 12 years ago
Allow nsGlobalWindow to support GetInterface(nsILoadContext)
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: jduell.mcbugs, Assigned: jduell.mcbugs)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
We already special-case a lot of interfaces, so this one seems ok too?
Otherwise we're starting to get code like the nsOfflineCacheUpdateService.cpp case here.
Patch applied over that for bug 794663
Attachment #674145 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 1•12 years ago
|
||
now with actual code changes!
Attachment #674145 -
Attachment is obsolete: true
Attachment #674145 -
Flags: review?(bzbarsky)
Attachment #674149 -
Flags: review?(bzbarsky)
Comment 2•12 years ago
|
||
Comment on attachment 674149 [details] [diff] [review]
v1 for realz
Review of attachment 674149 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/base/nsGlobalWindow.cpp
@@ +8596,5 @@
> + if (mDocShell) {
> + nsCOMPtr<nsILoadContext> loadContext(do_QueryInterface(mDocShell));
> + if (loadContext) {
> + *aSink = loadContext;
> + NS_ADDREF(((nsISupports *) *aSink));
Make this loadContext.forget(aSink);
Comment 3•12 years ago
|
||
Comment on attachment 674149 [details] [diff] [review]
v1 for realz
r=me with ms2ger's nit. Note that if you do it that way, you don't have to null-check either mDocShell or loadContext. So you can do it like so:
FORWARD_TO_OUTER(GetInterface, (aIID, aSink), NS_ERROR_NOT_INITIALIZED);
nsCOMPtr<nsILoadContext> loadContext(do_QueryInterface(mDocShell));
loadContext.forget(aSink);
Attachment #674149 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 4•12 years ago
|
||
Trivial update: I'm assuming if we want the style in comment 3, we might as well use it elsewhere in the function too. Not even sure this needs review, really...
Attachment #674149 -
Attachment is obsolete: true
Attachment #674982 -
Flags: review?(bzbarsky)
Comment 5•12 years ago
|
||
Comment on attachment 674982 [details] [diff] [review]
v2: use forget() convention in rest of GetInterface
r=me
Attachment #674982 -
Flags: review?(bzbarsky) → review+
Comment 6•12 years ago
|
||
I have a vague memory of seeing a patch with some awkward code because it had a window and wanted a load context. If only I could remember where it was...
Assignee | ||
Comment 7•12 years ago
|
||
Comment 8•12 years ago
|
||
Assignee: nobody → jduell.mcbugs
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•