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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 438 |
439 InjectedScript::Scope::Scope(ErrorString* errorString, | 439 InjectedScript::Scope::Scope(ErrorString* errorString, |
440 V8InspectorImpl* inspector, int contextGroupId) | 440 V8InspectorImpl* inspector, int contextGroupId) |
441 : m_errorString(errorString), | 441 : m_errorString(errorString), |
442 m_inspector(inspector), | 442 m_inspector(inspector), |
443 m_contextGroupId(contextGroupId), | 443 m_contextGroupId(contextGroupId), |
444 m_injectedScript(nullptr), | 444 m_injectedScript(nullptr), |
445 m_handleScope(inspector->isolate()), | 445 m_handleScope(inspector->isolate()), |
446 m_tryCatch(inspector->isolate()), | 446 m_tryCatch(inspector->isolate()), |
447 m_ignoreExceptionsAndMuteConsole(false), | 447 m_ignoreExceptionsAndMuteConsole(false), |
448 m_previousPauseOnExceptionsState(V8Debugger::DontPauseOnExceptions), | 448 m_previousPauseOnExceptionsState(v8::DebugInterface::NoBreakOnException), |
449 m_userGesture(false) {} | 449 m_userGesture(false) {} |
450 | 450 |
451 bool InjectedScript::Scope::initialize() { | 451 bool InjectedScript::Scope::initialize() { |
452 cleanup(); | 452 cleanup(); |
453 // TODO(dgozman): what if we reattach to the same context group during | 453 // TODO(dgozman): what if we reattach to the same context group during |
454 // evaluate? Introduce a session id? | 454 // evaluate? Introduce a session id? |
455 V8InspectorSessionImpl* session = | 455 V8InspectorSessionImpl* session = |
456 m_inspector->sessionForContextGroup(m_contextGroupId); | 456 m_inspector->sessionForContextGroup(m_contextGroupId); |
457 if (!session) { | 457 if (!session) { |
458 *m_errorString = "Internal error"; | 458 *m_errorString = "Internal error"; |
(...skipping 13 matching lines...) Expand all Loading... |
472 m_context, m_injectedScript->commandLineAPI(), m_context->Global())); | 472 m_context, m_injectedScript->commandLineAPI(), m_context->Global())); |
473 return true; | 473 return true; |
474 } | 474 } |
475 | 475 |
476 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() { | 476 void InjectedScript::Scope::ignoreExceptionsAndMuteConsole() { |
477 DCHECK(!m_ignoreExceptionsAndMuteConsole); | 477 DCHECK(!m_ignoreExceptionsAndMuteConsole); |
478 m_ignoreExceptionsAndMuteConsole = true; | 478 m_ignoreExceptionsAndMuteConsole = true; |
479 m_inspector->client()->muteMetrics(m_contextGroupId); | 479 m_inspector->client()->muteMetrics(m_contextGroupId); |
480 m_inspector->muteExceptions(m_contextGroupId); | 480 m_inspector->muteExceptions(m_contextGroupId); |
481 m_previousPauseOnExceptionsState = | 481 m_previousPauseOnExceptionsState = |
482 setPauseOnExceptionsState(V8Debugger::DontPauseOnExceptions); | 482 setPauseOnExceptionsState(v8::DebugInterface::NoBreakOnException); |
483 } | 483 } |
484 | 484 |
485 V8Debugger::PauseOnExceptionsState | 485 v8::DebugInterface::ExceptionBreakState |
486 InjectedScript::Scope::setPauseOnExceptionsState( | 486 InjectedScript::Scope::setPauseOnExceptionsState( |
487 V8Debugger::PauseOnExceptionsState newState) { | 487 v8::DebugInterface::ExceptionBreakState newState) { |
488 if (!m_inspector->debugger()->enabled()) return newState; | 488 if (!m_inspector->debugger()->enabled()) return newState; |
489 V8Debugger::PauseOnExceptionsState presentState = | 489 v8::DebugInterface::ExceptionBreakState presentState = |
490 m_inspector->debugger()->getPauseOnExceptionsState(); | 490 m_inspector->debugger()->getPauseOnExceptionsState(); |
491 if (presentState != newState) | 491 if (presentState != newState) |
492 m_inspector->debugger()->setPauseOnExceptionsState(newState); | 492 m_inspector->debugger()->setPauseOnExceptionsState(newState); |
493 return presentState; | 493 return presentState; |
494 } | 494 } |
495 | 495 |
496 void InjectedScript::Scope::pretendUserGesture() { | 496 void InjectedScript::Scope::pretendUserGesture() { |
497 DCHECK(!m_userGesture); | 497 DCHECK(!m_userGesture); |
498 m_userGesture = true; | 498 m_userGesture = true; |
499 m_inspector->client()->beginUserGesture(); | 499 m_inspector->client()->beginUserGesture(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 void InjectedScript::CallFrameScope::findInjectedScript( | 566 void InjectedScript::CallFrameScope::findInjectedScript( |
567 V8InspectorSessionImpl* session) { | 567 V8InspectorSessionImpl* session) { |
568 std::unique_ptr<RemoteCallFrameId> remoteId = | 568 std::unique_ptr<RemoteCallFrameId> remoteId = |
569 RemoteCallFrameId::parse(m_errorString, m_remoteCallFrameId); | 569 RemoteCallFrameId::parse(m_errorString, m_remoteCallFrameId); |
570 if (!remoteId) return; | 570 if (!remoteId) return; |
571 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); | 571 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); |
572 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()); | 572 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get()); |
573 } | 573 } |
574 | 574 |
575 } // namespace v8_inspector | 575 } // namespace v8_inspector |
OLD | NEW |