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

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

Issue 2754673002: [scheduler] Split suspendable tq from unthrottled tq. (Closed)
Patch Set: Unthrottled means unthrottled Created 3 years, 9 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 29 matching lines...) Expand all
40 case TaskType::PostedMessage: 40 case TaskType::PostedMessage:
41 case TaskType::UnshippedPortMessage: 41 case TaskType::UnshippedPortMessage:
42 case TaskType::FileReading: 42 case TaskType::FileReading:
43 case TaskType::DatabaseAccess: 43 case TaskType::DatabaseAccess:
44 case TaskType::Presentation: 44 case TaskType::Presentation:
45 case TaskType::Sensor: 45 case TaskType::Sensor:
46 case TaskType::PerformanceTimeline: 46 case TaskType::PerformanceTimeline:
47 case TaskType::WebGL: 47 case TaskType::WebGL:
48 case TaskType::UnspecedTimer: 48 case TaskType::UnspecedTimer:
49 case TaskType::MiscPlatformAPI: 49 case TaskType::MiscPlatformAPI:
50 return frame ? frame->frameScheduler()->suspendableTaskRunner()
51 : Platform::current()->currentThread()->getWebTaskRunner();
50 case TaskType::Unthrottled: 52 case TaskType::Unthrottled:
51 return frame ? frame->frameScheduler()->unthrottledTaskRunner() 53 return frame ? frame->frameScheduler()->unthrottledTaskRunner()
52 : Platform::current()->currentThread()->getWebTaskRunner(); 54 : Platform::current()->currentThread()->getWebTaskRunner();
53 } 55 }
54 NOTREACHED(); 56 NOTREACHED();
55 return nullptr; 57 return nullptr;
56 } 58 }
57 59
58 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, Document* document) { 60 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, Document* document) {
59 return get(type, document ? document->frame() : nullptr); 61 return get(type, document ? document->frame() : nullptr);
60 } 62 }
61 63
62 RefPtr<WebTaskRunner> TaskRunnerHelper::get( 64 RefPtr<WebTaskRunner> TaskRunnerHelper::get(
63 TaskType type, 65 TaskType type,
64 ExecutionContext* executionContext) { 66 ExecutionContext* executionContext) {
65 return get(type, executionContext && executionContext->isDocument() 67 return get(type, executionContext && executionContext->isDocument()
66 ? static_cast<Document*>(executionContext) 68 ? static_cast<Document*>(executionContext)
67 : nullptr); 69 : nullptr);
68 } 70 }
69 71
70 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, 72 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type,
71 ScriptState* scriptState) { 73 ScriptState* scriptState) {
72 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr); 74 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr);
73 } 75 }
74 76
75 } // namespace blink 77 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698