| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 ASSERT(m_workerThread->isCurrentThread()); | 279 ASSERT(m_workerThread->isCurrentThread()); |
| 280 | 280 |
| 281 ThreadableLoaderOptions options; | 281 ThreadableLoaderOptions options; |
| 282 options.crossOriginRequestPolicy = crossOriginRequestPolicy; | 282 options.crossOriginRequestPolicy = crossOriginRequestPolicy; |
| 283 ResourceLoaderOptions resourceLoaderOptions; | 283 ResourceLoaderOptions resourceLoaderOptions; |
| 284 | 284 |
| 285 // Ensure that WorkerThreadableLoader is created. | 285 // Ensure that WorkerThreadableLoader is created. |
| 286 // ThreadableLoader::create() determines whether it should create | 286 // ThreadableLoader::create() determines whether it should create |
| 287 // a DocumentThreadableLoader or WorkerThreadableLoader based on | 287 // a DocumentThreadableLoader or WorkerThreadableLoader based on |
| 288 // isWorkerGlobalScope(). | 288 // isWorkerGlobalScope(). |
| 289 ASSERT(m_workerThread->workerGlobalScope()->isWorkerGlobalScope()); | 289 DCHECK(m_workerThread->globalScope()->isWorkerGlobalScope()); |
| 290 | 290 |
| 291 m_loader = ThreadableLoader::create(*m_workerThread->workerGlobalScope()
, client, options, resourceLoaderOptions); | 291 m_loader = ThreadableLoader::create(*m_workerThread->globalScope(), clie
nt, options, resourceLoaderOptions); |
| 292 ASSERT(m_loader); | 292 ASSERT(m_loader); |
| 293 event->signal(); | 293 event->signal(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void workerStartLoader(WaitableEvent* event, std::unique_ptr<CrossThreadReso
urceRequestData> requestData) | 296 void workerStartLoader(WaitableEvent* event, std::unique_ptr<CrossThreadReso
urceRequestData> requestData) |
| 297 { | 297 { |
| 298 ASSERT(m_workerThread); | 298 ASSERT(m_workerThread); |
| 299 ASSERT(m_workerThread->isCurrentThread()); | 299 ASSERT(m_workerThread->isCurrentThread()); |
| 300 | 300 |
| 301 ResourceRequest request(requestData.get()); | 301 ResourceRequest request(requestData.get()); |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 EXPECT_CALL(*client(), didFailRedirectCheck()).WillOnce(InvokeWithoutArgs(th
is, &ThreadableLoaderTest::clearLoader)); | 846 EXPECT_CALL(*client(), didFailRedirectCheck()).WillOnce(InvokeWithoutArgs(th
is, &ThreadableLoaderTest::clearLoader)); |
| 847 | 847 |
| 848 startLoader(redirectLoopURL()); | 848 startLoader(redirectLoopURL()); |
| 849 callCheckpoint(2); | 849 callCheckpoint(2); |
| 850 serveRequests(); | 850 serveRequests(); |
| 851 } | 851 } |
| 852 | 852 |
| 853 } // namespace | 853 } // namespace |
| 854 | 854 |
| 855 } // namespace blink | 855 } // namespace blink |
| OLD | NEW |