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

Unified Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h

Issue 1448353002: Oilpan: move ServiceWorkerGlobalScopeProxy to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: assert for clean detachment Created 5 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698