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 17 matching lines...) Expand all Loading... |
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" | 37 #include "wtf/MainThread.h" |
| 38 #include "wtf/Optional.h" |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedSc
riptManager, V8Debugger* debugger, int contextGroupId) | 42 InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedSc
riptManager, V8Debugger* debugger, int contextGroupId) |
42 : InspectorBaseAgent<InspectorDebuggerAgent, InspectorFrontend::Debugger>("D
ebugger") | 43 : InspectorBaseAgent<InspectorDebuggerAgent, InspectorFrontend::Debugger>("D
ebugger") |
43 , m_v8DebuggerAgent(adoptPtrWillBeNoop(new V8DebuggerAgent(injectedScriptMan
ager, debugger, this, contextGroupId))) | 44 , m_v8DebuggerAgent(adoptPtrWillBeNoop(new V8DebuggerAgent(injectedScriptMan
ager, debugger, this, contextGroupId))) |
44 { | 45 { |
45 } | 46 } |
46 | 47 |
47 InspectorDebuggerAgent::~InspectorDebuggerAgent() | 48 InspectorDebuggerAgent::~InspectorDebuggerAgent() |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 m_instrumentingAgents->setInspectorDebuggerAgent(nullptr); | 255 m_instrumentingAgents->setInspectorDebuggerAgent(nullptr); |
255 } | 256 } |
256 | 257 |
257 bool InspectorDebuggerAgent::isPaused() | 258 bool InspectorDebuggerAgent::isPaused() |
258 { | 259 { |
259 return m_v8DebuggerAgent->isPaused(); | 260 return m_v8DebuggerAgent->isPaused(); |
260 } | 261 } |
261 | 262 |
262 PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> InspectorDebuggerAgent::currentAsyn
cStackTraceForConsole() | 263 PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> InspectorDebuggerAgent::currentAsyn
cStackTraceForConsole() |
263 { | 264 { |
264 OwnPtr<ScriptForbiddenScope::AllowUserAgentScript> allowScripting; | 265 Optional<ScriptForbiddenScope::AllowUserAgentScript> allowScripting; |
265 if (isMainThread()) | 266 if (isMainThread()) |
266 allowScripting = adoptPtr(new ScriptForbiddenScope::AllowUserAgentScript
()); | 267 allowScripting.emplace(); |
267 return m_v8DebuggerAgent->currentAsyncStackTraceForConsole(); | 268 return m_v8DebuggerAgent->currentAsyncStackTraceForConsole(); |
268 } | 269 } |
269 | 270 |
270 void InspectorDebuggerAgent::didFireTimer() | 271 void InspectorDebuggerAgent::didFireTimer() |
271 { | 272 { |
272 m_v8DebuggerAgent->cancelPauseOnNextStatement(); | 273 m_v8DebuggerAgent->cancelPauseOnNextStatement(); |
273 } | 274 } |
274 | 275 |
275 void InspectorDebuggerAgent::didHandleEvent() | 276 void InspectorDebuggerAgent::didHandleEvent() |
276 { | 277 { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 { | 322 { |
322 m_v8DebuggerAgent->clearFrontend(); | 323 m_v8DebuggerAgent->clearFrontend(); |
323 } | 324 } |
324 | 325 |
325 void InspectorDebuggerAgent::restore() | 326 void InspectorDebuggerAgent::restore() |
326 { | 327 { |
327 m_v8DebuggerAgent->restore(); | 328 m_v8DebuggerAgent->restore(); |
328 } | 329 } |
329 | 330 |
330 } // namespace blink | 331 } // namespace blink |
OLD | NEW |