OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview DevTools' implementation of the InspectorController API. | 6 * @fileoverview DevTools' implementation of the InspectorController API. |
7 */ | 7 */ |
8 goog.require('devtools.InspectorController'); | 8 goog.require('devtools.InspectorController'); |
9 | 9 |
10 goog.provide('devtools.InspectorControllerImpl'); | 10 goog.provide('devtools.InspectorControllerImpl'); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 */ | 241 */ |
242 devtools.InspectorControllerImpl.prototype.stopProfiling = function() { | 242 devtools.InspectorControllerImpl.prototype.stopProfiling = function() { |
243 devtools.tools.getDebuggerAgent().stopProfiling( | 243 devtools.tools.getDebuggerAgent().stopProfiling( |
244 devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_CPU); | 244 devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_CPU); |
245 }; | 245 }; |
246 | 246 |
247 | 247 |
248 /** | 248 /** |
249 * @override | 249 * @override |
250 */ | 250 */ |
| 251 devtools.InspectorControllerImpl.prototype.getProfileHeaders = function(callId)
{ |
| 252 WebInspector.didGetProfileHeaders(callId, []); |
| 253 }; |
| 254 |
| 255 |
| 256 /** |
| 257 * Emulate WebKit InspectorController behavior. It stores profiles on renderer s
ide, |
| 258 * and is able to retrieve them by uid using 'getProfile'. |
| 259 */ |
| 260 devtools.InspectorControllerImpl.prototype.addFullProfile = function(profile) { |
| 261 WebInspector.__fullProfiles = WebInspector.__fullProfiles || {}; |
| 262 WebInspector.__fullProfiles[profile.uid] = profile; |
| 263 }; |
| 264 |
| 265 |
| 266 /** |
| 267 * @override |
| 268 */ |
| 269 devtools.InspectorControllerImpl.prototype.getProfile = function(callId, uid) { |
| 270 if (WebInspector.__fullProfiles && (uid in WebInspector.__fullProfiles)) { |
| 271 WebInspector.didGetProfile(callId, WebInspector.__fullProfiles[uid]); |
| 272 } |
| 273 }; |
| 274 |
| 275 |
| 276 /** |
| 277 * @override |
| 278 */ |
251 devtools.InspectorControllerImpl.prototype.takeHeapSnapshot = function() { | 279 devtools.InspectorControllerImpl.prototype.takeHeapSnapshot = function() { |
252 devtools.tools.getDebuggerAgent().startProfiling( | 280 devtools.tools.getDebuggerAgent().startProfiling( |
253 devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT | 281 devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT |
254 | devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_HEAP_STATS | 282 | devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_HEAP_STATS |
255 | devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_JS_CONSTRUCTORS); | 283 | devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_JS_CONSTRUCTORS); |
256 }; | 284 }; |
257 | 285 |
258 | 286 |
259 /** | 287 /** |
260 * @override | 288 * @override |
(...skipping 29 matching lines...) Expand all Loading... |
290 function(methodName, var_arg) { | 318 function(methodName, var_arg) { |
291 var args = Array.prototype.slice.call(arguments, 1); | 319 var args = Array.prototype.slice.call(arguments, 1); |
292 RemoteToolsAgent.DispatchOnInspectorController( | 320 RemoteToolsAgent.DispatchOnInspectorController( |
293 WebInspector.Callback.wrap(function(){}), | 321 WebInspector.Callback.wrap(function(){}), |
294 methodName, | 322 methodName, |
295 JSON.stringify(args)); | 323 JSON.stringify(args)); |
296 }; | 324 }; |
297 | 325 |
298 | 326 |
299 InspectorController = new devtools.InspectorControllerImpl(); | 327 InspectorController = new devtools.InspectorControllerImpl(); |
OLD | NEW |