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

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

Issue 2916803005: [inspector] Create InjectedScript per session in each context (Closed)
Patch Set: rebased Created 3 years, 6 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/inspected-context.h » ('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 bf267075f04b545da12305b5850d3f65ff2699ae..4a10bb42d4693522134b0670b1d925afa89a29f2 100644
--- a/src/inspector/injected-script.cc
+++ b/src/inspector/injected-script.cc
@@ -58,7 +58,7 @@ using protocol::Runtime::RemoteObject;
using protocol::Maybe;
std::unique_ptr<InjectedScript> InjectedScript::create(
- InspectedContext* inspectedContext) {
+ InspectedContext* inspectedContext, int sessionId) {
v8::Isolate* isolate = inspectedContext->isolate();
v8::HandleScope handles(isolate);
v8::Local<v8::Context> context = inspectedContext->context();
@@ -106,7 +106,7 @@ std::unique_ptr<InjectedScript> InjectedScript::create(
if (!injectedScriptValue->IsObject()) return nullptr;
std::unique_ptr<InjectedScript> injectedScript(new InjectedScript(
- inspectedContext, injectedScriptValue.As<v8::Object>()));
+ inspectedContext, injectedScriptValue.As<v8::Object>(), sessionId));
v8::Local<v8::Private> privateKey = v8::Private::ForApi(
isolate, v8::String::NewFromUtf8(isolate, privateKeyName,
v8::NewStringType::kInternalized)
@@ -117,8 +117,10 @@ std::unique_ptr<InjectedScript> InjectedScript::create(
}
InjectedScript::InjectedScript(InspectedContext* context,
- v8::Local<v8::Object> object)
- : m_context(context), m_value(context->isolate(), object) {}
+ v8::Local<v8::Object> object, int sessionId)
+ : m_context(context),
+ m_value(context->isolate(), object),
+ m_sessionId(sessionId) {}
InjectedScript::~InjectedScript() {}
@@ -420,7 +422,7 @@ v8::Local<v8::Object> InjectedScript::commandLineAPI() {
m_commandLineAPI.Reset(
m_context->isolate(),
m_context->inspector()->console()->createCommandLineAPI(
- m_context->context()));
+ m_context->context(), m_sessionId));
}
return m_commandLineAPI.Get(m_context->isolate());
}
« no previous file with comments | « src/inspector/injected-script.h ('k') | src/inspector/inspected-context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698