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

Unified Diff: src/inspector/v8-console-message.cc

Issue 2906153002: [inspector] Support multiple sessions per context group (Closed)
Patch Set: using set per kozy@ Created 3 years, 7 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/v8-console.cc ('k') | src/inspector/v8-debugger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-console-message.cc
diff --git a/src/inspector/v8-console-message.cc b/src/inspector/v8-console-message.cc
index 22fe18137ede9a1cb1bda927634321fc7affd259..bdf572a4d066fb128566c06c79757338cec4d541 100644
--- a/src/inspector/v8-console-message.cc
+++ b/src/inspector/v8-console-message.cc
@@ -459,13 +459,12 @@ void V8ConsoleMessageStorage::addMessage(
V8InspectorImpl* inspector = m_inspector;
if (message->type() == ConsoleAPIType::kClear) clear();
- V8InspectorSessionImpl* session =
- inspector->sessionForContextGroup(contextGroupId);
- if (session) {
- if (message->origin() == V8MessageOrigin::kConsole)
- session->consoleAgent()->messageAdded(message.get());
- session->runtimeAgent()->messageAdded(message.get());
- }
+ inspector->forEachSession(
+ contextGroupId, [&message](V8InspectorSessionImpl* session) {
+ if (message->origin() == V8MessageOrigin::kConsole)
+ session->consoleAgent()->messageAdded(message.get());
+ session->runtimeAgent()->messageAdded(message.get());
+ });
if (!inspector->hasConsoleMessageStorage(contextGroupId)) return;
DCHECK(m_messages.size() <= maxConsoleMessageCount);
@@ -486,10 +485,10 @@ void V8ConsoleMessageStorage::addMessage(
void V8ConsoleMessageStorage::clear() {
m_messages.clear();
m_estimatedSize = 0;
- if (V8InspectorSessionImpl* session =
- m_inspector->sessionForContextGroup(m_contextGroupId)) {
- session->releaseObjectGroup("console");
- }
+ m_inspector->forEachSession(m_contextGroupId,
+ [](V8InspectorSessionImpl* session) {
+ session->releaseObjectGroup("console");
+ });
m_data.clear();
}
« no previous file with comments | « src/inspector/v8-console.cc ('k') | src/inspector/v8-debugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698