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

Side by Side Diff: Source/modules/compositorworker/CompositorWorkerManagerTest.cpp

Issue 1312583007: Introduce WorkerThread::willShutdown() Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/workers/WorkerThreadTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "modules/compositorworker/CompositorWorkerManager.h" 6 #include "modules/compositorworker/CompositorWorkerManager.h"
7 7
8 #include "bindings/core/v8/ScriptSourceCode.h" 8 #include "bindings/core/v8/ScriptSourceCode.h"
9 #include "core/inspector/ConsoleMessage.h" 9 #include "core/inspector/ConsoleMessage.h"
10 #include "core/testing/DummyPageHolder.h" 10 #include "core/testing/DummyPageHolder.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void didStartRunLoop() override 44 void didStartRunLoop() override
45 { 45 {
46 m_startEvent->signal(); 46 m_startEvent->signal();
47 } 47 }
48 void terminateV8Execution() override 48 void terminateV8Execution() override
49 { 49 {
50 CompositorWorkerThread::terminateV8Execution(); 50 CompositorWorkerThread::terminateV8Execution();
51 if (m_v8TerminationCallback) 51 if (m_v8TerminationCallback)
52 (*m_v8TerminationCallback)(); 52 (*m_v8TerminationCallback)();
53 } 53 }
54 void willDestroyIsolate() override 54 void willShutdown() override
55 { 55 {
56 v8::Isolate::GetCurrent()->RequestGarbageCollectionForTesting(v8::Isolat e::kFullGarbageCollection); 56 v8::Isolate::GetCurrent()->RequestGarbageCollectionForTesting(v8::Isolat e::kFullGarbageCollection);
57 Heap::collectAllGarbage(); 57 Heap::collectAllGarbage();
58 CompositorWorkerThread::willDestroyIsolate(); 58 CompositorWorkerThread::willShutdown();
59 } 59 }
60 60
61 WebWaitableEvent* m_startEvent; 61 WebWaitableEvent* m_startEvent;
62 OwnPtr<Function<void()>> m_v8TerminationCallback; 62 OwnPtr<Function<void()>> m_v8TerminationCallback;
63 }; 63 };
64 64
65 // A null WorkerObjectProxy, supplied when creating CompositorWorkerThreads. 65 // A null WorkerObjectProxy, supplied when creating CompositorWorkerThreads.
66 class TestCompositorWorkerObjectProxy : public WorkerObjectProxy { 66 class TestCompositorWorkerObjectProxy : public WorkerObjectProxy {
67 public: 67 public:
68 static PassOwnPtr<TestCompositorWorkerObjectProxy> create(ExecutionContext* context) 68 static PassOwnPtr<TestCompositorWorkerObjectProxy> create(ExecutionContext* context)
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 v8::Isolate* secondIsolate = secondWorker->isolate(); 265 v8::Isolate* secondIsolate = secondWorker->isolate();
266 ASSERT(secondIsolate); 266 ASSERT(secondIsolate);
267 EXPECT_EQ(firstIsolate, secondIsolate); 267 EXPECT_EQ(firstIsolate, secondIsolate);
268 268
269 // Verify that the isolate can run some scripts correctly in the second work er. 269 // Verify that the isolate can run some scripts correctly in the second work er.
270 checkWorkerCanExecuteScript(secondWorker.get()); 270 checkWorkerCanExecuteScript(secondWorker.get());
271 secondWorker->terminateAndWait(); 271 secondWorker->terminateAndWait();
272 } 272 }
273 273
274 } // namespace blink 274 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerThreadTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698