Bug 1137419 - Use correct principal for update. r=baku
authorNikhil Marathe <nsm.nikhil@gmail.com>
Mon, 23 Feb 2015 10:34:40 -0800
changeset 231948 41f36857b47e9125f2d601c8a8a18a377697c127
parent 231947 489a21a96e5d629510635968e7d72176dc6c24a1
child 231949 483a3749115b2a1f90470df4582c241851788899
push id28364
push usercbook@mozilla.com
push dateThu, 05 Mar 2015 14:12:01 +0000
treeherdermozilla-central@fa59461863f5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1137419
milestone39.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 1137419 - Use correct principal for update. r=baku
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -686,28 +686,20 @@ private:
 
     // FIXME(nsm): Plug in FetchDriver when it is ready.
     nsCOMPtr<nsIURI> uri;
     nsresult rv = NS_NewURI(getter_AddRefs(uri), mRegistration->mScriptSpec, nullptr, nullptr);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return Fail(rv);
     }
 
-    nsCOMPtr<nsIPrincipal> principal;
-    nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
-    rv = ssm->GetNoAppCodebasePrincipal(uri, getter_AddRefs(principal));
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return Fail(rv);
-    }
-
-
     nsCOMPtr<nsIChannel> channel;
     rv = NS_NewChannel(getter_AddRefs(channel),
                        uri,
-                       principal,
+                       mPrincipal,
                        nsILoadInfo::SEC_NORMAL,
                        nsIContentPolicy::TYPE_SCRIPT); // FIXME(nsm): TYPE_SERVICEWORKER
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return Fail(rv);
     }
     // FIXME(nsm): Set redirect limit.
 
     // Don't let serviceworker intercept.