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

Side by Side Diff: third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp

Issue 2401123002: UserGestureIndicator is a mess. Clean it up. (Closed)
Patch Set: Callback cleanup, comments Created 4 years, 2 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/inspector/ThreadDebugger.h" 5 #include "core/inspector/ThreadDebugger.h"
6 6
7 #include "bindings/core/v8/SourceLocation.h" 7 #include "bindings/core/v8/SourceLocation.h"
8 #include "bindings/core/v8/V8Binding.h" 8 #include "bindings/core/v8/V8Binding.h"
9 #include "bindings/core/v8/V8DOMException.h" 9 #include "bindings/core/v8/V8DOMException.h"
10 #include "bindings/core/v8/V8DOMTokenList.h" 10 #include "bindings/core/v8/V8DOMTokenList.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 void ThreadDebugger::promiseRejectionRevoked(v8::Local<v8::Context> context, 131 void ThreadDebugger::promiseRejectionRevoked(v8::Local<v8::Context> context,
132 unsigned promiseRejectionId) { 132 unsigned promiseRejectionId) {
133 const String message = "Handler added to rejected promise"; 133 const String message = "Handler added to rejected promise";
134 v8Inspector()->exceptionRevoked(context, promiseRejectionId, 134 v8Inspector()->exceptionRevoked(context, promiseRejectionId,
135 toV8InspectorStringView(message)); 135 toV8InspectorStringView(message));
136 } 136 }
137 137
138 void ThreadDebugger::beginUserGesture() { 138 void ThreadDebugger::beginUserGesture() {
139 m_userGestureIndicator = 139 m_userGestureIndicator =
140 wrapUnique(new UserGestureIndicator(DefinitelyProcessingNewUserGesture)); 140 wrapUnique(new UserGestureIndicator(UserGestureToken::create()));
141 } 141 }
142 142
143 void ThreadDebugger::endUserGesture() { 143 void ThreadDebugger::endUserGesture() {
144 m_userGestureIndicator.reset(); 144 m_userGestureIndicator.reset();
145 } 145 }
146 146
147 std::unique_ptr<v8_inspector::StringBuffer> ThreadDebugger::valueSubtype( 147 std::unique_ptr<v8_inspector::StringBuffer> ThreadDebugger::valueSubtype(
148 v8::Local<v8::Value> value) { 148 v8::Local<v8::Value> value) {
149 static const char kNode[] = "node"; 149 static const char kNode[] = "node";
150 static const char kArray[] = "array"; 150 static const char kArray[] = "array";
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 void ThreadDebugger::onTimer(TimerBase* timer) { 478 void ThreadDebugger::onTimer(TimerBase* timer) {
479 for (size_t index = 0; index < m_timers.size(); ++index) { 479 for (size_t index = 0; index < m_timers.size(); ++index) {
480 if (m_timers[index].get() == timer) { 480 if (m_timers[index].get() == timer) {
481 m_timerCallbacks[index](m_timerData[index]); 481 m_timerCallbacks[index](m_timerData[index]);
482 return; 482 return;
483 } 483 }
484 } 484 }
485 } 485 }
486 486
487 } // namespace blink 487 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698