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

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

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

Powered by Google App Engine
This is Rietveld 408576698