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

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

Issue 2754673002: [scheduler] Split suspendable tq from unthrottled tq. (Closed)
Patch Set: 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 case TaskType::Unthrottled: 50 case TaskType::Unthrottled:
Sami 2017/03/15 15:01:50 Can you leave a TODO here for making Unthrottled a
altimin 2017/03/15 15:10:14 I think that we're fine here. We have a todo to re
51 return frame ? frame->frameScheduler()->unthrottledTaskRunner() 51 return frame ? frame->frameScheduler()->suspendableTaskRunner()
52 : Platform::current()->currentThread()->getWebTaskRunner(); 52 : Platform::current()->currentThread()->getWebTaskRunner();
53 } 53 }
54 NOTREACHED(); 54 NOTREACHED();
55 return nullptr; 55 return nullptr;
56 } 56 }
57 57
58 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, Document* document) { 58 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, Document* document) {
59 return get(type, document ? document->frame() : nullptr); 59 return get(type, document ? document->frame() : nullptr);
60 } 60 }
61 61
62 RefPtr<WebTaskRunner> TaskRunnerHelper::get( 62 RefPtr<WebTaskRunner> TaskRunnerHelper::get(
63 TaskType type, 63 TaskType type,
64 ExecutionContext* executionContext) { 64 ExecutionContext* executionContext) {
65 return get(type, executionContext && executionContext->isDocument() 65 return get(type, executionContext && executionContext->isDocument()
66 ? static_cast<Document*>(executionContext) 66 ? static_cast<Document*>(executionContext)
67 : nullptr); 67 : nullptr);
68 } 68 }
69 69
70 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type, 70 RefPtr<WebTaskRunner> TaskRunnerHelper::get(TaskType type,
71 ScriptState* scriptState) { 71 ScriptState* scriptState) {
72 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr); 72 return get(type, scriptState ? scriptState->getExecutionContext() : nullptr);
73 } 73 }
74 74
75 } // namespace blink 75 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698