Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp

Issue 2200273002: [DevTools] Cleanup mute exceptions, usecounter and deprecations in v8_inspector API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2205913002
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698