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

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

Issue 2318853002: [DevTools] Handle navigation in console.log (Closed)
Patch Set: addressed comments Created 4 years, 3 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 void V8RuntimeAgentImpl::enable(ErrorString* errorString) 610 void V8RuntimeAgentImpl::enable(ErrorString* errorString)
611 { 611 {
612 if (m_enabled) 612 if (m_enabled)
613 return; 613 return;
614 m_inspector->client()->beginEnsureAllContextsInGroup(m_session->contextGroup Id()); 614 m_inspector->client()->beginEnsureAllContextsInGroup(m_session->contextGroup Id());
615 m_enabled = true; 615 m_enabled = true;
616 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true); 616 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true);
617 m_inspector->enableStackCapturingIfNeeded(); 617 m_inspector->enableStackCapturingIfNeeded();
618 m_session->reportAllContexts(this); 618 m_session->reportAllContexts(this);
619 V8ConsoleMessageStorage* storage = m_inspector->ensureConsoleMessageStorage( m_session->contextGroupId()); 619 V8ConsoleMessageStorage* storage = m_inspector->ensureConsoleMessageStorage( m_session->contextGroupId());
620 for (const auto& message : storage->messages()) 620 for (const auto& message : storage->messages()) {
621 reportMessage(message.get(), false); 621 if (!reportMessage(message.get(), false))
622 return;
623 }
622 } 624 }
623 625
624 void V8RuntimeAgentImpl::disable(ErrorString* errorString) 626 void V8RuntimeAgentImpl::disable(ErrorString* errorString)
625 { 627 {
626 if (!m_enabled) 628 if (!m_enabled)
627 return; 629 return;
628 m_enabled = false; 630 m_enabled = false;
629 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false); 631 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false);
630 m_inspector->disableStackCapturingIfNeeded(); 632 m_inspector->disableStackCapturingIfNeeded();
631 m_session->discardInjectedScripts(); 633 m_session->discardInjectedScripts();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 if (m_enabled) 674 if (m_enabled)
673 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints) ); 675 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints) );
674 } 676 }
675 677
676 void V8RuntimeAgentImpl::messageAdded(V8ConsoleMessage* message) 678 void V8RuntimeAgentImpl::messageAdded(V8ConsoleMessage* message)
677 { 679 {
678 if (m_enabled) 680 if (m_enabled)
679 reportMessage(message, true); 681 reportMessage(message, true);
680 } 682 }
681 683
682 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP review) 684 bool V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP review)
683 { 685 {
684 message->reportToFrontend(&m_frontend, m_session, generatePreview); 686 message->reportToFrontend(&m_frontend, m_session, generatePreview);
685 m_frontend.flush(); 687 m_frontend.flush();
688 return m_inspector->hasConsoleMessageStorage(m_session->contextGroupId());
686 } 689 }
687 690
688 } // namespace v8_inspector 691 } // namespace v8_inspector
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698