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

Unified Diff: src/debug-delay.js

Issue 18752: Added a lookup request to the debugger protocol to retreive an object from it... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 11 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 | « no previous file | src/mirror-delay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug-delay.js
===================================================================
--- src/debug-delay.js (revision 1131)
+++ src/debug-delay.js (working copy)
@@ -1071,6 +1071,8 @@
this.frameRequest_(request, response);
} else if (request.command == 'evaluate') {
this.evaluateRequest_(request, response);
+ } else if (request.command == 'lookup') {
+ this.lookupRequest_(request, response);
} else if (request.command == 'source') {
this.sourceRequest_(request, response);
} else if (request.command == 'scripts') {
@@ -1434,6 +1436,29 @@
};
+DebugCommandProcessor.prototype.lookupRequest_ = function(request, response) {
+ if (!request.arguments) {
+ return response.failed('Missing arguments');
+ }
+
+ // Pull out arguments.
+ var handle = request.arguments.handle;
+
+ // Check for legal arguments.
+ if (IS_UNDEFINED(handle)) {
+ return response.failed('Argument "handle" missing');
+ }
+
+ // Lookup handle.
+ var mirror = LookupMirror(handle);
+ if (mirror) {
+ response.body = mirror;
+ } else {
+ return response.failed('Object #' + handle + '# not found');
+ }
+};
+
+
DebugCommandProcessor.prototype.sourceRequest_ = function(request, response) {
// No frames no source.
if (this.exec_state_.frameCount() == 0) {
« no previous file with comments | « no previous file | src/mirror-delay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698