OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1927 | 1927 |
1928 | 1928 |
1929 DebugCommandProcessor.prototype.profileRequest_ = function(request, response) { | 1929 DebugCommandProcessor.prototype.profileRequest_ = function(request, response) { |
1930 if (!request.arguments) { | 1930 if (!request.arguments) { |
1931 return response.failed('Missing arguments'); | 1931 return response.failed('Missing arguments'); |
1932 } | 1932 } |
1933 var modules = parseInt(request.arguments.modules); | 1933 var modules = parseInt(request.arguments.modules); |
1934 if (isNaN(modules)) { | 1934 if (isNaN(modules)) { |
1935 return response.failed('Modules is not an integer'); | 1935 return response.failed('Modules is not an integer'); |
1936 } | 1936 } |
| 1937 var tag = parseInt(request.arguments.tag); |
| 1938 if (isNaN(tag)) { |
| 1939 tag = 0; |
| 1940 } |
1937 if (request.arguments.command == 'resume') { | 1941 if (request.arguments.command == 'resume') { |
1938 %ProfilerResume(modules); | 1942 %ProfilerResume(modules, tag); |
1939 } else if (request.arguments.command == 'pause') { | 1943 } else if (request.arguments.command == 'pause') { |
1940 %ProfilerPause(modules); | 1944 %ProfilerPause(modules, tag); |
1941 } else { | 1945 } else { |
1942 return response.failed('Unknown command'); | 1946 return response.failed('Unknown command'); |
1943 } | 1947 } |
1944 response.body = {}; | 1948 response.body = {}; |
1945 }; | 1949 }; |
1946 | 1950 |
1947 | 1951 |
1948 // Check whether the previously processed command caused the VM to become | 1952 // Check whether the previously processed command caused the VM to become |
1949 // running. | 1953 // running. |
1950 DebugCommandProcessor.prototype.isRunning = function() { | 1954 DebugCommandProcessor.prototype.isRunning = function() { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2064 case 'string': | 2068 case 'string': |
2065 case 'number': | 2069 case 'number': |
2066 json = value; | 2070 json = value; |
2067 break | 2071 break |
2068 | 2072 |
2069 default: | 2073 default: |
2070 json = null; | 2074 json = null; |
2071 } | 2075 } |
2072 return json; | 2076 return json; |
2073 } | 2077 } |
OLD | NEW |