| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 #include "core/inspector/InspectorDebuggerAgent.h" | 31 #include "core/inspector/InspectorDebuggerAgent.h" |
| 32 | 32 |
| 33 #include "bindings/core/v8/V8Binding.h" | 33 #include "bindings/core/v8/V8Binding.h" |
| 34 #include "core/inspector/ScriptAsyncCallStack.h" | 34 #include "core/inspector/ScriptAsyncCallStack.h" |
| 35 #include "core/inspector/v8/V8Debugger.h" | 35 #include "core/inspector/v8/V8Debugger.h" |
| 36 #include "platform/ScriptForbiddenScope.h" | 36 #include "platform/ScriptForbiddenScope.h" |
| 37 #include "wtf/MainThread.h" | |
| 38 #include "wtf/Optional.h" | |
| 39 | 37 |
| 40 namespace blink { | 38 namespace blink { |
| 41 | 39 |
| 42 InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedSc
riptManager, V8Debugger* debugger, int contextGroupId) | 40 InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedSc
riptManager, V8Debugger* debugger, int contextGroupId) |
| 43 : InspectorBaseAgent<InspectorDebuggerAgent, InspectorFrontend::Debugger>("D
ebugger") | 41 : InspectorBaseAgent<InspectorDebuggerAgent, InspectorFrontend::Debugger>("D
ebugger") |
| 44 , m_v8DebuggerAgent(adoptPtrWillBeNoop(new V8DebuggerAgent(injectedScriptMan
ager, debugger, this, contextGroupId))) | 42 , m_v8DebuggerAgent(adoptPtrWillBeNoop(new V8DebuggerAgent(injectedScriptMan
ager, debugger, this, contextGroupId))) |
| 45 { | 43 { |
| 46 } | 44 } |
| 47 | 45 |
| 48 InspectorDebuggerAgent::~InspectorDebuggerAgent() | 46 InspectorDebuggerAgent::~InspectorDebuggerAgent() |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 m_instrumentingAgents->setInspectorDebuggerAgent(nullptr); | 253 m_instrumentingAgents->setInspectorDebuggerAgent(nullptr); |
| 256 } | 254 } |
| 257 | 255 |
| 258 bool InspectorDebuggerAgent::isPaused() | 256 bool InspectorDebuggerAgent::isPaused() |
| 259 { | 257 { |
| 260 return m_v8DebuggerAgent->isPaused(); | 258 return m_v8DebuggerAgent->isPaused(); |
| 261 } | 259 } |
| 262 | 260 |
| 263 PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> InspectorDebuggerAgent::currentAsyn
cStackTraceForConsole() | 261 PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> InspectorDebuggerAgent::currentAsyn
cStackTraceForConsole() |
| 264 { | 262 { |
| 265 Optional<ScriptForbiddenScope::AllowUserAgentScript> allowScripting; | 263 ScriptForbiddenScope::AllowUserAgentScript allowScripting; |
| 266 if (isMainThread()) | |
| 267 allowScripting.emplace(); | |
| 268 return m_v8DebuggerAgent->currentAsyncStackTraceForConsole(); | 264 return m_v8DebuggerAgent->currentAsyncStackTraceForConsole(); |
| 269 } | 265 } |
| 270 | 266 |
| 271 void InspectorDebuggerAgent::didFireTimer() | 267 void InspectorDebuggerAgent::didFireTimer() |
| 272 { | 268 { |
| 273 m_v8DebuggerAgent->cancelPauseOnNextStatement(); | 269 m_v8DebuggerAgent->cancelPauseOnNextStatement(); |
| 274 } | 270 } |
| 275 | 271 |
| 276 void InspectorDebuggerAgent::didHandleEvent() | 272 void InspectorDebuggerAgent::didHandleEvent() |
| 277 { | 273 { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 { | 318 { |
| 323 m_v8DebuggerAgent->clearFrontend(); | 319 m_v8DebuggerAgent->clearFrontend(); |
| 324 } | 320 } |
| 325 | 321 |
| 326 void InspectorDebuggerAgent::restore() | 322 void InspectorDebuggerAgent::restore() |
| 327 { | 323 { |
| 328 m_v8DebuggerAgent->restore(); | 324 m_v8DebuggerAgent->restore(); |
| 329 } | 325 } |
| 330 | 326 |
| 331 } // namespace blink | 327 } // namespace blink |
| OLD | NEW |