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

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

Issue 2810423003: Schedule bitmap animation timers on the compositor task runner. (Closed)
Patch Set: fix up comment about a method changed by blink reformat Created 3 years, 7 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/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/workers/WorkerOrWorkletGlobalScope.h" 10 #include "core/workers/WorkerOrWorkletGlobalScope.h"
(...skipping 16 matching lines...) Expand all
27 return frame ? frame->FrameScheduler()->LoadingTaskRunner() 27 return frame ? frame->FrameScheduler()->LoadingTaskRunner()
28 : Platform::Current()->CurrentThread()->GetWebTaskRunner(); 28 : Platform::Current()->CurrentThread()->GetWebTaskRunner();
29 // Throttling following tasks may break existing web pages, so tentatively 29 // Throttling following tasks may break existing web pages, so tentatively
30 // these are unthrottled. 30 // these are unthrottled.
31 // TODO(nhiroki): Throttle them again after we're convinced that it's safe 31 // TODO(nhiroki): Throttle them again after we're convinced that it's safe
32 // or provide a mechanism that web pages can opt-out it if throttling is not 32 // or provide a mechanism that web pages can opt-out it if throttling is not
33 // desirable. 33 // desirable.
34 case TaskType::kDatabaseAccess: 34 case TaskType::kDatabaseAccess:
35 return frame ? frame->FrameScheduler()->SuspendableTaskRunner() 35 return frame ? frame->FrameScheduler()->SuspendableTaskRunner()
36 : Platform::Current()->CurrentThread()->GetWebTaskRunner(); 36 : Platform::Current()->CurrentThread()->GetWebTaskRunner();
37 case TaskType::kAnimationTimer:
38 return frame ? frame->FrameScheduler()->CompositorTaskRunner()
39 : Platform::Current()->CurrentThread()->GetWebTaskRunner();
37 case TaskType::kDOMManipulation: 40 case TaskType::kDOMManipulation:
38 case TaskType::kUserInteraction: 41 case TaskType::kUserInteraction:
39 case TaskType::kHistoryTraversal: 42 case TaskType::kHistoryTraversal:
40 case TaskType::kEmbed: 43 case TaskType::kEmbed:
41 case TaskType::kMediaElementEvent: 44 case TaskType::kMediaElementEvent:
42 case TaskType::kCanvasBlobSerialization: 45 case TaskType::kCanvasBlobSerialization:
43 case TaskType::kRemoteEvent: 46 case TaskType::kRemoteEvent:
44 case TaskType::kWebSocket: 47 case TaskType::kWebSocket:
45 case TaskType::kMicrotask: 48 case TaskType::kMicrotask:
46 case TaskType::kPostedMessage: 49 case TaskType::kPostedMessage:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 case TaskType::kUnshippedPortMessage: 112 case TaskType::kUnshippedPortMessage:
110 case TaskType::kFileReading: 113 case TaskType::kFileReading:
111 case TaskType::kDatabaseAccess: 114 case TaskType::kDatabaseAccess:
112 case TaskType::kPresentation: 115 case TaskType::kPresentation:
113 case TaskType::kSensor: 116 case TaskType::kSensor:
114 case TaskType::kPerformanceTimeline: 117 case TaskType::kPerformanceTimeline:
115 case TaskType::kWebGL: 118 case TaskType::kWebGL:
116 case TaskType::kMiscPlatformAPI: 119 case TaskType::kMiscPlatformAPI:
117 case TaskType::kUnspecedTimer: 120 case TaskType::kUnspecedTimer:
118 case TaskType::kUnspecedLoading: 121 case TaskType::kUnspecedLoading:
122 case TaskType::kAnimationTimer:
119 case TaskType::kUnthrottled: 123 case TaskType::kUnthrottled:
120 // UnthrottledTaskRunner is generally discouraged in future. 124 // UnthrottledTaskRunner is generally discouraged in future.
121 // TODO(nhiroki): Identify which tasks can be throttled / suspendable and 125 // TODO(nhiroki): Identify which tasks can be throttled / suspendable and
122 // move them into other task runners. See also comments in 126 // move them into other task runners. See also comments in
123 // Get(LocalFrame). (https://crbug.com/670534) 127 // Get(LocalFrame). (https://crbug.com/670534)
124 return worker_thread->GetGlobalScopeScheduler()->UnthrottledTaskRunner(); 128 return worker_thread->GetGlobalScopeScheduler()->UnthrottledTaskRunner();
125 } 129 }
126 NOTREACHED(); 130 NOTREACHED();
127 return nullptr; 131 return nullptr;
128 } 132 }
129 133
130 } // namespace blink 134 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698