| 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 { | 386 { |
| 387 DCHECK(m_injectedScript && !m_context.IsEmpty() && !m_commandLineAPIScope.ge
t()); | 387 DCHECK(m_injectedScript && !m_context.IsEmpty() && !m_commandLineAPIScope.ge
t()); |
| 388 m_commandLineAPIScope.reset(new V8Console::CommandLineAPIScope(m_context, m_
injectedScript->commandLineAPI(), m_context->Global())); | 388 m_commandLineAPIScope.reset(new V8Console::CommandLineAPIScope(m_context, m_
injectedScript->commandLineAPI(), m_context->Global())); |
| 389 return true; | 389 return true; |
| 390 } | 390 } |
| 391 | 391 |
| 392 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() | 392 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() |
| 393 { | 393 { |
| 394 DCHECK(!m_ignoreExceptionsAndMuteConsole); | 394 DCHECK(!m_ignoreExceptionsAndMuteConsole); |
| 395 m_ignoreExceptionsAndMuteConsole = true; | 395 m_ignoreExceptionsAndMuteConsole = true; |
| 396 m_inspector->client()->muteWarningsAndDeprecations(m_contextGroupId); | 396 m_inspector->client()->muteMetrics(m_contextGroupId); |
| 397 m_inspector->muteExceptions(m_contextGroupId); |
| 397 m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8Debugger::Don
tPauseOnExceptions); | 398 m_previousPauseOnExceptionsState = setPauseOnExceptionsState(V8Debugger::Don
tPauseOnExceptions); |
| 398 } | 399 } |
| 399 | 400 |
| 400 V8Debugger::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptionsSt
ate(V8Debugger::PauseOnExceptionsState newState) | 401 V8Debugger::PauseOnExceptionsState InjectedScript::Scope::setPauseOnExceptionsSt
ate(V8Debugger::PauseOnExceptionsState newState) |
| 401 { | 402 { |
| 402 if (!m_inspector->debugger()->enabled()) | 403 if (!m_inspector->debugger()->enabled()) |
| 403 return newState; | 404 return newState; |
| 404 V8Debugger::PauseOnExceptionsState presentState = m_inspector->debugger()->g
etPauseOnExceptionsState(); | 405 V8Debugger::PauseOnExceptionsState presentState = m_inspector->debugger()->g
etPauseOnExceptionsState(); |
| 405 if (presentState != newState) | 406 if (presentState != newState) |
| 406 m_inspector->debugger()->setPauseOnExceptionsState(newState); | 407 m_inspector->debugger()->setPauseOnExceptionsState(newState); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 420 if (!m_context.IsEmpty()) { | 421 if (!m_context.IsEmpty()) { |
| 421 m_context->Exit(); | 422 m_context->Exit(); |
| 422 m_context.Clear(); | 423 m_context.Clear(); |
| 423 } | 424 } |
| 424 } | 425 } |
| 425 | 426 |
| 426 InjectedScript::Scope::~Scope() | 427 InjectedScript::Scope::~Scope() |
| 427 { | 428 { |
| 428 if (m_ignoreExceptionsAndMuteConsole) { | 429 if (m_ignoreExceptionsAndMuteConsole) { |
| 429 setPauseOnExceptionsState(m_previousPauseOnExceptionsState); | 430 setPauseOnExceptionsState(m_previousPauseOnExceptionsState); |
| 430 m_inspector->client()->unmuteWarningsAndDeprecations(m_contextGroupId); | 431 m_inspector->client()->unmuteMetrics(m_contextGroupId); |
| 432 m_inspector->unmuteExceptions(m_contextGroupId); |
| 431 } | 433 } |
| 432 if (m_userGesture) | 434 if (m_userGesture) |
| 433 m_inspector->client()->endUserGesture(); | 435 m_inspector->client()->endUserGesture(); |
| 434 cleanup(); | 436 cleanup(); |
| 435 } | 437 } |
| 436 | 438 |
| 437 InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8Inspector
Impl* inspector, int contextGroupId, int executionContextId) | 439 InjectedScript::ContextScope::ContextScope(ErrorString* errorString, V8Inspector
Impl* inspector, int contextGroupId, int executionContextId) |
| 438 : InjectedScript::Scope(errorString, inspector, contextGroupId) | 440 : InjectedScript::Scope(errorString, inspector, contextGroupId) |
| 439 , m_executionContextId(executionContextId) | 441 , m_executionContextId(executionContextId) |
| 440 { | 442 { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) | 488 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl*
session) |
| 487 { | 489 { |
| 488 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); | 490 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err
orString, m_remoteCallFrameId); |
| 489 if (!remoteId) | 491 if (!remoteId) |
| 490 return; | 492 return; |
| 491 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); | 493 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); |
| 492 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); | 494 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()
); |
| 493 } | 495 } |
| 494 | 496 |
| 495 } // namespace blink | 497 } // namespace blink |
| OLD | NEW |