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 <memory> | 7 #include <memory> |
| 8 #include "core/dom/TaskRunnerHelper.h" |
8 #include "core/loader/DocumentThreadableLoader.h" | 9 #include "core/loader/DocumentThreadableLoader.h" |
9 #include "core/loader/ThreadableLoaderClient.h" | 10 #include "core/loader/ThreadableLoaderClient.h" |
10 #include "core/loader/ThreadableLoadingContext.h" | 11 #include "core/loader/ThreadableLoadingContext.h" |
11 #include "core/loader/WorkerThreadableLoader.h" | 12 #include "core/loader/WorkerThreadableLoader.h" |
12 #include "core/testing/DummyPageHolder.h" | 13 #include "core/testing/DummyPageHolder.h" |
13 #include "core/workers/WorkerLoaderProxy.h" | 14 #include "core/workers/WorkerLoaderProxy.h" |
14 #include "core/workers/WorkerReportingProxy.h" | 15 #include "core/workers/WorkerReportingProxy.h" |
15 #include "core/workers/WorkerThreadTestHelper.h" | 16 #include "core/workers/WorkerThreadTestHelper.h" |
16 #include "platform/WaitableEvent.h" | 17 #include "platform/WaitableEvent.h" |
17 #include "platform/geometry/IntSize.h" | 18 #include "platform/geometry/IntSize.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 DCHECK(m_workerThread); | 324 DCHECK(m_workerThread); |
324 DCHECK(m_workerThread->isCurrentThread()); | 325 DCHECK(m_workerThread->isCurrentThread()); |
325 m_parentFrameTaskRunners->get(TaskType::Networking) | 326 m_parentFrameTaskRunners->get(TaskType::Networking) |
326 ->postTask(BLINK_FROM_HERE, std::move(task)); | 327 ->postTask(BLINK_FROM_HERE, std::move(task)); |
327 } | 328 } |
328 | 329 |
329 void postTaskToWorkerGlobalScope( | 330 void postTaskToWorkerGlobalScope( |
330 const WebTraceLocation& location, | 331 const WebTraceLocation& location, |
331 std::unique_ptr<WTF::CrossThreadClosure> task) override { | 332 std::unique_ptr<WTF::CrossThreadClosure> task) override { |
332 DCHECK(m_workerThread); | 333 DCHECK(m_workerThread); |
333 m_workerThread->postTask(location, std::move(task)); | 334 TaskRunnerHelper::get(TaskType::Networking, m_workerThread.get()) |
| 335 ->postTask(location, std::move(task)); |
334 } | 336 } |
335 | 337 |
336 ThreadableLoadingContext* getThreadableLoadingContext() override { | 338 ThreadableLoadingContext* getThreadableLoadingContext() override { |
337 return m_loadingContext.get(); | 339 return m_loadingContext.get(); |
338 } | 340 } |
339 | 341 |
340 RefPtr<SecurityOrigin> m_securityOrigin; | 342 RefPtr<SecurityOrigin> m_securityOrigin; |
341 std::unique_ptr<WorkerReportingProxy> m_reportingProxy; | 343 std::unique_ptr<WorkerReportingProxy> m_reportingProxy; |
342 std::unique_ptr<WorkerThreadForTest> m_workerThread; | 344 std::unique_ptr<WorkerThreadForTest> m_workerThread; |
343 | 345 |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 // test is not saying that didFailAccessControlCheck should be dispatched | 881 // test is not saying that didFailAccessControlCheck should be dispatched |
880 // synchronously, but is saying that even when a response is served | 882 // synchronously, but is saying that even when a response is served |
881 // synchronously it should not lead to a crash. | 883 // synchronously it should not lead to a crash. |
882 startLoader(KURL(KURL(), "about:blank")); | 884 startLoader(KURL(KURL(), "about:blank")); |
883 callCheckpoint(2); | 885 callCheckpoint(2); |
884 } | 886 } |
885 | 887 |
886 } // namespace | 888 } // namespace |
887 | 889 |
888 } // namespace blink | 890 } // namespace blink |
OLD | NEW |