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

Unified Diff: Source/bindings/v8/WorkerScriptController.cpp

Issue 218953002: Oilpan: IDBCursor should be detached from IDBRequest when the IDBRequest stops (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/WorkerScriptController.cpp
diff --git a/Source/bindings/v8/WorkerScriptController.cpp b/Source/bindings/v8/WorkerScriptController.cpp
index 6127764871bf72ad64238da0085237b601cbcfd7..0c2174258e179ade3199248f68cd5c0764bd2bdc 100644
--- a/Source/bindings/v8/WorkerScriptController.cpp
+++ b/Source/bindings/v8/WorkerScriptController.cpp
@@ -102,9 +102,20 @@ WorkerScriptController::~WorkerScriptController()
m_world->dispose();
- // The corresponding call to didStartWorkerRunLoop is in
- // WorkerThread::workerThread().
- // See http://webkit.org/b/83104#c14 for why this is here.
+ // We need to collect all dead DOM objects before calling didStopWorkerRunLoop(),
+ // because destructors of some DOM objects touch Chromium-side objects
+ // which are destroyed in didStopWorkerRunLoop(). For example, ~IDBRequest() touches
+ // IndexedDBDispatcher which is destroyed in didStopWorkerRunLoop().
+ //
+ // Things should happen in the following order:
+ // (1) Heap::collectAllGarbage()
+ // (2) didStopWorkerRunLoop()
+ // (3) ThreadState::detach()
zerny-chromium 2014/03/31 06:33:10 This also does a full GC. Do we need this both bef
Mads Ager (chromium) 2014/03/31 08:56:53 So, we definitely need the detach call and we have
+ // (4) Isolate destruction
+ // See http://webkit.org/b/83104#c14 for more details.
+ Heap::collectAllGarbage(ThreadState::NoHeapPointersOnStack);
+
+ // The corresponding call to didStartWorkerRunLoop is in WorkerThread::workerThread().
blink::Platform::current()->didStopWorkerRunLoop(blink::WebWorkerRunLoop(&m_workerGlobalScope.thread()->runLoop()));
disposeContext();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698