| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 { | 406 { |
| 407 DCHECK(m_injectedScript && !m_context.IsEmpty() && !m_commandLineAPIScope.ge
t()); | 407 DCHECK(m_injectedScript && !m_context.IsEmpty() && !m_commandLineAPIScope.ge
t()); |
| 408 m_commandLineAPIScope.reset(new V8Console::CommandLineAPIScope(m_context, m_
injectedScript->commandLineAPI(), m_context->Global())); | 408 m_commandLineAPIScope.reset(new V8Console::CommandLineAPIScope(m_context, m_
injectedScript->commandLineAPI(), m_context->Global())); |
| 409 return true; | 409 return true; |
| 410 } | 410 } |
| 411 | 411 |
| 412 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() | 412 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() |
| 413 { | 413 { |
| 414 DCHECK(!m_ignoreExceptionsAndMuteConsole); | 414 DCHECK(!m_ignoreExceptionsAndMuteConsole); |
| 415 m_ignoreExceptionsAndMuteConsole = true; | 415 m_ignoreExceptionsAndMuteConsole = true; |
| 416 m_debugger->client()->muteConsole(); | 416 m_debugger->muteConsole(); |
| 417 m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8DebuggerImpl:
:DontPauseOnExceptions); | 417 m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8DebuggerImpl:
:DontPauseOnExceptions); |
| 418 } | 418 } |
| 419 | 419 |
| 420 V8DebuggerImpl::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptio
nsState(V8DebuggerImpl::PauseOnExceptionsState newState) | 420 V8DebuggerImpl::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptio
nsState(V8DebuggerImpl::PauseOnExceptionsState newState) |
| 421 { | 421 { |
| 422 if (!m_debugger->enabled()) | 422 if (!m_debugger->enabled()) |
| 423 return newState; | 423 return newState; |
| 424 V8DebuggerImpl::PauseOnExceptionsState presentState = m_debugger->getPauseOn
ExceptionsState(); | 424 V8DebuggerImpl::PauseOnExceptionsState presentState = m_debugger->getPauseOn
ExceptionsState(); |
| 425 if (presentState != newState) | 425 if (presentState != newState) |
| 426 m_debugger->setPauseOnExceptionsState(newState); | 426 m_debugger->setPauseOnExceptionsState(newState); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 440 if (!m_context.IsEmpty()) { | 440 if (!m_context.IsEmpty()) { |
| 441 m_context->Exit(); | 441 m_context->Exit(); |
| 442 m_context.Clear(); | 442 m_context.Clear(); |
| 443 } | 443 } |
| 444 } | 444 } |
| 445 | 445 |
| 446 InjectedScript::Scope::~Scope() | 446 InjectedScript::Scope::~Scope() |
| 447 { | 447 { |
| 448 if (m_ignoreExceptionsAndMuteConsole) { | 448 if (m_ignoreExceptionsAndMuteConsole) { |
| 449 setPauseOnExceptionsState(m_previousPauseOnExceptionsState); | 449 setPauseOnExceptionsState(m_previousPauseOnExceptionsState); |
| 450 m_debugger->client()->unmuteConsole(); | 450 m_debugger->unmuteConsole(); |
| 451 } | 451 } |
| 452 if (m_userGesture) | 452 if (m_userGesture) |
| 453 m_debugger->client()->endUserGesture(); | 453 m_debugger->client()->endUserGesture(); |
| 454 cleanup(); | 454 cleanup(); |
| 455 } | 455 } |
| 456 | 456 |
| 457 InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8DebuggerI
mpl* debugger, int contextGroupId, int executionContextId) | 457 InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8DebuggerI
mpl* debugger, int contextGroupId, int executionContextId) |
| 458 : InjectedScript::Scope(errorString, debugger, contextGroupId) | 458 : InjectedScript::Scope(errorString, debugger, contextGroupId) |
| 459 , m_executionContextId(executionContextId) | 459 , m_executionContextId(executionContextId) |
| 460 { | 460 { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) | 506 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) |
| 507 { | 507 { |
| 508 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); | 508 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); |
| 509 if (!remoteId) | 509 if (!remoteId) |
| 510 return; | 510 return; |
| 511 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); | 511 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); |
| 512 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); | 512 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); |
| 513 } | 513 } |
| 514 | 514 |
| 515 } // namespace blink | 515 } // namespace blink |
| OLD | NEW |