Bug 1222097 - Resolve the openWindow URL using the service worker URL as the base URL. r=bkelly, a=ritu
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Fri, 06 Nov 2015 08:39:00 +0100
changeset 305477 86a326cd514626d8ec7b603cddae345da95f298e
parent 305476 d35eb3ac914be5e51e8b336cecb06eca5d90144c
child 305478 b83e637429b054767c9c5b6ae5054b45ee7b5d05
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly, ritu
bugs1222097
milestone44.0a2
Bug 1222097 - Resolve the openWindow URL using the service worker URL as the base URL. r=bkelly, a=ritu
dom/workers/ServiceWorkerClients.cpp
--- a/dom/workers/ServiceWorkerClients.cpp
+++ b/dom/workers/ServiceWorkerClients.cpp
@@ -419,17 +419,17 @@ public:
     if (NS_SUCCEEDED(rv)) {
       MOZ_ASSERT(window);
 
       WorkerPrivate* workerPrivate = mPromiseProxy->GetWorkerPrivate();
       MOZ_ASSERT(workerPrivate);
 
       WorkerPrivate::LocationInfo& info = workerPrivate->GetLocationInfo();
       nsCOMPtr<nsIURI> baseURI;
-      nsresult rv = NS_NewURI(getter_AddRefs(baseURI), info.mOrigin);
+      nsresult rv = NS_NewURI(getter_AddRefs(baseURI), info.mHref);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return NS_ERROR_FAILURE;
       }
 
       nsCOMPtr<nsIDocShell> docShell = window->GetDocShell();
       nsCOMPtr<nsIWebProgress> webProgress = do_GetInterface(docShell);
 
       if (!webProgress) {
@@ -479,17 +479,17 @@ private:
     WorkerPrivate* workerPrivate = mPromiseProxy->GetWorkerPrivate();
 
     // [[1. Let url be the result of parsing url with entry settings object's API
     //   base URL.]]
     nsCOMPtr<nsIURI> uri;
     WorkerPrivate::LocationInfo& info = workerPrivate->GetLocationInfo();
 
     nsCOMPtr<nsIURI> baseURI;
-    nsresult rv = NS_NewURI(getter_AddRefs(baseURI), info.mOrigin);
+    nsresult rv = NS_NewURI(getter_AddRefs(baseURI), info.mHref);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return NS_ERROR_TYPE_ERR;
     }
 
     rv = NS_NewURI(getter_AddRefs(uri), mUrl, nullptr, baseURI);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return NS_ERROR_TYPE_ERR;
     }