Backed out changeset 066e84750afd for landing with the wrong bug number.
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 31 Aug 2015 18:36:48 -0400
changeset 260235 a416aa3b1ab5f6e7635746d634af43715225bbc1
parent 260234 8f626f6be974d9f4800fbc8332c0af4109c7bdd1
child 260236 daf3c7087ab24e2216a266ea804f0bbf0b9f052c
push id29304
push usercbook@mozilla.com
push dateTue, 01 Sep 2015 12:32:25 +0000
treeherdermozilla-central@dd509db16a13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone43.0a1
backs out066e84750afdc77c760c1b6563cf932e1f283b11
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
Backed out changeset 066e84750afd for landing with the wrong bug number.
dom/fetch/ChannelInfo.cpp
dom/fetch/ChannelInfo.h
dom/fetch/Response.cpp
--- a/dom/fetch/ChannelInfo.cpp
+++ b/dom/fetch/ChannelInfo.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/ChannelInfo.h"
 #include "nsCOMPtr.h"
-#include "nsContentUtils.h"
 #include "nsIChannel.h"
 #include "nsIDocument.h"
 #include "nsIHttpChannel.h"
 #include "nsSerializationHelper.h"
 #include "mozilla/net/HttpBaseChannel.h"
 #include "mozilla/ipc/ChannelInfo.h"
 #include "nsIJARChannel.h"
 #include "nsJARChannel.h"
@@ -65,30 +64,16 @@ ChannelInfo::InitFromChannel(nsIChannel*
       redirectedURI->GetSpec(mRedirectedURISpec);
     }
   }
 
   mInited = true;
 }
 
 void
-ChannelInfo::InitFromChromeGlobal(nsIGlobalObject* aGlobal)
-{
-  MOZ_ASSERT(!mInited, "Cannot initialize the object twice");
-  MOZ_ASSERT(aGlobal);
-
-  MOZ_RELEASE_ASSERT(
-    nsContentUtils::IsSystemPrincipal(aGlobal->PrincipalOrNull()));
-
-  mSecurityInfo.Truncate();
-  mRedirected = false;
-  mInited = true;
-}
-
-void
 ChannelInfo::InitFromIPCChannelInfo(const ipc::IPCChannelInfo& aChannelInfo)
 {
   MOZ_ASSERT(!mInited, "Cannot initialize the object twice");
 
   mSecurityInfo = aChannelInfo.securityInfo();
   mRedirectedURISpec = aChannelInfo.redirectedURI();
   mRedirected = aChannelInfo.redirected();
 
--- a/dom/fetch/ChannelInfo.h
+++ b/dom/fetch/ChannelInfo.h
@@ -7,17 +7,16 @@
 #ifndef mozilla_dom_ChannelInfo_h
 #define mozilla_dom_ChannelInfo_h
 
 #include "nsString.h"
 #include "nsCOMPtr.h"
 
 class nsIChannel;
 class nsIDocument;
-class nsIGlobalObject;
 class nsIURI;
 
 namespace mozilla {
 namespace ipc {
 class IPCChannelInfo;
 } // namespace ipc
 
 namespace dom {
@@ -65,17 +64,16 @@ public:
     mRedirectedURISpec = aRHS.mRedirectedURISpec;
     mInited = aRHS.mInited;
     mRedirected = aRHS.mRedirected;
     return *this;
   }
 
   void InitFromDocument(nsIDocument* aDoc);
   void InitFromChannel(nsIChannel* aChannel);
-  void InitFromChromeGlobal(nsIGlobalObject* aGlobal);
   void InitFromIPCChannelInfo(const IPCChannelInfo& aChannelInfo);
 
   // This restores every possible information stored from a previous channel
   // object on a new one.
   nsresult ResurrectInfoOnChannel(nsIChannel* aChannel);
 
   bool IsInitialized() const
   {
--- a/dom/fetch/Response.cpp
+++ b/dom/fetch/Response.cpp
@@ -157,25 +157,22 @@ Response::Constructor(const GlobalObject
   }
 
   nsRefPtr<InternalResponse> internalResponse =
     new InternalResponse(aInit.mStatus, statusText);
 
   // Grab a valid channel info from the global so this response is 'valid' for
   // interception.
   if (NS_IsMainThread()) {
+    nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(global);
+    MOZ_ASSERT(window);
+    nsIDocument* doc = window->GetExtantDoc();
+    MOZ_ASSERT(doc);
     ChannelInfo info;
-    nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(global);
-    if (window) {
-      nsIDocument* doc = window->GetExtantDoc();
-      MOZ_ASSERT(doc);
-      info.InitFromDocument(doc);
-    } else {
-      info.InitFromChromeGlobal(global);
-    }
+    info.InitFromDocument(doc);
     internalResponse->InitChannelInfo(info);
   } else {
     workers::WorkerPrivate* worker = workers::GetCurrentThreadWorkerPrivate();
     MOZ_ASSERT(worker);
     internalResponse->InitChannelInfo(worker->GetChannelInfo());
   }
 
   nsRefPtr<Response> r = new Response(global, internalResponse);