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

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: Remove dead code Created 6 years, 10 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/core/workers/WorkerGlobalScope.cpp
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index a517c8704513d3fd0cbcb0632728b7eb664c560b..b9247270e47ba4bd931cc49470eaa94b216485a7 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -92,12 +92,7 @@ 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);
+ ASSERT(!m_thread);
}
void WorkerGlobalScope::applyContentSecurityPolicyFromString(const String& policy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
@@ -189,6 +184,19 @@ void WorkerGlobalScope::clearInspector()
m_workerInspectorController.clear();
}
+void WorkerGlobalScope::detach()
Mads Ager (chromium) 2014/02/26 10:22:40 I really like this restructuring, thanks! :)
+{
+ 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);
+ clearThread();
+}
+
void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState& exceptionState)
{
ASSERT(contentSecurityPolicy());
@@ -280,4 +288,11 @@ WorkerEventQueue* WorkerGlobalScope::eventQueue() const
return m_eventQueue.get();
}
+void WorkerGlobalScope::trace(Visitor* visitor)
Mads Ager (chromium) 2014/02/26 10:22:40 Don't we need an explicit call to WorkerSupplement
sof 2014/02/26 12:25:13 Yes, thank you. This is a major oversight when add
+{
+ visitor->trace(m_console);
+ visitor->trace(m_location);
+ visitor->trace(m_navigator);
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698