Bug 1124638 - Allow chrome to set Request context. r=baku
authorNikhil Marathe <nsm.nikhil@gmail.com>
Tue, 27 Jan 2015 16:02:12 -0800
changeset 227760 7fde8710208a926c614005a48a984a21af522367
parent 227759 ecd613d5d87ceb0983bd737e276fdab051cd1468
child 227761 5a065c4d610eda345b5b539b1b0e6cbf1aa90c64
push id28238
push userkwierso@gmail.com
push dateFri, 06 Feb 2015 00:55:16 +0000
treeherdermozilla-central@7c5f187b65bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1124638
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1124638 - Allow chrome to set Request context. r=baku
dom/fetch/Request.h
dom/webidl/Request.webidl
--- a/dom/fetch/Request.h
+++ b/dom/fetch/Request.h
@@ -76,16 +76,23 @@ public:
   }
 
   RequestContext
   Context() const
   {
     return mContext;
   }
 
+  // [ChromeOnly]
+  void
+  SetContext(RequestContext aContext)
+  {
+    mContext = aContext;
+  }
+
   void
   GetReferrer(nsAString& aReferrer) const
   {
     mRequest->GetReferrer(aReferrer);
   }
 
   InternalHeaders*
   GetInternalHeaders() const
--- a/dom/webidl/Request.webidl
+++ b/dom/webidl/Request.webidl
@@ -19,16 +19,20 @@ interface Request {
 
   readonly attribute RequestContext context;
   readonly attribute DOMString referrer;
   readonly attribute RequestMode mode;
   readonly attribute RequestCredentials credentials;
   readonly attribute RequestCache cache;
 
   [NewObject] Request clone();
+
+  // Bug 1124638 - Allow chrome callers to set the context.
+  [ChromeOnly]
+  void setContext(RequestContext context);
 };
 Request implements Body;
 
 dictionary RequestInit {
   ByteString method;
   HeadersInit headers;
   BodyInit body;
   RequestMode mode;