| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 { | 407 { |
| 408 DCHECK(m_injectedScript && !m_context.IsEmpty() && !m_commandLineAPIScope.ge
t()); | 408 DCHECK(m_injectedScript && !m_context.IsEmpty() && !m_commandLineAPIScope.ge
t()); |
| 409 m_commandLineAPIScope.reset(new V8Console::CommandLineAPIScope(m_context, m_
injectedScript->commandLineAPI(), m_context->Global())); | 409 m_commandLineAPIScope.reset(new V8Console::CommandLineAPIScope(m_context, m_
injectedScript->commandLineAPI(), m_context->Global())); |
| 410 return true; | 410 return true; |
| 411 } | 411 } |
| 412 | 412 |
| 413 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() | 413 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() |
| 414 { | 414 { |
| 415 DCHECK(!m_ignoreExceptionsAndMuteConsole); | 415 DCHECK(!m_ignoreExceptionsAndMuteConsole); |
| 416 m_ignoreExceptionsAndMuteConsole = true; | 416 m_ignoreExceptionsAndMuteConsole = true; |
| 417 m_debugger->client()->muteConsole(); | 417 m_debugger->muteConsole(); |
| 418 m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8DebuggerImpl:
:DontPauseOnExceptions); | 418 m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8DebuggerImpl:
:DontPauseOnExceptions); |
| 419 } | 419 } |
| 420 | 420 |
| 421 V8DebuggerImpl::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptio
nsState(V8DebuggerImpl::PauseOnExceptionsState newState) | 421 V8DebuggerImpl::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptio
nsState(V8DebuggerImpl::PauseOnExceptionsState newState) |
| 422 { | 422 { |
| 423 if (!m_debugger->enabled()) | 423 if (!m_debugger->enabled()) |
| 424 return newState; | 424 return newState; |
| 425 V8DebuggerImpl::PauseOnExceptionsState presentState = m_debugger->getPauseOn
ExceptionsState(); | 425 V8DebuggerImpl::PauseOnExceptionsState presentState = m_debugger->getPauseOn
ExceptionsState(); |
| 426 if (presentState != newState) | 426 if (presentState != newState) |
| 427 m_debugger->setPauseOnExceptionsState(newState); | 427 m_debugger->setPauseOnExceptionsState(newState); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 441 if (!m_context.IsEmpty()) { | 441 if (!m_context.IsEmpty()) { |
| 442 m_context->Exit(); | 442 m_context->Exit(); |
| 443 m_context.Clear(); | 443 m_context.Clear(); |
| 444 } | 444 } |
| 445 } | 445 } |
| 446 | 446 |
| 447 InjectedScript::Scope::~Scope() | 447 InjectedScript::Scope::~Scope() |
| 448 { | 448 { |
| 449 if (m_ignoreExceptionsAndMuteConsole) { | 449 if (m_ignoreExceptionsAndMuteConsole) { |
| 450 setPauseOnExceptionsState(m_previousPauseOnExceptionsState); | 450 setPauseOnExceptionsState(m_previousPauseOnExceptionsState); |
| 451 m_debugger->client()->unmuteConsole(); | 451 m_debugger->unmuteConsole(); |
| 452 } | 452 } |
| 453 if (m_userGesture) | 453 if (m_userGesture) |
| 454 m_debugger->client()->endUserGesture(); | 454 m_debugger->client()->endUserGesture(); |
| 455 cleanup(); | 455 cleanup(); |
| 456 } | 456 } |
| 457 | 457 |
| 458 InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8DebuggerI
mpl* debugger, int contextGroupId, int executionContextId) | 458 InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8DebuggerI
mpl* debugger, int contextGroupId, int executionContextId) |
| 459 : InjectedScript::Scope(errorString, debugger, contextGroupId) | 459 : InjectedScript::Scope(errorString, debugger, contextGroupId) |
| 460 , m_executionContextId(executionContextId) | 460 , m_executionContextId(executionContextId) |
| 461 { | 461 { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) | 507 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) |
| 508 { | 508 { |
| 509 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); | 509 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); |
| 510 if (!remoteId) | 510 if (!remoteId) |
| 511 return; | 511 return; |
| 512 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); | 512 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); |
| 513 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); | 513 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); |
| 514 } | 514 } |
| 515 | 515 |
| 516 } // namespace blink | 516 } // namespace blink |
| OLD | NEW |