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

Unified Diff: Source/core/workers/WorkerGlobalScope.cpp

Issue 178663004: Oilpan: move WorkerGlobalScope to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 9 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
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/core/workers/WorkerGlobalScope.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerGlobalScope.cpp
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index d0f3064a5060c908f073f80a5992341dbbdd197d..98b2e8acb527b59722de1a5f6062336dc7414854 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -93,12 +93,9 @@ WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W
WorkerGlobalScope::~WorkerGlobalScope()
{
- ASSERT(thread()->isCurrentThread());
-
- // Notify proxy that we are going away. This can free the WorkerThread object, so do not access it after this.
- thread()->workerReportingProxy().workerGlobalScopeDestroyed();
-
- setClient(0);
+#if !ENABLE(OILPAN)
+ dispose();
+#endif
}
void WorkerGlobalScope::applyContentSecurityPolicyFromString(const String& policy, ContentSecurityPolicyHeaderType contentSecurityPolicyType)
@@ -190,6 +187,24 @@ void WorkerGlobalScope::clearInspector()
m_workerInspectorController.clear();
}
+void WorkerGlobalScope::dispose()
+{
+ ASSERT(thread()->isCurrentThread());
+
+ // Notify proxy that we are going away. This can free the WorkerThread object, so do not access it after this.
+ thread()->workerReportingProxy().workerGlobalScopeDestroyed();
+
+ clearScript();
+ clearInspector();
+ setClient(0);
+
+ // The thread reference isn't currently cleared, as the execution
+ // context's thread is accessed by GCed lifetime objects when
+ // they're finalized.
+ // FIXME: oilpan: avoid by explicitly removing the WorkerGlobalScope
+ // as an observable context right here.
+}
+
void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState& exceptionState)
{
ASSERT(contentSecurityPolicy());
@@ -281,4 +296,12 @@ WorkerEventQueue* WorkerGlobalScope::eventQueue() const
return m_eventQueue.get();
}
+void WorkerGlobalScope::trace(Visitor* visitor)
+{
+ visitor->trace(m_console);
+ visitor->trace(m_location);
+ visitor->trace(m_navigator);
+ WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/core/workers/WorkerGlobalScope.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698