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

Side by Side Diff: third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp

Issue 2658583006: scheduler: Make DOM window event tasks unthrottled (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/SuspendableTimer.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "web/SuspendableScriptExecutor.h" 5 #include "web/SuspendableScriptExecutor.h"
6 6
7 #include "bindings/core/v8/ScriptController.h" 7 #include "bindings/core/v8/ScriptController.h"
8 #include "bindings/core/v8/ScriptSourceCode.h" 8 #include "bindings/core/v8/ScriptSourceCode.h"
9 #include "bindings/core/v8/V8PersistentValueVector.h" 9 #include "bindings/core/v8/V8PersistentValueVector.h"
10 #include "bindings/core/v8/WindowProxy.h" 10 #include "bindings/core/v8/WindowProxy.h"
11 #include "core/dom/Document.h" 11 #include "core/dom/Document.h"
12 #include "core/dom/DocumentUserGestureToken.h" 12 #include "core/dom/DocumentUserGestureToken.h"
13 #include "core/dom/TaskRunnerHelper.h"
13 #include "core/frame/LocalFrame.h" 14 #include "core/frame/LocalFrame.h"
14 #include "platform/UserGestureIndicator.h" 15 #include "platform/UserGestureIndicator.h"
15 #include "public/platform/WebVector.h" 16 #include "public/platform/WebVector.h"
16 #include "public/web/WebScriptExecutionCallback.h" 17 #include "public/web/WebScriptExecutionCallback.h"
17 #include "wtf/PtrUtil.h" 18 #include "wtf/PtrUtil.h"
18 #include "wtf/Vector.h" 19 #include "wtf/Vector.h"
19 #include <memory> 20 #include <memory>
20 21
21 namespace blink { 22 namespace blink {
22 23
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (m_callback) 172 if (m_callback)
172 m_callback->completed(Vector<v8::Local<v8::Value>>()); 173 m_callback->completed(Vector<v8::Local<v8::Value>>());
173 dispose(); 174 dispose();
174 } 175 }
175 176
176 SuspendableScriptExecutor::SuspendableScriptExecutor( 177 SuspendableScriptExecutor::SuspendableScriptExecutor(
177 LocalFrame* frame, 178 LocalFrame* frame,
178 ScriptState* scriptState, 179 ScriptState* scriptState,
179 WebScriptExecutionCallback* callback, 180 WebScriptExecutionCallback* callback,
180 Executor* executor) 181 Executor* executor)
181 : SuspendableTimer(frame->document()), 182 : SuspendableTimer(frame->document(), TaskType::Timer),
182 m_scriptState(scriptState), 183 m_scriptState(scriptState),
183 m_callback(callback), 184 m_callback(callback),
184 m_keepAlive(this), 185 m_keepAlive(this),
185 m_executor(executor) {} 186 m_executor(executor) {}
186 187
187 SuspendableScriptExecutor::~SuspendableScriptExecutor() {} 188 SuspendableScriptExecutor::~SuspendableScriptExecutor() {}
188 189
189 void SuspendableScriptExecutor::fired() { 190 void SuspendableScriptExecutor::fired() {
190 executeAndDestroySelf(); 191 executeAndDestroySelf();
191 } 192 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 m_keepAlive.clear(); 227 m_keepAlive.clear();
227 stop(); 228 stop();
228 } 229 }
229 230
230 DEFINE_TRACE(SuspendableScriptExecutor) { 231 DEFINE_TRACE(SuspendableScriptExecutor) {
231 visitor->trace(m_executor); 232 visitor->trace(m_executor);
232 SuspendableTimer::trace(visitor); 233 SuspendableTimer::trace(visitor);
233 } 234 }
234 235
235 } // namespace blink 236 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/SuspendableTimer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698