| 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 { | 392 { |
| 393 DCHECK(m_injectedScript && !m_context.IsEmpty() && !m_commandLineAPIScope.ge
t()); | 393 DCHECK(m_injectedScript && !m_context.IsEmpty() && !m_commandLineAPIScope.ge
t()); |
| 394 m_commandLineAPIScope.reset(new V8Console::CommandLineAPIScope(m_context, m_
injectedScript->commandLineAPI(), m_context->Global())); | 394 m_commandLineAPIScope.reset(new V8Console::CommandLineAPIScope(m_context, m_
injectedScript->commandLineAPI(), m_context->Global())); |
| 395 return true; | 395 return true; |
| 396 } | 396 } |
| 397 | 397 |
| 398 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() | 398 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() |
| 399 { | 399 { |
| 400 DCHECK(!m_ignoreExceptionsAndMuteConsole); | 400 DCHECK(!m_ignoreExceptionsAndMuteConsole); |
| 401 m_ignoreExceptionsAndMuteConsole = true; | 401 m_ignoreExceptionsAndMuteConsole = true; |
| 402 m_debugger->muteConsole(); | 402 m_debugger->client()->muteWarningsAndDeprecations(); |
| 403 m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8DebuggerImpl:
:DontPauseOnExceptions); | 403 m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8DebuggerImpl:
:DontPauseOnExceptions); |
| 404 } | 404 } |
| 405 | 405 |
| 406 V8DebuggerImpl::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptio
nsState(V8DebuggerImpl::PauseOnExceptionsState newState) | 406 V8DebuggerImpl::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptio
nsState(V8DebuggerImpl::PauseOnExceptionsState newState) |
| 407 { | 407 { |
| 408 if (!m_debugger->enabled()) | 408 if (!m_debugger->enabled()) |
| 409 return newState; | 409 return newState; |
| 410 V8DebuggerImpl::PauseOnExceptionsState presentState = m_debugger->getPauseOn
ExceptionsState(); | 410 V8DebuggerImpl::PauseOnExceptionsState presentState = m_debugger->getPauseOn
ExceptionsState(); |
| 411 if (presentState != newState) | 411 if (presentState != newState) |
| 412 m_debugger->setPauseOnExceptionsState(newState); | 412 m_debugger->setPauseOnExceptionsState(newState); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 426 if (!m_context.IsEmpty()) { | 426 if (!m_context.IsEmpty()) { |
| 427 m_context->Exit(); | 427 m_context->Exit(); |
| 428 m_context.Clear(); | 428 m_context.Clear(); |
| 429 } | 429 } |
| 430 } | 430 } |
| 431 | 431 |
| 432 InjectedScript::Scope::~Scope() | 432 InjectedScript::Scope::~Scope() |
| 433 { | 433 { |
| 434 if (m_ignoreExceptionsAndMuteConsole) { | 434 if (m_ignoreExceptionsAndMuteConsole) { |
| 435 setPauseOnExceptionsState(m_previousPauseOnExceptionsState); | 435 setPauseOnExceptionsState(m_previousPauseOnExceptionsState); |
| 436 m_debugger->unmuteConsole(); | 436 m_debugger->client()->unmuteWarningsAndDeprecations(); |
| 437 } | 437 } |
| 438 if (m_userGesture) | 438 if (m_userGesture) |
| 439 m_debugger->client()->endUserGesture(); | 439 m_debugger->client()->endUserGesture(); |
| 440 cleanup(); | 440 cleanup(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8DebuggerI
mpl* debugger, int contextGroupId, int executionContextId) | 443 InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8DebuggerI
mpl* debugger, int contextGroupId, int executionContextId) |
| 444 : InjectedScript::Scope(errorString, debugger, contextGroupId) | 444 : InjectedScript::Scope(errorString, debugger, contextGroupId) |
| 445 , m_executionContextId(executionContextId) | 445 , m_executionContextId(executionContextId) |
| 446 { | 446 { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) | 492 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) |
| 493 { | 493 { |
| 494 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); | 494 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); |
| 495 if (!remoteId) | 495 if (!remoteId) |
| 496 return; | 496 return; |
| 497 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); | 497 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); |
| 498 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); | 498 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace blink | 501 } // namespace blink |
| OLD | NEW |