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

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

Issue 203393002: Revert of Explicit notification and removal of lifecycle observers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/WorkerThread.cpp » ('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 0b4146921bf7a3f778860dceddc44005e00f9b4f..1699766d3f6631ec4627747717212073bf0bc3d1 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -93,6 +93,9 @@
WorkerGlobalScope::~WorkerGlobalScope()
{
+#if !ENABLE(OILPAN)
+ dispose();
+#endif
}
void WorkerGlobalScope::applyContentSecurityPolicyFromString(const String& policy, ContentSecurityPolicyHeaderType contentSecurityPolicyType)
@@ -193,21 +196,18 @@
{
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);
- // Observers must not access the context of a disposed WorkerGlobalScope
- // lacking a thread object.
- //
- // Notify them now that the context has been destroyed and explicitly remove
- // them as observers. If this is delayed until the LifecycleNotifier of the
- // WorkerGlobalScope is garbage collected and destructed, some observers
- // may have access to the disposed object (it all depends on the order
- // the garbage collector finalizes these objects.) Prevent that situation from
- // arising here.
- removeAllLifecycleObservers();
- clearThread();
+ // 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)
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698