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

Unified Diff: src/api.cc

Issue 172045: Added API for getting object mirrors (Closed)
Patch Set: Created 11 years, 4 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 | « include/v8-debug.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index c6068214de3368e0f2b26d8126aca5983969826f..23f934751ebfbb4c1787b6c0d745655b5c7b2c25 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3595,10 +3595,10 @@ void Debug::SetHostDispatchHandler(HostDispatchHandler handler,
}
-Handle<Value> Debug::Call(v8::Handle<v8::Function> fun,
- v8::Handle<v8::Value> data) {
- if (!i::V8::IsRunning()) return Handle<Value>();
- ON_BAILOUT("v8::Debug::Call()", return Handle<Value>());
+Local<Value> Debug::Call(v8::Handle<v8::Function> fun,
+ v8::Handle<v8::Value> data) {
+ if (!i::V8::IsRunning()) return Local<Value>();
+ ON_BAILOUT("v8::Debug::Call()", return Local<Value>());
ENTER_V8;
i::Handle<i::Object> result;
EXCEPTION_PREAMBLE();
@@ -3616,6 +3616,28 @@ Handle<Value> Debug::Call(v8::Handle<v8::Function> fun,
}
+Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) {
+ if (!i::V8::IsRunning()) return Local<Value>();
+ ON_BAILOUT("v8::Debug::GetMirror()", return Local<Value>());
+ ENTER_V8;
+ v8::HandleScope scope;
+ i::Debug::Load();
+ i::Handle<i::JSObject> debug(i::Debug::debug_context()->global());
+ i::Handle<i::String> name = i::Factory::LookupAsciiSymbol("MakeMirror");
+ i::Handle<i::Object> fun_obj = i::GetProperty(debug, name);
+ i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj);
+ v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun);
+ const int kArgc = 1;
+ v8::Handle<v8::Value> argv[kArgc] = { obj };
+ EXCEPTION_PREAMBLE();
+ v8::Handle<v8::Value> result = v8_fun->Call(Utils::ToLocal(debug),
+ kArgc,
+ argv);
+ EXCEPTION_BAILOUT_CHECK(Local<Value>());
+ return scope.Close(result);
+}
+
+
bool Debug::EnableAgent(const char* name, int port) {
return i::Debugger::StartAgent(name, port);
}
« no previous file with comments | « include/v8-debug.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698