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

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

Issue 2620463002: Show service worker navigation preload requests in DevTools Network tab (Closed)
Patch Set: fix crash Created 3 years, 11 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/dom/ExecutionContextTask.h" 8 #include "core/dom/ExecutionContextTask.h"
9 #include "core/frame/csp/ContentSecurityPolicy.h" 9 #include "core/frame/csp/ContentSecurityPolicy.h"
10 #include "core/inspector/ConsoleMessage.h" 10 #include "core/inspector/ConsoleMessage.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 CSPHeaderAndType headerAndType("contentSecurityPolicy", 139 CSPHeaderAndType headerAndType("contentSecurityPolicy",
140 ContentSecurityPolicyHeaderTypeReport); 140 ContentSecurityPolicyHeaderTypeReport);
141 headers->push_back(headerAndType); 141 headers->push_back(headerAndType);
142 142
143 WorkerClients* clients = nullptr; 143 WorkerClients* clients = nullptr;
144 144
145 start(WorkerThreadStartupData::create( 145 start(WorkerThreadStartupData::create(
146 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", source, 146 KURL(ParsedURLString, "http://fake.url/"), "fake user agent", source,
147 nullptr, DontPauseWorkerGlobalScopeOnStart, headers.get(), "", 147 nullptr, DontPauseWorkerGlobalScopeOnStart, headers.get(), "",
148 securityOrigin, clients, WebAddressSpaceLocal, nullptr, nullptr, 148 securityOrigin, clients, WebAddressSpaceLocal, nullptr, nullptr,
149 WorkerV8Settings::Default())); 149 WorkerV8Settings::Default(), false /* inspectorNetworkCapability */));
150 } 150 }
151 151
152 void waitForInit() { 152 void waitForInit() {
153 std::unique_ptr<WaitableEvent> completionEvent = 153 std::unique_ptr<WaitableEvent> completionEvent =
154 WTF::makeUnique<WaitableEvent>(); 154 WTF::makeUnique<WaitableEvent>();
155 workerBackingThread().backingThread().postTask( 155 workerBackingThread().backingThread().postTask(
156 BLINK_FROM_HERE, 156 BLINK_FROM_HERE,
157 crossThreadBind(&WaitableEvent::signal, 157 crossThreadBind(&WaitableEvent::signal,
158 crossThreadUnretained(completionEvent.get()))); 158 crossThreadUnretained(completionEvent.get())));
159 completionEvent->wait(); 159 completionEvent->wait();
(...skipping 30 matching lines...) Expand all
190 190
191 inline WorkerOrWorkletGlobalScope* WorkerThreadForTest::createWorkerGlobalScope( 191 inline WorkerOrWorkletGlobalScope* WorkerThreadForTest::createWorkerGlobalScope(
192 std::unique_ptr<WorkerThreadStartupData> startupData) { 192 std::unique_ptr<WorkerThreadStartupData> startupData) {
193 return new FakeWorkerGlobalScope( 193 return new FakeWorkerGlobalScope(
194 startupData->m_scriptURL, startupData->m_userAgent, this, 194 startupData->m_scriptURL, startupData->m_userAgent, this,
195 std::move(startupData->m_starterOriginPrivilegeData), 195 std::move(startupData->m_starterOriginPrivilegeData),
196 std::move(startupData->m_workerClients)); 196 std::move(startupData->m_workerClients));
197 } 197 }
198 198
199 } // namespace blink 199 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698