| 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, std::unique_ptr<CrossThreadReso
urceRequestData> requestData) | 279 void workerStartLoader(WaitableEvent* event, std::unique_ptr<CrossThreadReso
urceRequestData> 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 EXPECT_CALL(*client(), didFailRedirectCheck()).WillOnce(InvokeWithoutArgs(th
is, &ThreadableLoaderTest::clearLoader)); | 831 EXPECT_CALL(*client(), didFailRedirectCheck()).WillOnce(InvokeWithoutArgs(th
is, &ThreadableLoaderTest::clearLoader)); |
| 832 | 832 |
| 833 startLoader(redirectLoopURL()); | 833 startLoader(redirectLoopURL()); |
| 834 callCheckpoint(2); | 834 callCheckpoint(2); |
| 835 serveRequests(); | 835 serveRequests(); |
| 836 } | 836 } |
| 837 | 837 |
| 838 } // namespace | 838 } // namespace |
| 839 | 839 |
| 840 } // namespace blink | 840 } // namespace blink |
| OLD | NEW |