Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1736)

Unified Diff: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp

Issue 478693005: Oilpan: Ship Oilpan for serviceworkers/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
index 05143bed93162240915e36493db5e78a3465c3dc..c3189614eb82c3c784cce646ee413ad08cb466aa 100644
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp
@@ -16,6 +16,7 @@
#include "modules/EventTargetModules.h"
#include "modules/serviceworkers/ServiceWorkerContainerClient.h"
#include "modules/serviceworkers/ServiceWorkerError.h"
+#include "platform/serviceworkers/ServiceWorkerRegistrationProxy.h"
#include "public/platform/WebServiceWorkerProvider.h"
namespace blink {
@@ -95,10 +96,10 @@ void ServiceWorkerRegistration::setActive(WebServiceWorker* serviceWorker)
m_active = ServiceWorker::from(executionContext(), serviceWorker);
}
-PassRefPtrWillBeRawPtr<ServiceWorkerRegistration> ServiceWorkerRegistration::take(ScriptPromiseResolver* resolver, WebType* registration)
+ServiceWorkerRegistration* ServiceWorkerRegistration::take(ScriptPromiseResolver* resolver, WebType* registration)
{
if (!registration)
- return nullptr;
+ return 0;
return getOrCreate(resolver->scriptState()->executionContext(), registration);
}
@@ -138,28 +139,28 @@ ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState)
return promise;
}
-PassRefPtrWillBeRawPtr<ServiceWorkerRegistration> ServiceWorkerRegistration::getOrCreate(ExecutionContext* executionContext, WebServiceWorkerRegistration* outerRegistration)
+ServiceWorkerRegistration* ServiceWorkerRegistration::getOrCreate(ExecutionContext* executionContext, WebServiceWorkerRegistration* outerRegistration)
{
if (!outerRegistration)
- return nullptr;
+ return 0;
WebServiceWorkerRegistrationProxy* proxy = outerRegistration->proxy();
if (proxy) {
- ServiceWorkerRegistration* existingRegistration = *proxy;
- if (existingRegistration) {
- ASSERT(existingRegistration->executionContext() == executionContext);
- return existingRegistration;
+ ServiceWorkerRegistrationProxy* existingRegistrationProxy = *proxy;
+ if (existingRegistrationProxy) {
+ ASSERT(existingRegistrationProxy->registration()->executionContext() == executionContext);
+ return existingRegistrationProxy->registration();
}
}
- RefPtrWillBeRawPtr<ServiceWorkerRegistration> registration = adoptRefWillBeNoop(new ServiceWorkerRegistration(executionContext, adoptPtr(outerRegistration)));
+ ServiceWorkerRegistration* registration = adoptRefCountedGarbageCollectedWillBeNoop(new ServiceWorkerRegistration(executionContext, adoptPtr(outerRegistration)));
registration->suspendIfNeeded();
- return registration.release();
+ return registration;
}
ServiceWorkerRegistration::ServiceWorkerRegistration(ExecutionContext* executionContext, PassOwnPtr<WebServiceWorkerRegistration> outerRegistration)
: ActiveDOMObject(executionContext)
- , WebServiceWorkerRegistrationProxy(this)
+ , WebServiceWorkerRegistrationProxy(ServiceWorkerRegistrationProxy::create(this))
, m_outerRegistration(outerRegistration)
, m_provider(0)
, m_stopped(false)

Powered by Google App Engine
This is Rietveld 408576698