OLD | NEW |
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 "core/loader/ThreadableLoader.h" | 5 #include "core/loader/ThreadableLoader.h" |
6 | 6 |
7 #include "core/dom/CrossThreadTask.h" | 7 #include "core/dom/CrossThreadTask.h" |
8 #include "core/fetch/MemoryCache.h" | 8 #include "core/fetch/MemoryCache.h" |
9 #include "core/fetch/ResourceLoaderOptions.h" | 9 #include "core/fetch/ResourceLoaderOptions.h" |
10 #include "core/loader/DocumentThreadableLoader.h" | 10 #include "core/loader/DocumentThreadableLoader.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 ASSERT(m_workerThread->isCurrentThread()); | 262 ASSERT(m_workerThread->isCurrentThread()); |
263 | 263 |
264 ThreadableLoaderOptions options; | 264 ThreadableLoaderOptions options; |
265 options.crossOriginRequestPolicy = crossOriginRequestPolicy; | 265 options.crossOriginRequestPolicy = crossOriginRequestPolicy; |
266 ResourceLoaderOptions resourceLoaderOptions; | 266 ResourceLoaderOptions resourceLoaderOptions; |
267 | 267 |
268 // Ensure that WorkerThreadableLoader is created. | 268 // Ensure that WorkerThreadableLoader is created. |
269 // ThreadableLoader::create() determines whether it should create | 269 // ThreadableLoader::create() determines whether it should create |
270 // a DocumentThreadableLoader or WorkerThreadableLoader based on | 270 // a DocumentThreadableLoader or WorkerThreadableLoader based on |
271 // isWorkerGlobalScope(). | 271 // isWorkerGlobalScope(). |
272 ASSERT(m_workerThread->workerGlobalScope()->isWorkerGlobalScope()); | 272 DCHECK(m_workerThread->globalScope()->isWorkerGlobalScope()); |
273 | 273 |
274 m_loader = ThreadableLoader::create(*m_workerThread->workerGlobalScope()
, client, options, resourceLoaderOptions); | 274 m_loader = ThreadableLoader::create(*m_workerThread->globalScope(), clie
nt, options, resourceLoaderOptions); |
275 ASSERT(m_loader); | 275 ASSERT(m_loader); |
276 event->signal(); | 276 event->signal(); |
277 } | 277 } |
278 | 278 |
279 void workerStartLoader(WaitableEvent* event, PassOwnPtr<CrossThreadResourceR
equestData> requestData) | 279 void workerStartLoader(WaitableEvent* event, PassOwnPtr<CrossThreadResourceR
equestData> requestData) |
280 { | 280 { |
281 ASSERT(m_workerThread); | 281 ASSERT(m_workerThread); |
282 ASSERT(m_workerThread->isCurrentThread()); | 282 ASSERT(m_workerThread->isCurrentThread()); |
283 | 283 |
284 ResourceRequest request(requestData.get()); | 284 ResourceRequest request(requestData.get()); |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 EXPECT_CALL(*client(), didFailRedirectCheck()).WillOnce(InvokeWithoutArgs(th
is, &ThreadableLoaderTest::clearLoader)); | 833 EXPECT_CALL(*client(), didFailRedirectCheck()).WillOnce(InvokeWithoutArgs(th
is, &ThreadableLoaderTest::clearLoader)); |
834 | 834 |
835 startLoader(redirectLoopURL()); | 835 startLoader(redirectLoopURL()); |
836 callCheckpoint(2); | 836 callCheckpoint(2); |
837 serveRequests(); | 837 serveRequests(); |
838 } | 838 } |
839 | 839 |
840 } // namespace | 840 } // namespace |
841 | 841 |
842 } // namespace blink | 842 } // namespace blink |
OLD | NEW |