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

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

Issue 1983783002: Remove OwnPtr::release() calls in modules/ (part 1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 "fake user agent", 103 "fake user agent",
104 "//fake source code", 104 "//fake source code",
105 nullptr, 105 nullptr,
106 DontPauseWorkerGlobalScopeOnStart, 106 DontPauseWorkerGlobalScopeOnStart,
107 nullptr, 107 nullptr,
108 m_securityOrigin.get(), 108 m_securityOrigin.get(),
109 clients, 109 clients,
110 WebAddressSpaceLocal, 110 WebAddressSpaceLocal,
111 nullptr, 111 nullptr,
112 V8CacheOptionsDefault)); 112 V8CacheOptionsDefault));
113 return workerThread.release(); 113 return workerThread;
114 } 114 }
115 115
116 // Attempts to run some simple script for |worker|. 116 // Attempts to run some simple script for |worker|.
117 void checkWorkerCanExecuteScript(WorkerThread* worker) 117 void checkWorkerCanExecuteScript(WorkerThread* worker)
118 { 118 {
119 OwnPtr<WaitableEvent> waitEvent = adoptPtr(new WaitableEvent()); 119 OwnPtr<WaitableEvent> waitEvent = adoptPtr(new WaitableEvent());
120 worker->workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&CompositorWorkerThreadTest::executeScriptInWorker, AllowCrossThr eadAccess(this), 120 worker->workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSafeBind(&CompositorWorkerThreadTest::executeScriptInWorker, AllowCrossThr eadAccess(this),
121 AllowCrossThreadAccess(worker), AllowCrossThreadAccess(waitEvent.get ()))); 121 AllowCrossThreadAccess(worker), AllowCrossThreadAccess(waitEvent.get ())));
122 waitEvent->wait(); 122 waitEvent->wait();
123 } 123 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 v8::Isolate* secondIsolate = secondWorker->isolate(); 219 v8::Isolate* secondIsolate = secondWorker->isolate();
220 ASSERT_TRUE(secondIsolate); 220 ASSERT_TRUE(secondIsolate);
221 EXPECT_EQ(firstIsolate, secondIsolate); 221 EXPECT_EQ(firstIsolate, secondIsolate);
222 222
223 // Verify that the isolate can run some scripts correctly in the second work er. 223 // Verify that the isolate can run some scripts correctly in the second work er.
224 checkWorkerCanExecuteScript(secondWorker.get()); 224 checkWorkerCanExecuteScript(secondWorker.get());
225 secondWorker->terminateAndWait(); 225 secondWorker->terminateAndWait();
226 } 226 }
227 227
228 } // namespace blink 228 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698