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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h

Issue 1925583003: Replace AllowCrossThreadAccess() + non-GCed pointers with crossThreadUnretained() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_4
Patch Set: Rebase. Created 4 years, 5 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "bindings/core/v8/SourceLocation.h" 5 #include "bindings/core/v8/SourceLocation.h"
6 #include "bindings/core/v8/V8CacheOptions.h" 6 #include "bindings/core/v8/V8CacheOptions.h"
7 #include "bindings/core/v8/V8GCController.h" 7 #include "bindings/core/v8/V8GCController.h"
8 #include "core/frame/csp/ContentSecurityPolicy.h" 8 #include "core/frame/csp/ContentSecurityPolicy.h"
9 #include "core/inspector/ConsoleMessage.h" 9 #include "core/inspector/ConsoleMessage.h"
10 #include "core/workers/WorkerBackingThread.h" 10 #include "core/workers/WorkerBackingThread.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 securityOrigin, 124 securityOrigin,
125 clients, 125 clients,
126 WebAddressSpaceLocal, 126 WebAddressSpaceLocal,
127 nullptr, 127 nullptr,
128 V8CacheOptionsDefault)); 128 V8CacheOptionsDefault));
129 } 129 }
130 130
131 void waitForInit() 131 void waitForInit()
132 { 132 {
133 std::unique_ptr<WaitableEvent> completionEvent = wrapUnique(new Waitable Event()); 133 std::unique_ptr<WaitableEvent> completionEvent = wrapUnique(new Waitable Event());
134 workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSa feBind(&WaitableEvent::signal, AllowCrossThreadAccess(completionEvent.get()))); 134 workerBackingThread().backingThread().postTask(BLINK_FROM_HERE, threadSa feBind(&WaitableEvent::signal, crossThreadUnretained(completionEvent.get())));
135 completionEvent->wait(); 135 completionEvent->wait();
136 } 136 }
137 137
138 private: 138 private:
139 std::unique_ptr<WorkerBackingThread> m_workerBackingThread; 139 std::unique_ptr<WorkerBackingThread> m_workerBackingThread;
140 std::unique_ptr<WaitableEvent> m_scriptLoadedEvent; 140 std::unique_ptr<WaitableEvent> m_scriptLoadedEvent;
141 }; 141 };
142 142
143 class FakeWorkerGlobalScope : public WorkerGlobalScope { 143 class FakeWorkerGlobalScope : public WorkerGlobalScope {
144 public: 144 public:
(...skipping 25 matching lines...) Expand all
170 private: 170 private:
171 WorkerThreadForTest* m_thread; 171 WorkerThreadForTest* m_thread;
172 }; 172 };
173 173
174 inline WorkerGlobalScope* WorkerThreadForTest::createWorkerGlobalScope(std::uniq ue_ptr<WorkerThreadStartupData> startupData) 174 inline WorkerGlobalScope* WorkerThreadForTest::createWorkerGlobalScope(std::uniq ue_ptr<WorkerThreadStartupData> startupData)
175 { 175 {
176 return new FakeWorkerGlobalScope(startupData->m_scriptURL, startupData->m_us erAgent, this, std::move(startupData->m_starterOriginPrivilegeData), std::move(s tartupData->m_workerClients)); 176 return new FakeWorkerGlobalScope(startupData->m_scriptURL, startupData->m_us erAgent, this, std::move(startupData->m_starterOriginPrivilegeData), std::move(s tartupData->m_workerClients));
177 } 177 }
178 178
179 } // namespace blink 179 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698