| 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" | |
| 9 #include "core/loader/DocumentThreadableLoader.h" | 8 #include "core/loader/DocumentThreadableLoader.h" |
| 10 #include "core/loader/ThreadableLoaderClient.h" | 9 #include "core/loader/ThreadableLoaderClient.h" |
| 11 #include "core/loader/ThreadableLoadingContext.h" | 10 #include "core/loader/ThreadableLoadingContext.h" |
| 12 #include "core/loader/WorkerThreadableLoader.h" | 11 #include "core/loader/WorkerThreadableLoader.h" |
| 13 #include "core/testing/DummyPageHolder.h" | 12 #include "core/testing/DummyPageHolder.h" |
| 14 #include "core/workers/WorkerLoaderProxy.h" | 13 #include "core/workers/WorkerLoaderProxy.h" |
| 15 #include "core/workers/WorkerReportingProxy.h" | 14 #include "core/workers/WorkerReportingProxy.h" |
| 16 #include "core/workers/WorkerThreadTestHelper.h" | 15 #include "core/workers/WorkerThreadTestHelper.h" |
| 17 #include "platform/WaitableEvent.h" | 16 #include "platform/WaitableEvent.h" |
| 18 #include "platform/geometry/IntSize.h" | 17 #include "platform/geometry/IntSize.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 DCHECK(worker_thread_); | 325 DCHECK(worker_thread_); |
| 327 DCHECK(worker_thread_->IsCurrentThread()); | 326 DCHECK(worker_thread_->IsCurrentThread()); |
| 328 parent_frame_task_runners_->Get(TaskType::kNetworking) | 327 parent_frame_task_runners_->Get(TaskType::kNetworking) |
| 329 ->PostTask(BLINK_FROM_HERE, std::move(task)); | 328 ->PostTask(BLINK_FROM_HERE, std::move(task)); |
| 330 } | 329 } |
| 331 | 330 |
| 332 void PostTaskToWorkerGlobalScope( | 331 void PostTaskToWorkerGlobalScope( |
| 333 const WebTraceLocation& location, | 332 const WebTraceLocation& location, |
| 334 std::unique_ptr<WTF::CrossThreadClosure> task) override { | 333 std::unique_ptr<WTF::CrossThreadClosure> task) override { |
| 335 DCHECK(worker_thread_); | 334 DCHECK(worker_thread_); |
| 336 TaskRunnerHelper::Get(TaskType::kNetworking, worker_thread_.get()) | 335 worker_thread_->PostTask(location, std::move(task)); |
| 337 ->PostTask(location, std::move(task)); | |
| 338 } | 336 } |
| 339 | 337 |
| 340 ThreadableLoadingContext* GetThreadableLoadingContext() override { | 338 ThreadableLoadingContext* GetThreadableLoadingContext() override { |
| 341 return loading_context_.Get(); | 339 return loading_context_.Get(); |
| 342 } | 340 } |
| 343 | 341 |
| 344 RefPtr<SecurityOrigin> security_origin_; | 342 RefPtr<SecurityOrigin> security_origin_; |
| 345 std::unique_ptr<WorkerReportingProxy> reporting_proxy_; | 343 std::unique_ptr<WorkerReportingProxy> reporting_proxy_; |
| 346 std::unique_ptr<WorkerThreadForTest> worker_thread_; | 344 std::unique_ptr<WorkerThreadForTest> worker_thread_; |
| 347 | 345 |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 // test is not saying that didFailAccessControlCheck should be dispatched | 881 // test is not saying that didFailAccessControlCheck should be dispatched |
| 884 // synchronously, but is saying that even when a response is served | 882 // synchronously, but is saying that even when a response is served |
| 885 // synchronously it should not lead to a crash. | 883 // synchronously it should not lead to a crash. |
| 886 StartLoader(KURL(KURL(), "about:blank")); | 884 StartLoader(KURL(KURL(), "about:blank")); |
| 887 CallCheckpoint(2); | 885 CallCheckpoint(2); |
| 888 } | 886 } |
| 889 | 887 |
| 890 } // namespace | 888 } // namespace |
| 891 | 889 |
| 892 } // namespace blink | 890 } // namespace blink |
| OLD | NEW |