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

Unified Diff: src/inspector/injected-script.cc

Issue 2905543004: [inspector] Prepare some methods in V8InspectorImpl to multiple sessions (Closed)
Patch Set: rebased 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/injected-script.h ('k') | src/inspector/v8-debugger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/injected-script.cc
diff --git a/src/inspector/injected-script.cc b/src/inspector/injected-script.cc
index b4183a735a250f8d0493050df0401404626b51a1..8f0eee16baf5f8412d4dafe2f0f44498f9eae133 100644
--- a/src/inspector/injected-script.cc
+++ b/src/inspector/injected-script.cc
@@ -415,22 +415,20 @@ v8::Local<v8::Object> InjectedScript::commandLineAPI() {
return m_commandLineAPI.Get(m_context->isolate());
}
-InjectedScript::Scope::Scope(V8InspectorImpl* inspector, int contextGroupId)
- : m_inspector(inspector),
- m_contextGroupId(contextGroupId),
+InjectedScript::Scope::Scope(V8InspectorSessionImpl* session)
+ : m_inspector(session->inspector()),
m_injectedScript(nullptr),
- m_handleScope(inspector->isolate()),
- m_tryCatch(inspector->isolate()),
+ m_handleScope(m_inspector->isolate()),
+ m_tryCatch(m_inspector->isolate()),
m_ignoreExceptionsAndMuteConsole(false),
m_previousPauseOnExceptionsState(v8::debug::NoBreakOnException),
- m_userGesture(false) {}
+ m_userGesture(false),
+ m_contextGroupId(session->contextGroupId()),
+ m_sessionId(session->sessionId()) {}
Response InjectedScript::Scope::initialize() {
cleanup();
- // TODO(dgozman): what if we reattach to the same context group during
- // evaluate? Introduce a session id?
- V8InspectorSessionImpl* session =
- m_inspector->sessionForContextGroup(m_contextGroupId);
+ V8InspectorSessionImpl* session = m_inspector->sessionById(m_sessionId);
if (!session) return Response::InternalError();
Response response = findInjectedScript(session);
if (!response.isSuccess()) return response;
@@ -489,10 +487,9 @@ InjectedScript::Scope::~Scope() {
cleanup();
}
-InjectedScript::ContextScope::ContextScope(V8InspectorImpl* inspector,
- int contextGroupId,
+InjectedScript::ContextScope::ContextScope(V8InspectorSessionImpl* session,
int executionContextId)
- : InjectedScript::Scope(inspector, contextGroupId),
+ : InjectedScript::Scope(session),
m_executionContextId(executionContextId) {}
InjectedScript::ContextScope::~ContextScope() {}
@@ -502,11 +499,9 @@ Response InjectedScript::ContextScope::findInjectedScript(
return session->findInjectedScript(m_executionContextId, m_injectedScript);
}
-InjectedScript::ObjectScope::ObjectScope(V8InspectorImpl* inspector,
- int contextGroupId,
+InjectedScript::ObjectScope::ObjectScope(V8InspectorSessionImpl* session,
const String16& remoteObjectId)
- : InjectedScript::Scope(inspector, contextGroupId),
- m_remoteObjectId(remoteObjectId) {}
+ : InjectedScript::Scope(session), m_remoteObjectId(remoteObjectId) {}
InjectedScript::ObjectScope::~ObjectScope() {}
@@ -525,11 +520,9 @@ Response InjectedScript::ObjectScope::findInjectedScript(
return Response::OK();
}
-InjectedScript::CallFrameScope::CallFrameScope(V8InspectorImpl* inspector,
- int contextGroupId,
+InjectedScript::CallFrameScope::CallFrameScope(V8InspectorSessionImpl* session,
const String16& remoteObjectId)
- : InjectedScript::Scope(inspector, contextGroupId),
- m_remoteCallFrameId(remoteObjectId) {}
+ : InjectedScript::Scope(session), m_remoteCallFrameId(remoteObjectId) {}
InjectedScript::CallFrameScope::~CallFrameScope() {}
« no previous file with comments | « src/inspector/injected-script.h ('k') | src/inspector/v8-debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698