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

Unified Diff: src/inspector/V8RuntimeAgentImpl.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/inspector/V8RuntimeAgentImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/V8RuntimeAgentImpl.cpp
diff --git a/src/inspector/V8RuntimeAgentImpl.cpp b/src/inspector/V8RuntimeAgentImpl.cpp
index a59dcf4d54ab023c22523fa9bca0e443480c7f42..c018fba1feafefe15ab095e7709b17e87ce59e7b 100644
--- a/src/inspector/V8RuntimeAgentImpl.cpp
+++ b/src/inspector/V8RuntimeAgentImpl.cpp
@@ -658,8 +658,9 @@ void V8RuntimeAgentImpl::enable(ErrorString* errorString) {
m_session->reportAllContexts(this);
V8ConsoleMessageStorage* storage =
m_inspector->ensureConsoleMessageStorage(m_session->contextGroupId());
- for (const auto& message : storage->messages())
- reportMessage(message.get(), false);
+ for (const auto& message : storage->messages()) {
+ if (!reportMessage(message.get(), false)) return;
+ }
}
void V8RuntimeAgentImpl::disable(ErrorString* errorString) {
@@ -719,10 +720,11 @@ void V8RuntimeAgentImpl::messageAdded(V8ConsoleMessage* message) {
if (m_enabled) reportMessage(message, true);
}
-void V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message,
+bool V8RuntimeAgentImpl::reportMessage(V8ConsoleMessage* message,
bool generatePreview) {
message->reportToFrontend(&m_frontend, m_session, generatePreview);
m_frontend.flush();
+ return m_inspector->hasConsoleMessageStorage(m_session->contextGroupId());
}
} // namespace v8_inspector
« no previous file with comments | « src/inspector/V8RuntimeAgentImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698