UPDATE: 1002570-swc-props
authorNikhil Marathe <nsm.nikhil@gmail.com>
Fri, 11 Jul 2014 17:18:15 -0700
changeset 1101 8f8677c1e4ca608292c4ea5d6716a1535ea58c3c
parent 1100 9024986f644e8f58a51839019775f2fc2f0af1ac
child 1102 2ea513e98ab245d479e6b4a2bf6a6e3fbe85b8b8
push id32
push usernsm.nikhil@gmail.com
push dateThu, 24 Jul 2014 00:32:46 +0000
bugs1002570
UPDATE: 1002570-swc-props dom/workers/ServiceWorkerManager.cpp | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) qparent: f0b558b85933 qtip: 2b2cb0c672dd top: 1002570-swc-props
1002570-swc-props
--- a/1002570-swc-props
+++ b/1002570-swc-props
@@ -431,17 +431,17 @@ diff --git a/dom/workers/ServiceWorkerMa
  
    // FIXME(nsm): Actually update state of active ServiceWorker instances to
    // installed.
    // FIXME(nsm): Fire statechange on the instances.
  
    // FIXME(nsm): Handle replace().
  
    if (!aRegistration->IsControllingDocuments()) {
-@@ -1461,16 +1468,96 @@ ServiceWorkerManager::FireEventOnService
+@@ -1461,16 +1468,92 @@ ServiceWorkerManager::FireEventOnService
  
        event->SetTrusted(true);
        target->DispatchDOMEvent(nullptr, event, nullptr, nullptr);
      }
    }
  }
  
  NS_IMETHODIMP
@@ -456,25 +456,21 @@ diff --git a/dom/workers/ServiceWorkerMa
 +
 +  nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
 +
 +  ServiceWorkerDomainInfo* domainInfo = GetDomainInfo(doc);
 +  if (!domainInfo) {
 +    return NS_ERROR_FAILURE;
 +  }
 +
-+  AutoServiceWorkerRegistrationCounter* counter;
-+  if (!domainInfo->mControlledDocuments.Get(doc, &counter)) {
++  nsRefPtr<ServiceWorkerRegistration> registration;
++  if (!domainInfo->mControlledDocuments.Get(doc, getter_AddRefs(registration))) {
 +    return NS_ERROR_FAILURE;
 +  }
 +
-+  nsRefPtr<ServiceWorkerRegistration> registration =
-+    counter->GetRegistration();
-+  MOZ_ASSERT(registration);
-+
 +  nsRefPtr<ServiceWorkerInfo> info;
 +  if (aWhichWorker == INSTALLING_WORKER) {
 +    info = registration->mInstallingWorker;
 +  } else if (aWhichWorker == WAITING_WORKER) {
 +    info = registration->mWaitingWorker;
 +  } else if (aWhichWorker == ACTIVE_WORKER) {
 +    info = registration->mCurrentWorker;
 +  } else {
@@ -528,17 +524,17 @@ diff --git a/dom/workers/ServiceWorkerMa
  ServiceWorkerManager::CreateServiceWorker(const nsACString& aScriptSpec,
                                            const nsACString& aScope,
                                            ServiceWorker** aServiceWorker)
  {
    AssertIsOnMainThread();
  
    WorkerPrivate::LoadInfo info;
    nsresult rv = NS_NewURI(getter_AddRefs(info.mBaseURI), aScriptSpec, nullptr, nullptr);
-@@ -1508,9 +1595,39 @@ ServiceWorkerManager::CreateServiceWorke
+@@ -1508,9 +1591,39 @@ ServiceWorkerManager::CreateServiceWorke
    if (NS_WARN_IF(NS_FAILED(rv))) {
      return rv;
    }
  
    serviceWorker.forget(aServiceWorker);
    return NS_OK;
  }