| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyrightdd | 8 * * Redistributions of source code must retain the above copyrightdd |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 this._postMessage({callId: this._nextCallId++, disposition: "dispose", o
bjectId: objectId}); | 70 this._postMessage({callId: this._nextCallId++, disposition: "dispose", o
bjectId: objectId}); |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 evaluateForTest: function(script, callback) | 73 evaluateForTest: function(script, callback) |
| 74 { | 74 { |
| 75 var callId = this._nextCallId++; | 75 var callId = this._nextCallId++; |
| 76 this._callbacks[callId] = callback; | 76 this._callbacks[callId] = callback; |
| 77 this._postMessage({callId: callId, disposition: "evaluateForTest", sourc
e: script}); | 77 this._postMessage({callId: callId, disposition: "evaluateForTest", sourc
e: script}); |
| 78 }, | 78 }, |
| 79 | 79 |
| 80 callGetter: function(callback, objectId, getterName) | |
| 81 { | |
| 82 var callId = this._nextCallId++; | |
| 83 this._callbacks[callId] = callback; | |
| 84 this._postMessage({callId: callId, disposition: "getter", objectId: obje
ctId, methodName: getterName}); | |
| 85 }, | |
| 86 | |
| 87 /** | 80 /** |
| 88 * @param {?function(...[?])} callback | 81 * @param {?function(...[?])} callback |
| 89 * @param {string} objectId | 82 * @param {string} objectId |
| 90 * @param {string} methodName | 83 * @param {string} methodName |
| 91 * @param {function(new:T, ...[?])} proxyConstructor | 84 * @param {function(new:T, ...[?])} proxyConstructor |
| 92 * @return {?Object} | 85 * @return {?Object} |
| 93 * @template T | 86 * @template T |
| 94 */ | 87 */ |
| 95 callFactoryMethod: function(callback, objectId, methodName, proxyConstructor
) | 88 callFactoryMethod: function(callback, objectId, methodName, proxyConstructor
) |
| 96 { | 89 { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 * @return {?WebInspector.HeapSnapshotProviderProxy} | 219 * @return {?WebInspector.HeapSnapshotProviderProxy} |
| 227 * @template T | 220 * @template T |
| 228 */ | 221 */ |
| 229 callFactoryMethod: function(callback, methodName, proxyConstructor, var_args
) | 222 callFactoryMethod: function(callback, methodName, proxyConstructor, var_args
) |
| 230 { | 223 { |
| 231 return this._callWorker("callFactoryMethod", Array.prototype.slice.call(
arguments, 0)); | 224 return this._callWorker("callFactoryMethod", Array.prototype.slice.call(
arguments, 0)); |
| 232 }, | 225 }, |
| 233 | 226 |
| 234 /** | 227 /** |
| 235 * @param {function(T)|undefined} callback | 228 * @param {function(T)|undefined} callback |
| 236 * @param {string} getterName | |
| 237 * @return {*} | |
| 238 * @template T | |
| 239 */ | |
| 240 callGetter: function(callback, getterName) | |
| 241 { | |
| 242 return this._callWorker("callGetter", Array.prototype.slice.call(argumen
ts, 0)); | |
| 243 }, | |
| 244 | |
| 245 /** | |
| 246 * @param {function(T)|undefined} callback | |
| 247 * @param {string} methodName | 229 * @param {string} methodName |
| 248 * @param {...*} var_args | 230 * @param {...*} var_args |
| 249 * @return {*} | 231 * @return {*} |
| 250 * @template T | 232 * @template T |
| 251 */ | 233 */ |
| 252 callMethod: function(callback, methodName, var_args) | 234 callMethod: function(callback, methodName, var_args) |
| 253 { | 235 { |
| 254 return this._callWorker("callMethod", Array.prototype.slice.call(argumen
ts, 0)); | 236 return this._callWorker("callMethod", Array.prototype.slice.call(argumen
ts, 0)); |
| 255 }, | |
| 256 | |
| 257 get worker() { | |
| 258 return this._worker; | |
| 259 } | 237 } |
| 260 }; | 238 }; |
| 261 | 239 |
| 262 /** | 240 /** |
| 263 * @constructor | 241 * @constructor |
| 264 * @extends {WebInspector.HeapSnapshotProxyObject} | 242 * @extends {WebInspector.HeapSnapshotProxyObject} |
| 265 * @implements {WebInspector.OutputStream} | 243 * @implements {WebInspector.OutputStream} |
| 266 * @param {number} objectId | 244 * @param {number} objectId |
| 267 * @param {number} profileUid | 245 * @param {number} profileUid |
| 268 * @param {function(!WebInspector.HeapSnapshotProxy)} snapshotReceivedCallback | 246 * @param {function(!WebInspector.HeapSnapshotProxy)} snapshotReceivedCallback |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 }, | 334 }, |
| 357 | 335 |
| 358 dominatorIdsForNode: function(nodeIndex, callback) | 336 dominatorIdsForNode: function(nodeIndex, callback) |
| 359 { | 337 { |
| 360 this.callMethod(callback, "dominatorIdsForNode", nodeIndex); | 338 this.callMethod(callback, "dominatorIdsForNode", nodeIndex); |
| 361 }, | 339 }, |
| 362 | 340 |
| 363 /** | 341 /** |
| 364 * @param {number} nodeIndex | 342 * @param {number} nodeIndex |
| 365 * @param {boolean} showHiddenData | 343 * @param {boolean} showHiddenData |
| 366 * @return {?WebInspector.HeapSnapshotProviderProxy} | 344 * @return {!WebInspector.HeapSnapshotProviderProxy} |
| 367 */ | 345 */ |
| 368 createEdgesProvider: function(nodeIndex, showHiddenData) | 346 createEdgesProvider: function(nodeIndex, showHiddenData) |
| 369 { | 347 { |
| 370 return this.callFactoryMethod(null, "createEdgesProvider", WebInspector.
HeapSnapshotProviderProxy, nodeIndex, showHiddenData); | 348 return /** @type {!WebInspector.HeapSnapshotProviderProxy} */ (this.call
FactoryMethod(null, "createEdgesProvider", WebInspector.HeapSnapshotProviderProx
y, nodeIndex, showHiddenData)); |
| 371 }, | 349 }, |
| 372 | 350 |
| 373 /** | 351 /** |
| 374 * @param {number} nodeIndex | 352 * @param {number} nodeIndex |
| 375 * @param {boolean} showHiddenData | 353 * @param {boolean} showHiddenData |
| 376 * @return {?WebInspector.HeapSnapshotProviderProxy} | 354 * @return {!WebInspector.HeapSnapshotProviderProxy} |
| 377 */ | 355 */ |
| 378 createRetainingEdgesProvider: function(nodeIndex, showHiddenData) | 356 createRetainingEdgesProvider: function(nodeIndex, showHiddenData) |
| 379 { | 357 { |
| 380 return this.callFactoryMethod(null, "createRetainingEdgesProvider", WebI
nspector.HeapSnapshotProviderProxy, nodeIndex, showHiddenData); | 358 return /** @type {!WebInspector.HeapSnapshotProviderProxy} */ (this.call
FactoryMethod(null, "createRetainingEdgesProvider", WebInspector.HeapSnapshotPro
viderProxy, nodeIndex, showHiddenData)); |
| 381 }, | 359 }, |
| 382 | 360 |
| 383 /** | 361 /** |
| 384 * @param {string} baseSnapshotId | 362 * @param {string} baseSnapshotId |
| 385 * @param {string} className | 363 * @param {string} className |
| 386 * @return {?WebInspector.HeapSnapshotProviderProxy} | 364 * @return {?WebInspector.HeapSnapshotProviderProxy} |
| 387 */ | 365 */ |
| 388 createAddedNodesProvider: function(baseSnapshotId, className) | 366 createAddedNodesProvider: function(baseSnapshotId, className) |
| 389 { | 367 { |
| 390 return this.callFactoryMethod(null, "createAddedNodesProvider", WebInspe
ctor.HeapSnapshotProviderProxy, baseSnapshotId, className); | 368 return this.callFactoryMethod(null, "createAddedNodesProvider", WebInspe
ctor.HeapSnapshotProviderProxy, baseSnapshotId, className); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 * @param {!WebInspector.HeapSnapshotCommon.ComparatorConfig} comparator | 531 * @param {!WebInspector.HeapSnapshotCommon.ComparatorConfig} comparator |
| 554 * @param {function()} callback | 532 * @param {function()} callback |
| 555 */ | 533 */ |
| 556 sortAndRewind: function(comparator, callback) | 534 sortAndRewind: function(comparator, callback) |
| 557 { | 535 { |
| 558 this.callMethod(callback, "sortAndRewind", comparator); | 536 this.callMethod(callback, "sortAndRewind", comparator); |
| 559 }, | 537 }, |
| 560 | 538 |
| 561 __proto__: WebInspector.HeapSnapshotProxyObject.prototype | 539 __proto__: WebInspector.HeapSnapshotProxyObject.prototype |
| 562 } | 540 } |
| OLD | NEW |