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

Side by Side Diff: third_party/WebKit/Source/modules/compositorworker/CompositorWorkerThreadTest.cpp

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
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 "modules/compositorworker/CompositorWorkerThread.h" 5 #include "modules/compositorworker/CompositorWorkerThread.h"
6 6
7 #include "bindings/core/v8/ScriptSourceCode.h" 7 #include "bindings/core/v8/ScriptSourceCode.h"
8 #include "bindings/core/v8/V8GCController.h" 8 #include "bindings/core/v8/V8GCController.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // This could be called on worker thread, but not in the test. 51 // This could be called on worker thread, but not in the test.
52 ASSERT(isMainThread()); 52 ASSERT(isMainThread());
53 CompositorWorkerThread::terminateV8Execution(); 53 CompositorWorkerThread::terminateV8Execution();
54 if (m_v8TerminationCallback) 54 if (m_v8TerminationCallback)
55 (*m_v8TerminationCallback)(); 55 (*m_v8TerminationCallback)();
56 } 56 }
57 57
58 void willDestroyIsolate() override 58 void willDestroyIsolate() override
59 { 59 {
60 v8::Isolate::GetCurrent()->RequestGarbageCollectionForTesting(v8::Isolat e::kFullGarbageCollection); 60 v8::Isolate::GetCurrent()->RequestGarbageCollectionForTesting(v8::Isolat e::kFullGarbageCollection);
61 Heap::collectAllGarbage(); 61 ThreadHeap::collectAllGarbage();
62 CompositorWorkerThread::willDestroyIsolate(); 62 CompositorWorkerThread::willDestroyIsolate();
63 } 63 }
64 64
65 WaitableEvent* m_startEvent; 65 WaitableEvent* m_startEvent;
66 OwnPtr<Function<void()>> m_v8TerminationCallback; 66 OwnPtr<Function<void()>> m_v8TerminationCallback;
67 }; 67 };
68 68
69 // A null WorkerObjectProxy, supplied when creating CompositorWorkerThreads. 69 // A null WorkerObjectProxy, supplied when creating CompositorWorkerThreads.
70 class TestCompositorWorkerObjectProxy : public WorkerObjectProxy { 70 class TestCompositorWorkerObjectProxy : public WorkerObjectProxy {
71 public: 71 public:
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 v8::Isolate* secondIsolate = secondWorker->isolate(); 296 v8::Isolate* secondIsolate = secondWorker->isolate();
297 ASSERT(secondIsolate); 297 ASSERT(secondIsolate);
298 EXPECT_EQ(firstIsolate, secondIsolate); 298 EXPECT_EQ(firstIsolate, secondIsolate);
299 299
300 // Verify that the isolate can run some scripts correctly in the second work er. 300 // Verify that the isolate can run some scripts correctly in the second work er.
301 checkWorkerCanExecuteScript(secondWorker.get()); 301 checkWorkerCanExecuteScript(secondWorker.get());
302 secondWorker->terminateAndWait(); 302 secondWorker->terminateAndWait();
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698