Index: src/debug-delay.js |
diff --git a/src/debug-delay.js b/src/debug-delay.js |
index 35f7fcd7e4966818d52ac5839db49845fb33980c..04fde1f99006b389e914cbb1fc27d9410bf779ef 100644 |
--- a/src/debug-delay.js |
+++ b/src/debug-delay.js |
@@ -1245,6 +1245,8 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request) |
this.suspendRequest_(request, response); |
} else if (request.command == 'version') { |
this.versionRequest_(request, response); |
+ } else if (request.command == 'profile') { |
+ this.profileRequest_(request, response); |
} else { |
throw new Error('Unknown command "' + request.command + '" in request'); |
} |
@@ -1924,6 +1926,25 @@ DebugCommandProcessor.prototype.versionRequest_ = function(request, response) { |
}; |
+DebugCommandProcessor.prototype.profileRequest_ = function(request, response) { |
+ if (!request.arguments) { |
+ return response.failed('Missing arguments'); |
+ } |
+ var modules = parseInt(request.arguments.modules); |
+ if (isNaN(modules)) { |
+ return response.failed('Modules is not an integer'); |
+ } |
+ if (request.arguments.command == 'resume') { |
+ %ProfilerResume(modules); |
+ } else if (request.arguments.command == 'pause') { |
+ %ProfilerPause(modules); |
+ } else { |
+ return response.failed('Unknown command'); |
+ } |
+ response.body = {}; |
+}; |
+ |
+ |
// Check whether the previously processed command caused the VM to become |
// running. |
DebugCommandProcessor.prototype.isRunning = function() { |