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

Unified Diff: src/inspector/v8-runtime-agent-impl.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-inspector-impl.cc ('k') | test/inspector/debugger/set-skip-all-pauses.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-runtime-agent-impl.cc
diff --git a/src/inspector/v8-runtime-agent-impl.cc b/src/inspector/v8-runtime-agent-impl.cc
index cfdef02618d5309bb66cc7343c3f2789b4ffaca2..23fab887ea01dd7ecd701a91a1a4e834976f33c8 100644
--- a/src/inspector/v8-runtime-agent-impl.cc
+++ b/src/inspector/v8-runtime-agent-impl.cc
@@ -161,6 +161,7 @@ class ProtocolPromiseHandler {
std::unique_ptr<Callback> callback)
: m_inspector(session->inspector()),
m_sessionId(session->sessionId()),
+ m_contextGroupId(session->contextGroupId()),
m_executionContextId(executionContextId),
m_objectGroup(objectGroup),
m_returnByValue(returnByValue),
@@ -185,7 +186,8 @@ class ProtocolPromiseHandler {
std::unique_ptr<protocol::Runtime::RemoteObject> wrapObject(
v8::Local<v8::Value> value) {
- V8InspectorSessionImpl* session = m_inspector->sessionById(m_sessionId);
+ V8InspectorSessionImpl* session =
+ m_inspector->sessionById(m_contextGroupId, m_sessionId);
if (!session) {
m_callback->sendFailure(Response::Error("No session"));
return nullptr;
@@ -209,6 +211,7 @@ class ProtocolPromiseHandler {
V8InspectorImpl* m_inspector;
int m_sessionId;
+ int m_contextGroupId;
int m_executionContextId;
String16 m_objectGroup;
bool m_returnByValue;
@@ -696,9 +699,11 @@ Response V8RuntimeAgentImpl::disable() {
void V8RuntimeAgentImpl::reset() {
m_compiledScripts.clear();
if (m_enabled) {
- m_inspector->forEachContext(
- m_session->contextGroupId(),
- [](InspectedContext* context) { context->setReported(false); });
+ int sessionId = m_session->sessionId();
+ m_inspector->forEachContext(m_session->contextGroupId(),
+ [&sessionId](InspectedContext* context) {
+ context->setReported(sessionId, false);
+ });
m_frontend.executionContextsCleared();
}
}
@@ -706,7 +711,7 @@ void V8RuntimeAgentImpl::reset() {
void V8RuntimeAgentImpl::reportExecutionContextCreated(
InspectedContext* context) {
if (!m_enabled) return;
- context->setReported(true);
+ context->setReported(m_session->sessionId(), true);
std::unique_ptr<protocol::Runtime::ExecutionContextDescription> description =
protocol::Runtime::ExecutionContextDescription::create()
.setId(context->contextId())
@@ -721,8 +726,8 @@ void V8RuntimeAgentImpl::reportExecutionContextCreated(
void V8RuntimeAgentImpl::reportExecutionContextDestroyed(
InspectedContext* context) {
- if (m_enabled && context->isReported()) {
- context->setReported(false);
+ if (m_enabled && context->isReported(m_session->sessionId())) {
+ context->setReported(m_session->sessionId(), false);
m_frontend.executionContextDestroyed(context->contextId());
}
}
« no previous file with comments | « src/inspector/v8-inspector-impl.cc ('k') | test/inspector/debugger/set-skip-all-pauses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698