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

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

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check Created 4 years, 1 month 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"
11 #include "bindings/core/v8/V8Event.h" 11 #include "bindings/core/v8/V8Event.h"
12 #include "bindings/core/v8/V8EventListener.h" 12 #include "bindings/core/v8/V8EventListener.h"
13 #include "bindings/core/v8/V8EventListenerHelper.h" 13 #include "bindings/core/v8/V8EventListenerHelper.h"
14 #include "bindings/core/v8/V8EventListenerInfo.h" 14 #include "bindings/core/v8/V8EventListenerInfo.h"
15 #include "bindings/core/v8/V8HTMLAllCollection.h" 15 #include "bindings/core/v8/V8HTMLAllCollection.h"
16 #include "bindings/core/v8/V8HTMLCollection.h" 16 #include "bindings/core/v8/V8HTMLCollection.h"
17 #include "bindings/core/v8/V8Node.h" 17 #include "bindings/core/v8/V8Node.h"
18 #include "bindings/core/v8/V8NodeList.h" 18 #include "bindings/core/v8/V8NodeList.h"
19 #include "bindings/core/v8/V8ScriptRunner.h" 19 #include "bindings/core/v8/V8ScriptRunner.h"
20 #include "core/dom/DocumentUserGestureToken.h"
20 #include "core/inspector/ConsoleMessage.h" 21 #include "core/inspector/ConsoleMessage.h"
21 #include "core/inspector/InspectorDOMDebuggerAgent.h" 22 #include "core/inspector/InspectorDOMDebuggerAgent.h"
22 #include "core/inspector/InspectorTraceEvents.h" 23 #include "core/inspector/InspectorTraceEvents.h"
23 #include "core/inspector/V8InspectorString.h" 24 #include "core/inspector/V8InspectorString.h"
24 #include "platform/ScriptForbiddenScope.h" 25 #include "platform/ScriptForbiddenScope.h"
25 #include "wtf/CurrentTime.h" 26 #include "wtf/CurrentTime.h"
26 #include "wtf/PtrUtil.h" 27 #include "wtf/PtrUtil.h"
27 #include <memory> 28 #include <memory>
28 29
29 namespace blink { 30 namespace blink {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 130 }
130 131
131 void ThreadDebugger::promiseRejectionRevoked(v8::Local<v8::Context> context, 132 void ThreadDebugger::promiseRejectionRevoked(v8::Local<v8::Context> context,
132 unsigned promiseRejectionId) { 133 unsigned promiseRejectionId) {
133 const String message = "Handler added to rejected promise"; 134 const String message = "Handler added to rejected promise";
134 v8Inspector()->exceptionRevoked(context, promiseRejectionId, 135 v8Inspector()->exceptionRevoked(context, promiseRejectionId,
135 toV8InspectorStringView(message)); 136 toV8InspectorStringView(message));
136 } 137 }
137 138
138 void ThreadDebugger::beginUserGesture() { 139 void ThreadDebugger::beginUserGesture() {
139 m_userGestureIndicator = 140 m_userGestureIndicator = wrapUnique(
140 wrapUnique(new UserGestureIndicator(UserGestureToken::create())); 141 new UserGestureIndicator(DocumentUserGestureToken::create(nullptr)));
141 } 142 }
142 143
143 void ThreadDebugger::endUserGesture() { 144 void ThreadDebugger::endUserGesture() {
144 m_userGestureIndicator.reset(); 145 m_userGestureIndicator.reset();
145 } 146 }
146 147
147 std::unique_ptr<v8_inspector::StringBuffer> ThreadDebugger::valueSubtype( 148 std::unique_ptr<v8_inspector::StringBuffer> ThreadDebugger::valueSubtype(
148 v8::Local<v8::Value> value) { 149 v8::Local<v8::Value> value) {
149 static const char kNode[] = "node"; 150 static const char kNode[] = "node";
150 static const char kArray[] = "array"; 151 static const char kArray[] = "array";
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 void ThreadDebugger::onTimer(TimerBase* timer) { 479 void ThreadDebugger::onTimer(TimerBase* timer) {
479 for (size_t index = 0; index < m_timers.size(); ++index) { 480 for (size_t index = 0; index < m_timers.size(); ++index) {
480 if (m_timers[index].get() == timer) { 481 if (m_timers[index].get() == timer) {
481 m_timerCallbacks[index](m_timerData[index]); 482 m_timerCallbacks[index](m_timerData[index]);
482 return; 483 return;
483 } 484 }
484 } 485 }
485 } 486 }
486 487
487 } // namespace blink 488 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/DevToolsHost.cpp ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698