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

Side by Side Diff: third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp

Issue 2556993005: [blink] Split TaskType::Internal into InternalTimer and InternalLoading. (Closed)
Patch Set: addressed skyostil@'s comments Created 4 years 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/dom/TaskRunnerHelper.h" 5 #include "core/dom/TaskRunnerHelper.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "platform/WebTaskRunner.h" 9 #include "platform/WebTaskRunner.h"
10 #include "public/platform/Platform.h" 10 #include "public/platform/Platform.h"
(...skipping 10 matching lines...) Expand all
21 case TaskType::HistoryTraversal: 21 case TaskType::HistoryTraversal:
22 case TaskType::Embed: 22 case TaskType::Embed:
23 case TaskType::MediaElementEvent: 23 case TaskType::MediaElementEvent:
24 case TaskType::CanvasBlobSerialization: 24 case TaskType::CanvasBlobSerialization:
25 case TaskType::RemoteEvent: 25 case TaskType::RemoteEvent:
26 case TaskType::WebSocket: 26 case TaskType::WebSocket:
27 case TaskType::Microtask: 27 case TaskType::Microtask:
28 case TaskType::PostedMessage: 28 case TaskType::PostedMessage:
29 case TaskType::UnshippedPortMessage: 29 case TaskType::UnshippedPortMessage:
30 case TaskType::Timer: 30 case TaskType::Timer:
31 case TaskType::Internal: 31 case TaskType::InternalTimer:
32 case TaskType::Unspecified: 32 case TaskType::Unspecified:
33 return frame ? frame->frameScheduler()->timerTaskRunner() 33 return frame ? frame->frameScheduler()->timerTaskRunner()
34 : Platform::current()->currentThread()->getWebTaskRunner(); 34 : Platform::current()->currentThread()->getWebTaskRunner();
35 case TaskType::InternalLoading:
35 case TaskType::Networking: 36 case TaskType::Networking:
36 return frame ? frame->frameScheduler()->loadingTaskRunner() 37 return frame ? frame->frameScheduler()->loadingTaskRunner()
37 : Platform::current()->currentThread()->getWebTaskRunner(); 38 : Platform::current()->currentThread()->getWebTaskRunner();
38 case TaskType::Unthrottled: 39 case TaskType::Unthrottled:
39 return frame ? frame->frameScheduler()->unthrottledTaskRunner() 40 return frame ? frame->frameScheduler()->unthrottledTaskRunner()
40 : Platform::current()->currentThread()->getWebTaskRunner(); 41 : Platform::current()->currentThread()->getWebTaskRunner();
41 } 42 }
42 NOTREACHED(); 43 NOTREACHED();
43 return nullptr; 44 return nullptr;
44 } 45 }
45 46
46 WebTaskRunner* TaskRunnerHelper::get(TaskType type, Document* document) { 47 WebTaskRunner* TaskRunnerHelper::get(TaskType type, Document* document) {
47 return get(type, document ? document->frame() : nullptr); 48 return get(type, document ? document->frame() : nullptr);
48 } 49 }
49 50
50 WebTaskRunner* TaskRunnerHelper::get(TaskType type, 51 WebTaskRunner* TaskRunnerHelper::get(TaskType type,
51 ExecutionContext* executionContext) { 52 ExecutionContext* executionContext) {
52 return get(type, executionContext && executionContext->isDocument() 53 return get(type, executionContext && executionContext->isDocument()
53 ? static_cast<Document*>(executionContext) 54 ? static_cast<Document*>(executionContext)
54 : nullptr); 55 : nullptr);
55 } 56 }
56 57
57 WebTaskRunner* TaskRunnerHelper::get(TaskType type, ScriptState* scriptState) { 58 WebTaskRunner* TaskRunnerHelper::get(TaskType type, ScriptState* scriptState) {
58 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr); 59 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr);
59 } 60 }
60 61
61 } // namespace blink 62 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698