Last Comment Bug 781331 - Hook up systemXHR to permissions manager
: Hook up systemXHR to permissions manager
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: x86 Mac OS X
-- normal (vote)
: mozilla17
Assigned To: Gregor Wagner [:gwagner]
:
: Andrew Overholt [:overholt]
Mentors:
Depends on:
Blocks: 774716 749372 764618
  Show dependency treegraph
 
Reported: 2012-08-08 14:07 PDT by Gregor Wagner [:gwagner]
Modified: 2012-09-17 16:05 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+


Attachments
patch (1.70 KB, patch)
2012-08-08 14:37 PDT, Gregor Wagner [:gwagner]
no flags Details | Diff | Splinter Review
patch (1.64 KB, patch)
2012-08-08 14:40 PDT, Gregor Wagner [:gwagner]
no flags Details | Diff | Splinter Review
patch (4.77 KB, patch)
2012-08-08 17:47 PDT, Gregor Wagner [:gwagner]
jonas: review+
Details | Diff | Splinter Review

Description User image Gregor Wagner [:gwagner] 2012-08-08 14:07:26 PDT

    
Comment 1 User image Gregor Wagner [:gwagner] 2012-08-08 14:37:39 PDT
Created attachment 650320 [details] [diff] [review]
patch
Comment 2 User image Gregor Wagner [:gwagner] 2012-08-08 14:40:37 PDT
Created attachment 650324 [details] [diff] [review]
patch
Comment 3 User image Gregor Wagner [:gwagner] 2012-08-08 15:52:38 PDT
Comment on attachment 650324 [details] [diff] [review]
patch

Uh I also have to change some tests.
Comment 4 User image Philipp von Weitershausen [:philikon] 2012-08-08 17:01:01 PDT
(In reply to Gregor Wagner [:gwagner] from comment #3)
> Uh I also have to change some tests.

Yes you do. Also I'm pretty sure I'm not qualified to review this.
Comment 5 User image Gregor Wagner [:gwagner] 2012-08-08 17:47:39 PDT
Created attachment 650396 [details] [diff] [review]
patch
Comment 6 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2012-08-17 15:30:18 PDT
Comment on attachment 650396 [details] [diff] [review]
patch

Review of attachment 650396 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/src/nsXMLHttpRequest.cpp
@@ +581,5 @@
> +      return;
> +
> +    PRUint32 permission;
> +    nsresult rv =
> +      permMgr->TestPermissionFromPrincipal(principal, "systemXHR", &permission);

I think we should use the same permission as for raw TCP sockets here. I'm not sure if we decided a name for that, but something like "networktcp" or some such would work for me.

@@ +586,5 @@
> +    if (NS_FAILED(rv)) {
> +      return;
> +    }
> +
> +    if (permission != nsIPermissionManager::ALLOW_ACTION) {

Just merge these two if-statements.
Comment 8 User image Gregor Wagner [:gwagner] 2012-08-17 17:44:09 PDT
(In reply to Jonas Sicking (:sicking) from comment #6)
> Comment on attachment 650396 [details] [diff] [review]
> patch
> 
> Review of attachment 650396 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: content/base/src/nsXMLHttpRequest.cpp
> @@ +581,5 @@
> > +      return;
> > +
> > +    PRUint32 permission;
> > +    nsresult rv =
> > +      permMgr->TestPermissionFromPrincipal(principal, "systemXHR", &permission);
> 
> I think we should use the same permission as for raw TCP sockets here. I'm
> not sure if we decided a name for that, but something like "networktcp" or
> some such would work for me.

Followup bug 783716 because that needs gaia changes.
Comment 9 User image Ryan VanderMeulen [:RyanVM] 2012-08-18 04:26:34 PDT
https://hg.mozilla.org/mozilla-central/rev/07d5886658b2
Comment 10 User image Jim Porter (:squib) 2012-08-22 16:44:39 PDT
With this patch, what's the recommended way to enable systemXHR for testing purposes (on localhost)?

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