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

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: One more fix Created 3 years, 12 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/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/WebFrameScheduler.h" 9 #include "platform/WebFrameScheduler.h"
10 #include "platform/WebTaskRunner.h" 10 #include "platform/WebTaskRunner.h"
(...skipping 14 matching lines...) Expand all
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::FileReading: 30 case TaskType::FileReading:
31 case TaskType::DatabaseAccess: 31 case TaskType::DatabaseAccess:
32 case TaskType::Presentation: 32 case TaskType::Presentation:
33 case TaskType::Sensor: 33 case TaskType::Sensor:
34 case TaskType::Timer: 34 case TaskType::Timer:
35 case TaskType::Internal: 35 case TaskType::UnspecedTimer:
36 case TaskType::Unspecified: 36 case TaskType::Unspecified:
37 return frame ? frame->frameScheduler()->timerTaskRunner() 37 return frame ? frame->frameScheduler()->timerTaskRunner()
38 : Platform::current()->currentThread()->getWebTaskRunner(); 38 : Platform::current()->currentThread()->getWebTaskRunner();
39 case TaskType::UnspecedLoading:
39 case TaskType::Networking: 40 case TaskType::Networking:
40 return frame ? frame->frameScheduler()->loadingTaskRunner() 41 return frame ? frame->frameScheduler()->loadingTaskRunner()
41 : Platform::current()->currentThread()->getWebTaskRunner(); 42 : Platform::current()->currentThread()->getWebTaskRunner();
42 case TaskType::Unthrottled: 43 case TaskType::Unthrottled:
43 return frame ? frame->frameScheduler()->unthrottledTaskRunner() 44 return frame ? frame->frameScheduler()->unthrottledTaskRunner()
44 : Platform::current()->currentThread()->getWebTaskRunner(); 45 : Platform::current()->currentThread()->getWebTaskRunner();
45 } 46 }
46 NOTREACHED(); 47 NOTREACHED();
47 return nullptr; 48 return nullptr;
48 } 49 }
49 50
50 WebTaskRunner* TaskRunnerHelper::get(TaskType type, Document* document) { 51 WebTaskRunner* TaskRunnerHelper::get(TaskType type, Document* document) {
51 return get(type, document ? document->frame() : nullptr); 52 return get(type, document ? document->frame() : nullptr);
52 } 53 }
53 54
54 WebTaskRunner* TaskRunnerHelper::get(TaskType type, 55 WebTaskRunner* TaskRunnerHelper::get(TaskType type,
55 ExecutionContext* executionContext) { 56 ExecutionContext* executionContext) {
56 return get(type, executionContext && executionContext->isDocument() 57 return get(type, executionContext && executionContext->isDocument()
57 ? static_cast<Document*>(executionContext) 58 ? static_cast<Document*>(executionContext)
58 : nullptr); 59 : nullptr);
59 } 60 }
60 61
61 WebTaskRunner* TaskRunnerHelper::get(TaskType type, ScriptState* scriptState) { 62 WebTaskRunner* TaskRunnerHelper::get(TaskType type, ScriptState* scriptState) {
62 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr); 63 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr);
63 } 64 }
64 65
65 } // namespace blink 66 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/TaskRunnerHelper.h ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698