| 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/ExecutionContextTask.h" | 7 #include "core/dom/ExecutionContextTask.h" |
| 8 #include "core/loader/DocumentThreadableLoader.h" | 8 #include "core/loader/DocumentThreadableLoader.h" |
| 9 #include "core/loader/ThreadableLoaderClient.h" | 9 #include "core/loader/ThreadableLoaderClient.h" |
| 10 #include "core/loader/WorkerThreadableLoader.h" | 10 #include "core/loader/WorkerThreadableLoader.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 std::unique_ptr<WTF::CrossThreadClosure> task) override { | 342 std::unique_ptr<WTF::CrossThreadClosure> task) override { |
| 343 DCHECK(m_workerThread); | 343 DCHECK(m_workerThread); |
| 344 m_workerThread->postTask(location, std::move(task)); | 344 m_workerThread->postTask(location, std::move(task)); |
| 345 } | 345 } |
| 346 | 346 |
| 347 RefPtr<SecurityOrigin> m_securityOrigin; | 347 RefPtr<SecurityOrigin> m_securityOrigin; |
| 348 std::unique_ptr<MockWorkerReportingProxy> m_mockWorkerReportingProxy; | 348 std::unique_ptr<MockWorkerReportingProxy> m_mockWorkerReportingProxy; |
| 349 std::unique_ptr<WorkerThreadForTest> m_workerThread; | 349 std::unique_ptr<WorkerThreadForTest> m_workerThread; |
| 350 | 350 |
| 351 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; | 351 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; |
| 352 Persistent<ParentFrameTaskRunners> m_parentFrameTaskRunners; | 352 // Accessed cross-thread when worker thread posts tasks to the parent. |
| 353 CrossThreadPersistent<ParentFrameTaskRunners> m_parentFrameTaskRunners; |
| 353 Checkpoint m_checkpoint; | 354 Checkpoint m_checkpoint; |
| 354 // |m_loader| must be touched only from the worker thread only. | 355 // |m_loader| must be touched only from the worker thread only. |
| 355 CrossThreadPersistent<ThreadableLoader> m_loader; | 356 CrossThreadPersistent<ThreadableLoader> m_loader; |
| 356 }; | 357 }; |
| 357 | 358 |
| 358 class ThreadableLoaderTest | 359 class ThreadableLoaderTest |
| 359 : public ::testing::TestWithParam<ThreadableLoaderToTest> { | 360 : public ::testing::TestWithParam<ThreadableLoaderToTest> { |
| 360 public: | 361 public: |
| 361 ThreadableLoaderTest() { | 362 ThreadableLoaderTest() { |
| 362 switch (GetParam()) { | 363 switch (GetParam()) { |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 // test is not saying that didFailAccessControlCheck should be dispatched | 884 // test is not saying that didFailAccessControlCheck should be dispatched |
| 884 // synchronously, but is saying that even when a response is served | 885 // synchronously, but is saying that even when a response is served |
| 885 // synchronously it should not lead to a crash. | 886 // synchronously it should not lead to a crash. |
| 886 startLoader(KURL(KURL(), "about:blank")); | 887 startLoader(KURL(KURL(), "about:blank")); |
| 887 callCheckpoint(2); | 888 callCheckpoint(2); |
| 888 } | 889 } |
| 889 | 890 |
| 890 } // namespace | 891 } // namespace |
| 891 | 892 |
| 892 } // namespace blink | 893 } // namespace blink |
| OLD | NEW |