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()) { |