Closed Bug 1279481 Opened 10 years ago Closed 10 years ago

Convert mozJSComponentLoader.cpp to use channel->Open2()

Categories

(Core :: DOM: Security, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: ckerschb, Assigned: ckerschb)

References

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 file, 2 obsolete files)

Assignee: nobody → ckerschb
Blocks: 1182535
Status: NEW → ASSIGNED
Whiteboard: [domsecurity-active]
(In reply to Christoph Kerschbaumer [:ckerschb] from comment #1) > https://treeherder.mozilla.org/#/jobs?repo=try&revision=8ecdf29fc113 oops - that was for a different bug!
Jonas, when trying to remove open from nsiChannel.idl (Bug 1279429) I realized we haven't converted that callsite to use asyncOpen2.
Attachment #8762025 - Flags: review?(jonas)
Comment on attachment 8762025 [details] [diff] [review] bug_1279481_convert_mozjscomponentloader_open2.patch Hey Bobby, Jonas is on PTO; any chance you could greenlight that small change? We use similar patterns elsewhere in the codebase where we are not sure whether we can actually open the channel using .open2(). Thanks!
Attachment #8762025 - Flags: review?(jonas) → review?(bobbyholley)
Comment on attachment 8762025 [details] [diff] [review] bug_1279481_convert_mozjscomponentloader_open2.patch Review of attachment 8762025 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/xpconnect/loader/mozJSComponentLoader.cpp @@ +835,5 @@ > rv = aInfo.EnsureScriptChannel(); > NS_ENSURE_SUCCESS(rv, rv); > nsCOMPtr<nsIInputStream> scriptStream; > + nsCOMPtr<nsILoadInfo> loadInfo = aInfo.ScriptChannel()->GetLoadInfo(); > + if (loadInfo && loadInfo->GetSecurityMode()) { Please do != 0 or something to indicate that this doesn't return a Boolean. Though actually, could you just factor all this into a helper somewhere with profuse commenting explaining why this is the right thing?
Attachment #8762025 - Flags: review?(bobbyholley)
(In reply to Bobby Holley (busy) from comment #5) > > + if (loadInfo && loadInfo->GetSecurityMode()) { > > Please do != 0 or something to indicate that this doesn't return a Boolean. Hey Bobby, we are already using this pattern in lots of places. To make it more explicit what we are doing, I added != 0. > Though actually, could you just factor all this into a helper somewhere with > profuse commenting explaining why this is the right thing? In fact all this branchy code will go away sooner or later. At this point I would rather not refactor all of that since it will disappear soon. Does that sound acceptable?
Attachment #8762025 - Attachment is obsolete: true
Attachment #8765539 - Flags: review?(bobbyholley)
Comment on attachment 8765539 [details] [diff] [review] bug_1279481_convert_mozjscomponentloader_open2.patch As discussed over IRC, we are going to put the branchy code into a helper within nsContentUtils.
Attachment #8765539 - Flags: review?(bobbyholley)
Depends on: 1282554
Bobby, within Bug 1282554 I created a helper function which we can use for converting this callsite to rely on Open2().
Attachment #8765539 - Attachment is obsolete: true
Attachment #8765848 - Flags: review?(bobbyholley)
Attachment #8765848 - Flags: review?(bobbyholley) → review+
Pushed by mozilla@christophkerschbaumer.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/b2bda3d70086 Convert mozJSComponentLoader.cpp to use channel->Open2() r=bholley
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: