OLD | NEW |
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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 void V8RuntimeAgentImpl::enable(ErrorString* errorString) { | 651 void V8RuntimeAgentImpl::enable(ErrorString* errorString) { |
652 if (m_enabled) return; | 652 if (m_enabled) return; |
653 m_inspector->client()->beginEnsureAllContextsInGroup( | 653 m_inspector->client()->beginEnsureAllContextsInGroup( |
654 m_session->contextGroupId()); | 654 m_session->contextGroupId()); |
655 m_enabled = true; | 655 m_enabled = true; |
656 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true); | 656 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, true); |
657 m_inspector->enableStackCapturingIfNeeded(); | 657 m_inspector->enableStackCapturingIfNeeded(); |
658 m_session->reportAllContexts(this); | 658 m_session->reportAllContexts(this); |
659 V8ConsoleMessageStorage* storage = | 659 V8ConsoleMessageStorage* storage = |
660 m_inspector->ensureConsoleMessageStorage(m_session->contextGroupId()); | 660 m_inspector->ensureConsoleMessageStorage(m_session->contextGroupId()); |
661 for (const auto& message : storage->messages()) | 661 for (const auto& message : storage->messages()) { |
662 reportMessage(message.get(), false); | 662 if (!reportMessage(message.get(), false)) return; |
| 663 } |
663 } | 664 } |
664 | 665 |
665 void V8RuntimeAgentImpl::disable(ErrorString* errorString) { | 666 void V8RuntimeAgentImpl::disable(ErrorString* errorString) { |
666 if (!m_enabled) return; | 667 if (!m_enabled) return; |
667 m_enabled = false; | 668 m_enabled = false; |
668 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false); | 669 m_state->setBoolean(V8RuntimeAgentImplState::runtimeEnabled, false); |
669 m_inspector->disableStackCapturingIfNeeded(); | 670 m_inspector->disableStackCapturingIfNeeded(); |
670 m_session->discardInjectedScripts(); | 671 m_session->discardInjectedScripts(); |
671 reset(); | 672 reset(); |
672 m_inspector->client()->endEnsureAllContextsInGroup( | 673 m_inspector->client()->endEnsureAllContextsInGroup( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 std::unique_ptr<protocol::Runtime::RemoteObject> objectToInspect, | 713 std::unique_ptr<protocol::Runtime::RemoteObject> objectToInspect, |
713 std::unique_ptr<protocol::DictionaryValue> hints) { | 714 std::unique_ptr<protocol::DictionaryValue> hints) { |
714 if (m_enabled) | 715 if (m_enabled) |
715 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints)); | 716 m_frontend.inspectRequested(std::move(objectToInspect), std::move(hints)); |
716 } | 717 } |
717 | 718 |
718 void V8RuntimeAgentImpl::messageAdded(V8ConsoleMessage* message) { | 719 void V8RuntimeAgentImpl::messageAdded(V8ConsoleMessage* message) { |
719 if (m_enabled) reportMessage(message, true); | 720 if (m_enabled) reportMessage(message, true); |
720 } | 721 } |
721 | 722 |
722 void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, | 723 bool V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message, |
723 bool generatePreview) { | 724 bool generatePreview) { |
724 message->reportToFrontend(&m_frontend, m_session, generatePreview); | 725 message->reportToFrontend(&m_frontend, m_session, generatePreview); |
725 m_frontend.flush(); | 726 m_frontend.flush(); |
| 727 return m_inspector->hasConsoleMessageStorage(m_session->contextGroupId()); |
726 } | 728 } |
727 | 729 |
728 } // namespace v8_inspector | 730 } // namespace v8_inspector |
OLD | NEW |