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

Side by Side Diff: src/inspector/V8ConsoleAgentImpl.cpp

Issue 2323173004: [inspector] handle context destroyed after console.log (Closed)
Patch Set: fix formatting 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
« no previous file with comments | « src/inspector/V8ConsoleAgentImpl.h ('k') | src/inspector/V8ConsoleMessage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/inspector/V8ConsoleAgentImpl.h" 5 #include "src/inspector/V8ConsoleAgentImpl.h"
6 6
7 #include "src/inspector/V8ConsoleMessage.h" 7 #include "src/inspector/V8ConsoleMessage.h"
8 #include "src/inspector/V8InspectorImpl.h" 8 #include "src/inspector/V8InspectorImpl.h"
9 #include "src/inspector/V8InspectorSessionImpl.h" 9 #include "src/inspector/V8InspectorSessionImpl.h"
10 #include "src/inspector/V8StackTraceImpl.h" 10 #include "src/inspector/V8StackTraceImpl.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 if (m_enabled) reportMessage(message, true); 54 if (m_enabled) reportMessage(message, true);
55 } 55 }
56 56
57 bool V8ConsoleAgentImpl::enabled() { return m_enabled; } 57 bool V8ConsoleAgentImpl::enabled() { return m_enabled; }
58 58
59 void V8ConsoleAgentImpl::reportAllMessages() { 59 void V8ConsoleAgentImpl::reportAllMessages() {
60 V8ConsoleMessageStorage* storage = 60 V8ConsoleMessageStorage* storage =
61 m_session->inspector()->ensureConsoleMessageStorage( 61 m_session->inspector()->ensureConsoleMessageStorage(
62 m_session->contextGroupId()); 62 m_session->contextGroupId());
63 for (const auto& message : storage->messages()) { 63 for (const auto& message : storage->messages()) {
64 if (message->origin() == V8MessageOrigin::kConsole) 64 if (message->origin() == V8MessageOrigin::kConsole) {
65 reportMessage(message.get(), false); 65 if (!reportMessage(message.get(), false)) return;
66 }
66 } 67 }
67 } 68 }
68 69
69 void V8ConsoleAgentImpl::reportMessage(V8ConsoleMessage* message, 70 bool V8ConsoleAgentImpl::reportMessage(V8ConsoleMessage* message,
70 bool generatePreview) { 71 bool generatePreview) {
71 DCHECK(message->origin() == V8MessageOrigin::kConsole); 72 DCHECK(message->origin() == V8MessageOrigin::kConsole);
72 message->reportToFrontend(&m_frontend); 73 message->reportToFrontend(&m_frontend);
73 m_frontend.flush(); 74 m_frontend.flush();
75 return m_session->inspector()->hasConsoleMessageStorage(
76 m_session->contextGroupId());
74 } 77 }
75 78
76 } // namespace v8_inspector 79 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/inspector/V8ConsoleAgentImpl.h ('k') | src/inspector/V8ConsoleMessage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698