Last Comment Bug 776140 - Add GetExtendedOrigin method to nsILoadContext
: Add GetExtendedOrigin method to nsILoadContext
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: General (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla17
Assigned To: Jason Duell [:jduell] (needinfo me)
:
:
Mentors:
Depends on: 779123
Blocks: 776176 780818
  Show dependency treegraph
 
Reported: 2012-07-20 15:18 PDT by Jason Duell [:jduell] (needinfo me)
Modified: 2012-08-06 22:16 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (3.95 KB, patch)
2012-07-20 15:18 PDT, Jason Duell [:jduell] (needinfo me)
no flags Details | Diff | Splinter Review
v2: pass URI instead of channel (3.95 KB, patch)
2012-07-20 17:20 PDT, Jason Duell [:jduell] (needinfo me)
no flags Details | Diff | Splinter Review
v3: forgot to run qref (3.86 KB, patch)
2012-07-20 17:24 PDT, Jason Duell [:jduell] (needinfo me)
justin.lebar+bug: review+
jonas: superreview+
Details | Diff | Splinter Review

Description Jason Duell [:jduell] (needinfo me) 2012-07-20 15:18:39 PDT
Created attachment 644498 [details] [diff] [review]
v1

Jonas suggests we make it easy for channels on the parent to get the ExtendedOrigin while keeping the code centralized.  I saw 3 ways of doing it

1) Having nsNetUtil (or other necko code) call into nsScriptSecurityManager::GetExtendedOrigin.   But necko doesn't currently know about nsScriptSecurityManager, and biesi is not happy about changing that.

2) moving the logic from nsScriptSecurityManager::GetExtendedOrigin to nsNetUtil.h.  Mounir is opposed on the principle that this is security code, not necko logic.  And there are some nsScriptSecurityManager constants that the method uses, so we'd still have to include nsScriptSecurityManager.h, or dupe the constant definitions.

3) Adding a GetExtendedOrigin method to nsILoadContext (it can't be an attribute, as it needs to take a Channel/URI for the origin). We've already got the infrastructure to send nsILoadContext fields across IPDL to the parent (to this will be another string across the wire).  Biesi seems to prefer this. And that's what this patch does.  (minus the IPDL parts--that patch would be a separate bug)
Comment 1 Jason Duell [:jduell] (needinfo me) 2012-07-20 17:20:45 PDT
Created attachment 644535 [details] [diff] [review]
v2: pass URI instead of channel

Turns out nsIWebSocket is not an nsIChannel, so this needs to take the URI directly.
Comment 2 Jason Duell [:jduell] (needinfo me) 2012-07-20 17:24:10 PDT
Created attachment 644536 [details] [diff] [review]
v3: forgot to run qref
Comment 3 Jason Duell [:jduell] (needinfo me) 2012-07-23 11:13:17 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/e7f9ffc61ef7
Comment 4 Ed Morley [:emorley] 2012-07-24 03:01:51 PDT
https://hg.mozilla.org/mozilla-central/rev/e7f9ffc61ef7

Note You need to log in before you can comment on or make changes to this bug.