| OLD | NEW |
| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 void ThreadDebugger::asyncTaskStarted(void* task) | 101 void ThreadDebugger::asyncTaskStarted(void* task) |
| 102 { | 102 { |
| 103 m_v8Inspector->asyncTaskStarted(task); | 103 m_v8Inspector->asyncTaskStarted(task); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void ThreadDebugger::asyncTaskFinished(void* task) | 106 void ThreadDebugger::asyncTaskFinished(void* task) |
| 107 { | 107 { |
| 108 m_v8Inspector->asyncTaskFinished(task); | 108 m_v8Inspector->asyncTaskFinished(task); |
| 109 } | 109 } |
| 110 | 110 |
| 111 unsigned ThreadDebugger::promiseRejected(v8::Local<v8::Context> context, const S
tring16& errorMessage, v8::Local<v8::Value> exception, std::unique_ptr<SourceLoc
ation> location) | 111 unsigned ThreadDebugger::promiseRejected(v8::Local<v8::Context> context, const S
tring& errorMessage, v8::Local<v8::Value> exception, std::unique_ptr<SourceLocat
ion> location) |
| 112 { | 112 { |
| 113 const String16 defaultMessage = "Uncaught (in promise)"; | 113 const String defaultMessage = "Uncaught (in promise)"; |
| 114 String16 message = errorMessage; | 114 String message = errorMessage; |
| 115 if (message.isEmpty()) | 115 if (message.isEmpty()) |
| 116 message = defaultMessage; | 116 message = defaultMessage; |
| 117 else if (message.startWith("Uncaught ")) | 117 else if (message.startsWith("Uncaught ")) |
| 118 message = message.substring(0, 8) + " (in promise)" + message.substring(
8); | 118 message = message.substring(0, 8) + " (in promise)" + message.substring(
8); |
| 119 | 119 |
| 120 reportConsoleMessage(toExecutionContext(context), JSMessageSource, ErrorMess
ageLevel, message, location.get()); | 120 reportConsoleMessage(toExecutionContext(context), JSMessageSource, ErrorMess
ageLevel, message, location.get()); |
| 121 return v8Inspector()->exceptionThrown(context, defaultMessage, exception, me
ssage, location->url(), location->lineNumber(), location->columnNumber(), locati
on->takeStackTrace(), location->scriptId()); | 121 return v8Inspector()->exceptionThrown(context, defaultMessage, exception, me
ssage, location->url(), location->lineNumber(), location->columnNumber(), locati
on->takeStackTrace(), location->scriptId()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ThreadDebugger::promiseRejectionRevoked(v8::Local<v8::Context> context, uns
igned promiseRejectionId) | 124 void ThreadDebugger::promiseRejectionRevoked(v8::Local<v8::Context> context, uns
igned promiseRejectionId) |
| 125 { | 125 { |
| 126 const String16 message = "Handler added to rejected promise"; | 126 const String message = "Handler added to rejected promise"; |
| 127 v8Inspector()->exceptionRevoked(context, promiseRejectionId, message); | 127 v8Inspector()->exceptionRevoked(context, promiseRejectionId, message); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void ThreadDebugger::beginUserGesture() | 130 void ThreadDebugger::beginUserGesture() |
| 131 { | 131 { |
| 132 m_userGestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyProce
ssingNewUserGesture)); | 132 m_userGestureIndicator = wrapUnique(new UserGestureIndicator(DefinitelyProce
ssingNewUserGesture)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 void ThreadDebugger::endUserGesture() | 135 void ThreadDebugger::endUserGesture() |
| 136 { | 136 { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 { | 371 { |
| 372 for (size_t index = 0; index < m_timers.size(); ++index) { | 372 for (size_t index = 0; index < m_timers.size(); ++index) { |
| 373 if (m_timers[index].get() == timer) { | 373 if (m_timers[index].get() == timer) { |
| 374 m_timerCallbacks[index](m_timerData[index]); | 374 m_timerCallbacks[index](m_timerData[index]); |
| 375 return; | 375 return; |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 } | 378 } |
| 379 | 379 |
| 380 } // namespace blink | 380 } // namespace blink |
| OLD | NEW |