Index: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h |
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h |
index 7c90213ceeff3dff31c8b6f34ce009e17f9af8f0..f8a99d8e3ee946380d2651f945238e718d27ccff 100644 |
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h |
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h |
@@ -62,12 +62,13 @@ struct WebSyncRegistration; |
// workerThreadTerminated() is called by its corresponding |
// WorkerGlobalScope. |
class ServiceWorkerGlobalScopeProxy final |
- : public WebServiceWorkerContextProxy |
+ : public NoBaseWillBeGarbageCollectedFinalized<ServiceWorkerGlobalScopeProxy> |
+ , public WebServiceWorkerContextProxy |
, public WorkerReportingProxy { |
WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeProxy); |
- USING_FAST_MALLOC(ServiceWorkerGlobalScopeProxy); |
+ USING_FAST_MALLOC_WILL_BE_REMOVED(ServiceWorkerGlobalScopeProxy); |
public: |
- static PassOwnPtr<ServiceWorkerGlobalScopeProxy> create(WebEmbeddedWorkerImpl&, Document&, WebServiceWorkerContextClient&); |
+ static PassOwnPtrWillBeRawPtr<ServiceWorkerGlobalScopeProxy> create(WebEmbeddedWorkerImpl&, Document&, WebServiceWorkerContextClient&); |
~ServiceWorkerGlobalScopeProxy() override; |
// WebServiceWorkerContextProxy overrides: |
@@ -95,16 +96,31 @@ public: |
void willDestroyWorkerGlobalScope() override; |
void workerThreadTerminated() override; |
+ DECLARE_TRACE(); |
+ |
+ // Detach this proxy object entirely from the outside world, |
+ // clearing out all references. |
+ // |
+ // It is called during WebEmbeddedWorkerImpl finalization _after_ |
+ // the worker thread using the proxy has been terminated. |
+ void detach(); |
+ |
private: |
ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, Document&, WebServiceWorkerContextClient&); |
- WebEmbeddedWorkerImpl& m_embeddedWorker; |
- Document& m_document; |
+ WebServiceWorkerContextClient& client() const; |
+ Document& document() const; |
+ ServiceWorkerGlobalScope* workerGlobalScope() const; |
+ |
+ // Non-null until the WebEmbeddedWorkerImpl explicitly detach()es |
+ // as part of its finalization. |
+ WebEmbeddedWorkerImpl* m_embeddedWorker; |
+ RawPtrWillBeMember<Document> m_document; |
KURL m_documentURL; |
- WebServiceWorkerContextClient& m_client; |
+ WebServiceWorkerContextClient* m_client; |
- ServiceWorkerGlobalScope* m_workerGlobalScope; |
+ RawPtrWillBeMember<ServiceWorkerGlobalScope> m_workerGlobalScope; |
}; |
} // namespace blink |