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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.cpp

Issue 2577053002: ActiveScriptWrappable: GC wrappers in detached ExecutionContexts. (Closed)
Patch Set: component build fix(msvc) Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/serviceworkers/ServiceWorkerRegistration.h" 5 #include "modules/serviceworkers/ServiceWorkerRegistration.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 m_handle->registration()->unregister( 125 m_handle->registration()->unregister(
126 client->provider(), 126 client->provider(),
127 WTF::makeUnique<CallbackPromiseAdapter<bool, ServiceWorkerError>>( 127 WTF::makeUnique<CallbackPromiseAdapter<bool, ServiceWorkerError>>(
128 resolver)); 128 resolver));
129 return promise; 129 return promise;
130 } 130 }
131 131
132 ServiceWorkerRegistration::ServiceWorkerRegistration( 132 ServiceWorkerRegistration::ServiceWorkerRegistration(
133 ExecutionContext* executionContext, 133 ExecutionContext* executionContext,
134 std::unique_ptr<WebServiceWorkerRegistration::Handle> handle) 134 std::unique_ptr<WebServiceWorkerRegistration::Handle> handle)
135 : ActiveScriptWrappable(this), 135 : ActiveScriptWrappable<ServiceWorkerRegistration>(this),
136 SuspendableObject(executionContext), 136 SuspendableObject(executionContext),
137 m_handle(std::move(handle)), 137 m_handle(std::move(handle)),
138 m_stopped(false) { 138 m_stopped(false) {
139 ASSERT(m_handle); 139 ASSERT(m_handle);
140 ASSERT(!m_handle->registration()->proxy()); 140 ASSERT(!m_handle->registration()->proxy());
141 141
142 if (!executionContext) 142 if (!executionContext)
143 return; 143 return;
144 m_handle->registration()->setProxy(this); 144 m_handle->registration()->setProxy(this);
145 } 145 }
(...skipping 17 matching lines...) Expand all
163 } 163 }
164 164
165 void ServiceWorkerRegistration::contextDestroyed() { 165 void ServiceWorkerRegistration::contextDestroyed() {
166 if (m_stopped) 166 if (m_stopped)
167 return; 167 return;
168 m_stopped = true; 168 m_stopped = true;
169 m_handle->registration()->proxyStopped(); 169 m_handle->registration()->proxyStopped();
170 } 170 }
171 171
172 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698