Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp

Issue 2806623004: Worker: Introduce per-global-scope task scheduler (Closed)
Patch Set: remove unnecessary comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 DCHECK(worker_thread_); 326 DCHECK(worker_thread_);
326 DCHECK(worker_thread_->IsCurrentThread()); 327 DCHECK(worker_thread_->IsCurrentThread());
327 parent_frame_task_runners_->Get(TaskType::kNetworking) 328 parent_frame_task_runners_->Get(TaskType::kNetworking)
328 ->PostTask(BLINK_FROM_HERE, std::move(task)); 329 ->PostTask(BLINK_FROM_HERE, std::move(task));
329 } 330 }
330 331
331 void PostTaskToWorkerGlobalScope( 332 void PostTaskToWorkerGlobalScope(
332 const WebTraceLocation& location, 333 const WebTraceLocation& location,
333 std::unique_ptr<WTF::CrossThreadClosure> task) override { 334 std::unique_ptr<WTF::CrossThreadClosure> task) override {
334 DCHECK(worker_thread_); 335 DCHECK(worker_thread_);
335 worker_thread_->PostTask(location, std::move(task)); 336 TaskRunnerHelper::Get(TaskType::kNetworking, worker_thread_.get())
337 ->PostTask(location, std::move(task));
336 } 338 }
337 339
338 ThreadableLoadingContext* GetThreadableLoadingContext() override { 340 ThreadableLoadingContext* GetThreadableLoadingContext() override {
339 return loading_context_.Get(); 341 return loading_context_.Get();
340 } 342 }
341 343
342 RefPtr<SecurityOrigin> security_origin_; 344 RefPtr<SecurityOrigin> security_origin_;
343 std::unique_ptr<WorkerReportingProxy> reporting_proxy_; 345 std::unique_ptr<WorkerReportingProxy> reporting_proxy_;
344 std::unique_ptr<WorkerThreadForTest> worker_thread_; 346 std::unique_ptr<WorkerThreadForTest> worker_thread_;
345 347
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 // test is not saying that didFailAccessControlCheck should be dispatched 883 // test is not saying that didFailAccessControlCheck should be dispatched
882 // synchronously, but is saying that even when a response is served 884 // synchronously, but is saying that even when a response is served
883 // synchronously it should not lead to a crash. 885 // synchronously it should not lead to a crash.
884 StartLoader(KURL(KURL(), "about:blank")); 886 StartLoader(KURL(KURL(), "about:blank"));
885 CallCheckpoint(2); 887 CallCheckpoint(2);
886 } 888 }
887 889
888 } // namespace 890 } // namespace
889 891
890 } // namespace blink 892 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698