| 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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 } | 1195 } |
| 1196 | 1196 |
| 1197 if (request.type != 'request') { | 1197 if (request.type != 'request') { |
| 1198 throw new Error("Illegal type '" + request.type + "' in request"); | 1198 throw new Error("Illegal type '" + request.type + "' in request"); |
| 1199 } | 1199 } |
| 1200 | 1200 |
| 1201 if (!request.command) { | 1201 if (!request.command) { |
| 1202 throw new Error('Command not specified'); | 1202 throw new Error('Command not specified'); |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 // TODO(yurys): remove request.arguments.compactFormat check once | 1205 if (request.arguments) { |
| 1206 // ChromeDevTools are switched to 'inlineRefs' | 1206 var args = request.arguments; |
| 1207 if (request.arguments && (request.arguments.inlineRefs || | 1207 // TODO(yurys): remove request.arguments.compactFormat check once |
| 1208 request.arguments.compactFormat)) { | 1208 // ChromeDevTools are switched to 'inlineRefs' |
| 1209 response.setOption('inlineRefs', true); | 1209 if (args.inlineRefs || args.compactFormat) { |
| 1210 response.setOption('inlineRefs', true); |
| 1211 } |
| 1212 if (!IS_UNDEFINED(args.maxStringLength)) { |
| 1213 response.setOption('maxStringLength', args.maxStringLength); |
| 1214 } |
| 1210 } | 1215 } |
| 1211 | 1216 |
| 1212 if (request.command == 'continue') { | 1217 if (request.command == 'continue') { |
| 1213 this.continueRequest_(request, response); | 1218 this.continueRequest_(request, response); |
| 1214 } else if (request.command == 'break') { | 1219 } else if (request.command == 'break') { |
| 1215 this.breakRequest_(request, response); | 1220 this.breakRequest_(request, response); |
| 1216 } else if (request.command == 'setbreakpoint') { | 1221 } else if (request.command == 'setbreakpoint') { |
| 1217 this.setBreakPointRequest_(request, response); | 1222 this.setBreakPointRequest_(request, response); |
| 1218 } else if (request.command == 'changebreakpoint') { | 1223 } else if (request.command == 'changebreakpoint') { |
| 1219 this.changeBreakPointRequest_(request, response); | 1224 this.changeBreakPointRequest_(request, response); |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 | 1932 |
| 1928 | 1933 |
| 1929 DebugCommandProcessor.prototype.profileRequest_ = function(request, response) { | 1934 DebugCommandProcessor.prototype.profileRequest_ = function(request, response) { |
| 1930 if (!request.arguments) { | 1935 if (!request.arguments) { |
| 1931 return response.failed('Missing arguments'); | 1936 return response.failed('Missing arguments'); |
| 1932 } | 1937 } |
| 1933 var modules = parseInt(request.arguments.modules); | 1938 var modules = parseInt(request.arguments.modules); |
| 1934 if (isNaN(modules)) { | 1939 if (isNaN(modules)) { |
| 1935 return response.failed('Modules is not an integer'); | 1940 return response.failed('Modules is not an integer'); |
| 1936 } | 1941 } |
| 1942 var tag = parseInt(request.arguments.tag); |
| 1943 if (isNaN(tag)) { |
| 1944 tag = 0; |
| 1945 } |
| 1937 if (request.arguments.command == 'resume') { | 1946 if (request.arguments.command == 'resume') { |
| 1938 %ProfilerResume(modules); | 1947 %ProfilerResume(modules, tag); |
| 1939 } else if (request.arguments.command == 'pause') { | 1948 } else if (request.arguments.command == 'pause') { |
| 1940 %ProfilerPause(modules); | 1949 %ProfilerPause(modules, tag); |
| 1941 } else { | 1950 } else { |
| 1942 return response.failed('Unknown command'); | 1951 return response.failed('Unknown command'); |
| 1943 } | 1952 } |
| 1944 response.body = {}; | 1953 response.body = {}; |
| 1945 }; | 1954 }; |
| 1946 | 1955 |
| 1947 | 1956 |
| 1948 // Check whether the previously processed command caused the VM to become | 1957 // Check whether the previously processed command caused the VM to become |
| 1949 // running. | 1958 // running. |
| 1950 DebugCommandProcessor.prototype.isRunning = function() { | 1959 DebugCommandProcessor.prototype.isRunning = function() { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2064 case 'string': | 2073 case 'string': |
| 2065 case 'number': | 2074 case 'number': |
| 2066 json = value; | 2075 json = value; |
| 2067 break | 2076 break |
| 2068 | 2077 |
| 2069 default: | 2078 default: |
| 2070 json = null; | 2079 json = null; |
| 2071 } | 2080 } |
| 2072 return json; | 2081 return json; |
| 2073 } | 2082 } |
| OLD | NEW |