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

Unified Diff: test/inspector/inspector-test.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/v8-inspector-session-impl.cc ('k') | test/inspector/isolate-data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/inspector-test.cc
diff --git a/test/inspector/inspector-test.cc b/test/inspector/inspector-test.cc
index cf53e4f42f8a3c063d7d2fd873526a579a77ce11..930d6c9477c243c9c67e6505f0722b19af50e1d6 100644
--- a/test/inspector/inspector-test.cc
+++ b/test/inspector/inspector-test.cc
@@ -642,6 +642,9 @@ class InspectorExtension : public IsolateData::SetupGlobalTask {
inspector->Set(ToV8String(isolate, "fireContextDestroyed"),
v8::FunctionTemplate::New(
isolate, &InspectorExtension::FireContextDestroyed));
+ inspector->Set(ToV8String(isolate, "addInspectedObject"),
+ v8::FunctionTemplate::New(
+ isolate, &InspectorExtension::AddInspectedObject));
inspector->Set(ToV8String(isolate, "setMaxAsyncTaskStacks"),
v8::FunctionTemplate::New(
isolate, &InspectorExtension::SetMaxAsyncTaskStacks));
@@ -680,6 +683,18 @@ class InspectorExtension : public IsolateData::SetupGlobalTask {
data->FireContextDestroyed(context);
}
+ static void AddInspectedObject(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
+ if (args.Length() != 2 || !args[0]->IsInt32()) {
+ fprintf(stderr,
+ "Internal error: addInspectedObject(session_id, object).");
+ Exit();
+ }
+ v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext();
+ IsolateData* data = IsolateData::FromContext(context);
+ data->AddInspectedObject(args[0].As<v8::Int32>()->Value(), args[1]);
+ }
+
static void SetMaxAsyncTaskStacks(
const v8::FunctionCallbackInfo<v8::Value>& args) {
if (args.Length() != 1 || !args[0]->IsInt32()) {
« no previous file with comments | « src/inspector/v8-inspector-session-impl.cc ('k') | test/inspector/isolate-data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698