Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotProxy.js

Issue 2493373002: DevTools: rename WebInspector into modules. (Closed)
Patch Set: for bots Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @unrestricted 32 * @unrestricted
33 */ 33 */
34 WebInspector.HeapSnapshotWorkerProxy = class extends WebInspector.Object { 34 Profiler.HeapSnapshotWorkerProxy = class extends Common.Object {
35 /** 35 /**
36 * @param {function(string, *)} eventHandler 36 * @param {function(string, *)} eventHandler
37 */ 37 */
38 constructor(eventHandler) { 38 constructor(eventHandler) {
39 super(); 39 super();
40 this._eventHandler = eventHandler; 40 this._eventHandler = eventHandler;
41 this._nextObjectId = 1; 41 this._nextObjectId = 1;
42 this._nextCallId = 1; 42 this._nextCallId = 1;
43 /** @type {!Map<number, function(*)>} */ 43 /** @type {!Map<number, function(*)>} */
44 this._callbacks = new Map(); 44 this._callbacks = new Map();
45 /** @type {!Set<number>} */ 45 /** @type {!Set<number>} */
46 this._previousCallbacks = new Set(); 46 this._previousCallbacks = new Set();
47 this._worker = new WebInspector.Worker('heap_snapshot_worker'); 47 this._worker = new Common.Worker('heap_snapshot_worker');
48 this._worker.onmessage = this._messageReceived.bind(this); 48 this._worker.onmessage = this._messageReceived.bind(this);
49 } 49 }
50 50
51 /** 51 /**
52 * @param {number} profileUid 52 * @param {number} profileUid
53 * @param {function(!WebInspector.HeapSnapshotProxy)} snapshotReceivedCallback 53 * @param {function(!Profiler.HeapSnapshotProxy)} snapshotReceivedCallback
54 * @return {!WebInspector.HeapSnapshotLoaderProxy} 54 * @return {!Profiler.HeapSnapshotLoaderProxy}
55 */ 55 */
56 createLoader(profileUid, snapshotReceivedCallback) { 56 createLoader(profileUid, snapshotReceivedCallback) {
57 var objectId = this._nextObjectId++; 57 var objectId = this._nextObjectId++;
58 var proxy = new WebInspector.HeapSnapshotLoaderProxy(this, objectId, profile Uid, snapshotReceivedCallback); 58 var proxy = new Profiler.HeapSnapshotLoaderProxy(this, objectId, profileUid, snapshotReceivedCallback);
59 this._postMessage({ 59 this._postMessage({
60 callId: this._nextCallId++, 60 callId: this._nextCallId++,
61 disposition: 'create', 61 disposition: 'create',
62 objectId: objectId, 62 objectId: objectId,
63 methodName: 'WebInspector.HeapSnapshotLoader' 63 methodName: 'HeapSnapshotWorker.HeapSnapshotLoader'
64 }); 64 });
65 return proxy; 65 return proxy;
66 } 66 }
67 67
68 dispose() { 68 dispose() {
69 this._worker.terminate(); 69 this._worker.terminate();
70 if (this._interval) 70 if (this._interval)
71 clearInterval(this._interval); 71 clearInterval(this._interval);
72 } 72 }
73 73
(...skipping 14 matching lines...) Expand all
88 * @param {function(new:T, ...?)} proxyConstructor 88 * @param {function(new:T, ...?)} proxyConstructor
89 * @return {?Object} 89 * @return {?Object}
90 * @template T 90 * @template T
91 */ 91 */
92 callFactoryMethod(callback, objectId, methodName, proxyConstructor) { 92 callFactoryMethod(callback, objectId, methodName, proxyConstructor) {
93 var callId = this._nextCallId++; 93 var callId = this._nextCallId++;
94 var methodArguments = Array.prototype.slice.call(arguments, 4); 94 var methodArguments = Array.prototype.slice.call(arguments, 4);
95 var newObjectId = this._nextObjectId++; 95 var newObjectId = this._nextObjectId++;
96 96
97 /** 97 /**
98 * @this {WebInspector.HeapSnapshotWorkerProxy} 98 * @this {Profiler.HeapSnapshotWorkerProxy}
99 */ 99 */
100 function wrapCallback(remoteResult) { 100 function wrapCallback(remoteResult) {
101 callback(remoteResult ? new proxyConstructor(this, newObjectId) : null); 101 callback(remoteResult ? new proxyConstructor(this, newObjectId) : null);
102 } 102 }
103 103
104 if (callback) { 104 if (callback) {
105 this._callbacks.set(callId, wrapCallback.bind(this)); 105 this._callbacks.set(callId, wrapCallback.bind(this));
106 this._postMessage({ 106 this._postMessage({
107 callId: callId, 107 callId: callId,
108 disposition: 'factory', 108 disposition: 'factory',
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 */ 166 */
167 _messageReceived(event) { 167 _messageReceived(event) {
168 var data = event.data; 168 var data = event.data;
169 if (data.eventName) { 169 if (data.eventName) {
170 if (this._eventHandler) 170 if (this._eventHandler)
171 this._eventHandler(data.eventName, data.data); 171 this._eventHandler(data.eventName, data.data);
172 return; 172 return;
173 } 173 }
174 if (data.error) { 174 if (data.error) {
175 if (data.errorMethodName) 175 if (data.errorMethodName)
176 WebInspector.console.error(WebInspector.UIString( 176 Common.console.error(Common.UIString(
177 'An error occurred when a call to method \'%s\' was requested', data .errorMethodName)); 177 'An error occurred when a call to method \'%s\' was requested', data .errorMethodName));
178 WebInspector.console.error(data['errorCallStack']); 178 Common.console.error(data['errorCallStack']);
179 this._callbacks.delete(data.callId); 179 this._callbacks.delete(data.callId);
180 return; 180 return;
181 } 181 }
182 if (!this._callbacks.has(data.callId)) 182 if (!this._callbacks.has(data.callId))
183 return; 183 return;
184 var callback = this._callbacks.get(data.callId); 184 var callback = this._callbacks.get(data.callId);
185 this._callbacks.delete(data.callId); 185 this._callbacks.delete(data.callId);
186 callback(data.result); 186 callback(data.result);
187 } 187 }
188 188
189 _postMessage(message) { 189 _postMessage(message) {
190 this._worker.postMessage(message); 190 this._worker.postMessage(message);
191 } 191 }
192 }; 192 };
193 193
194 /** 194 /**
195 * @unrestricted 195 * @unrestricted
196 */ 196 */
197 WebInspector.HeapSnapshotProxyObject = class { 197 Profiler.HeapSnapshotProxyObject = class {
198 /** 198 /**
199 * @param {!WebInspector.HeapSnapshotWorkerProxy} worker 199 * @param {!Profiler.HeapSnapshotWorkerProxy} worker
200 * @param {number} objectId 200 * @param {number} objectId
201 */ 201 */
202 constructor(worker, objectId) { 202 constructor(worker, objectId) {
203 this._worker = worker; 203 this._worker = worker;
204 this._objectId = objectId; 204 this._objectId = objectId;
205 } 205 }
206 206
207 /** 207 /**
208 * @param {string} workerMethodName 208 * @param {string} workerMethodName
209 * @param {!Array.<*>} args 209 * @param {!Array.<*>} args
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 /** 247 /**
248 * @param {string} methodName 248 * @param {string} methodName
249 * @param {...*} var_args 249 * @param {...*} var_args
250 * @return {!Promise.<?T>} 250 * @return {!Promise.<?T>}
251 * @template T 251 * @template T
252 */ 252 */
253 _callMethodPromise(methodName, var_args) { 253 _callMethodPromise(methodName, var_args) {
254 /** 254 /**
255 * @param {!Array.<*>} args 255 * @param {!Array.<*>} args
256 * @param {function(?T)} fulfill 256 * @param {function(?T)} fulfill
257 * @this {WebInspector.HeapSnapshotProxyObject} 257 * @this {Profiler.HeapSnapshotProxyObject}
258 * @template T 258 * @template T
259 */ 259 */
260 function action(args, fulfill) { 260 function action(args, fulfill) {
261 this._callWorker('callMethod', [fulfill].concat(args)); 261 this._callWorker('callMethod', [fulfill].concat(args));
262 } 262 }
263 return new Promise(action.bind(this, Array.prototype.slice.call(arguments))) ; 263 return new Promise(action.bind(this, Array.prototype.slice.call(arguments))) ;
264 } 264 }
265 }; 265 };
266 266
267 /** 267 /**
268 * @implements {WebInspector.OutputStream} 268 * @implements {Common.OutputStream}
269 * @unrestricted 269 * @unrestricted
270 */ 270 */
271 WebInspector.HeapSnapshotLoaderProxy = class extends WebInspector.HeapSnapshotPr oxyObject { 271 Profiler.HeapSnapshotLoaderProxy = class extends Profiler.HeapSnapshotProxyObjec t {
272 /** 272 /**
273 * @param {!WebInspector.HeapSnapshotWorkerProxy} worker 273 * @param {!Profiler.HeapSnapshotWorkerProxy} worker
274 * @param {number} objectId 274 * @param {number} objectId
275 * @param {number} profileUid 275 * @param {number} profileUid
276 * @param {function(!WebInspector.HeapSnapshotProxy)} snapshotReceivedCallback 276 * @param {function(!Profiler.HeapSnapshotProxy)} snapshotReceivedCallback
277 */ 277 */
278 constructor(worker, objectId, profileUid, snapshotReceivedCallback) { 278 constructor(worker, objectId, profileUid, snapshotReceivedCallback) {
279 super(worker, objectId); 279 super(worker, objectId);
280 this._profileUid = profileUid; 280 this._profileUid = profileUid;
281 this._snapshotReceivedCallback = snapshotReceivedCallback; 281 this._snapshotReceivedCallback = snapshotReceivedCallback;
282 } 282 }
283 283
284 /** 284 /**
285 * @override 285 * @override
286 * @param {string} chunk 286 * @param {string} chunk
287 * @param {function(!WebInspector.OutputStream)=} callback 287 * @param {function(!Common.OutputStream)=} callback
288 */ 288 */
289 write(chunk, callback) { 289 write(chunk, callback) {
290 this.callMethod(callback, 'write', chunk); 290 this.callMethod(callback, 'write', chunk);
291 } 291 }
292 292
293 /** 293 /**
294 * @override 294 * @override
295 * @param {function()=} callback 295 * @param {function()=} callback
296 */ 296 */
297 close(callback) { 297 close(callback) {
298 /** 298 /**
299 * @this {WebInspector.HeapSnapshotLoaderProxy} 299 * @this {Profiler.HeapSnapshotLoaderProxy}
300 */ 300 */
301 function buildSnapshot() { 301 function buildSnapshot() {
302 if (callback) 302 if (callback)
303 callback(); 303 callback();
304 this.callFactoryMethod(updateStaticData.bind(this), 'buildSnapshot', WebIn spector.HeapSnapshotProxy); 304 this.callFactoryMethod(updateStaticData.bind(this), 'buildSnapshot', Profi ler.HeapSnapshotProxy);
305 } 305 }
306 306
307 /** 307 /**
308 * @param {!WebInspector.HeapSnapshotProxy} snapshotProxy 308 * @param {!Profiler.HeapSnapshotProxy} snapshotProxy
309 * @this {WebInspector.HeapSnapshotLoaderProxy} 309 * @this {Profiler.HeapSnapshotLoaderProxy}
310 */ 310 */
311 function updateStaticData(snapshotProxy) { 311 function updateStaticData(snapshotProxy) {
312 this.dispose(); 312 this.dispose();
313 snapshotProxy.setProfileUid(this._profileUid); 313 snapshotProxy.setProfileUid(this._profileUid);
314 snapshotProxy.updateStaticData(this._snapshotReceivedCallback.bind(this)); 314 snapshotProxy.updateStaticData(this._snapshotReceivedCallback.bind(this));
315 } 315 }
316 316
317 this.callMethod(buildSnapshot.bind(this), 'close'); 317 this.callMethod(buildSnapshot.bind(this), 'close');
318 } 318 }
319 }; 319 };
320 320
321 /** 321 /**
322 * @unrestricted 322 * @unrestricted
323 */ 323 */
324 WebInspector.HeapSnapshotProxy = class extends WebInspector.HeapSnapshotProxyObj ect { 324 Profiler.HeapSnapshotProxy = class extends Profiler.HeapSnapshotProxyObject {
325 /** 325 /**
326 * @param {!WebInspector.HeapSnapshotWorkerProxy} worker 326 * @param {!Profiler.HeapSnapshotWorkerProxy} worker
327 * @param {number} objectId 327 * @param {number} objectId
328 */ 328 */
329 constructor(worker, objectId) { 329 constructor(worker, objectId) {
330 super(worker, objectId); 330 super(worker, objectId);
331 /** @type {?WebInspector.HeapSnapshotCommon.StaticData} */ 331 /** @type {?Profiler.HeapSnapshotCommon.StaticData} */
332 this._staticData = null; 332 this._staticData = null;
333 } 333 }
334 334
335 /** 335 /**
336 * @param {!WebInspector.HeapSnapshotCommon.SearchConfig} searchConfig 336 * @param {!Profiler.HeapSnapshotCommon.SearchConfig} searchConfig
337 * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} filter 337 * @param {!Profiler.HeapSnapshotCommon.NodeFilter} filter
338 * @return {!Promise<!Array<number>>} 338 * @return {!Promise<!Array<number>>}
339 */ 339 */
340 search(searchConfig, filter) { 340 search(searchConfig, filter) {
341 return this._callMethodPromise('search', searchConfig, filter); 341 return this._callMethodPromise('search', searchConfig, filter);
342 } 342 }
343 343
344 /** 344 /**
345 * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} filter 345 * @param {!Profiler.HeapSnapshotCommon.NodeFilter} filter
346 * @param {function(!Object.<string, !WebInspector.HeapSnapshotCommon.Aggregat e>)} callback 346 * @param {function(!Object.<string, !Profiler.HeapSnapshotCommon.Aggregate>)} callback
347 */ 347 */
348 aggregatesWithFilter(filter, callback) { 348 aggregatesWithFilter(filter, callback) {
349 this.callMethod(callback, 'aggregatesWithFilter', filter); 349 this.callMethod(callback, 'aggregatesWithFilter', filter);
350 } 350 }
351 351
352 aggregatesForDiff(callback) { 352 aggregatesForDiff(callback) {
353 this.callMethod(callback, 'aggregatesForDiff'); 353 this.callMethod(callback, 'aggregatesForDiff');
354 } 354 }
355 355
356 calculateSnapshotDiff(baseSnapshotId, baseSnapshotAggregates, callback) { 356 calculateSnapshotDiff(baseSnapshotId, baseSnapshotAggregates, callback) {
357 this.callMethod(callback, 'calculateSnapshotDiff', baseSnapshotId, baseSnaps hotAggregates); 357 this.callMethod(callback, 'calculateSnapshotDiff', baseSnapshotId, baseSnaps hotAggregates);
358 } 358 }
359 359
360 /** 360 /**
361 * @param {number} snapshotObjectId 361 * @param {number} snapshotObjectId
362 * @return {!Promise<?string>} 362 * @return {!Promise<?string>}
363 */ 363 */
364 nodeClassName(snapshotObjectId) { 364 nodeClassName(snapshotObjectId) {
365 return this._callMethodPromise('nodeClassName', snapshotObjectId); 365 return this._callMethodPromise('nodeClassName', snapshotObjectId);
366 } 366 }
367 367
368 /** 368 /**
369 * @param {number} nodeIndex 369 * @param {number} nodeIndex
370 * @return {!WebInspector.HeapSnapshotProviderProxy} 370 * @return {!Profiler.HeapSnapshotProviderProxy}
371 */ 371 */
372 createEdgesProvider(nodeIndex) { 372 createEdgesProvider(nodeIndex) {
373 return this.callFactoryMethod(null, 'createEdgesProvider', WebInspector.Heap SnapshotProviderProxy, nodeIndex); 373 return this.callFactoryMethod(null, 'createEdgesProvider', Profiler.HeapSnap shotProviderProxy, nodeIndex);
374 } 374 }
375 375
376 /** 376 /**
377 * @param {number} nodeIndex 377 * @param {number} nodeIndex
378 * @return {!WebInspector.HeapSnapshotProviderProxy} 378 * @return {!Profiler.HeapSnapshotProviderProxy}
379 */ 379 */
380 createRetainingEdgesProvider(nodeIndex) { 380 createRetainingEdgesProvider(nodeIndex) {
381 return this.callFactoryMethod( 381 return this.callFactoryMethod(
382 null, 'createRetainingEdgesProvider', WebInspector.HeapSnapshotProviderP roxy, nodeIndex); 382 null, 'createRetainingEdgesProvider', Profiler.HeapSnapshotProviderProxy , nodeIndex);
383 } 383 }
384 384
385 /** 385 /**
386 * @param {string} baseSnapshotId 386 * @param {string} baseSnapshotId
387 * @param {string} className 387 * @param {string} className
388 * @return {?WebInspector.HeapSnapshotProviderProxy} 388 * @return {?Profiler.HeapSnapshotProviderProxy}
389 */ 389 */
390 createAddedNodesProvider(baseSnapshotId, className) { 390 createAddedNodesProvider(baseSnapshotId, className) {
391 return this.callFactoryMethod( 391 return this.callFactoryMethod(
392 null, 'createAddedNodesProvider', WebInspector.HeapSnapshotProviderProxy , baseSnapshotId, className); 392 null, 'createAddedNodesProvider', Profiler.HeapSnapshotProviderProxy, ba seSnapshotId, className);
393 } 393 }
394 394
395 /** 395 /**
396 * @param {!Array.<number>} nodeIndexes 396 * @param {!Array.<number>} nodeIndexes
397 * @return {?WebInspector.HeapSnapshotProviderProxy} 397 * @return {?Profiler.HeapSnapshotProviderProxy}
398 */ 398 */
399 createDeletedNodesProvider(nodeIndexes) { 399 createDeletedNodesProvider(nodeIndexes) {
400 return this.callFactoryMethod( 400 return this.callFactoryMethod(
401 null, 'createDeletedNodesProvider', WebInspector.HeapSnapshotProviderPro xy, nodeIndexes); 401 null, 'createDeletedNodesProvider', Profiler.HeapSnapshotProviderProxy, nodeIndexes);
402 } 402 }
403 403
404 /** 404 /**
405 * @param {function(*):boolean} filter 405 * @param {function(*):boolean} filter
406 * @return {?WebInspector.HeapSnapshotProviderProxy} 406 * @return {?Profiler.HeapSnapshotProviderProxy}
407 */ 407 */
408 createNodesProvider(filter) { 408 createNodesProvider(filter) {
409 return this.callFactoryMethod(null, 'createNodesProvider', WebInspector.Heap SnapshotProviderProxy, filter); 409 return this.callFactoryMethod(null, 'createNodesProvider', Profiler.HeapSnap shotProviderProxy, filter);
410 } 410 }
411 411
412 /** 412 /**
413 * @param {string} className 413 * @param {string} className
414 * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} nodeFilter 414 * @param {!Profiler.HeapSnapshotCommon.NodeFilter} nodeFilter
415 * @return {?WebInspector.HeapSnapshotProviderProxy} 415 * @return {?Profiler.HeapSnapshotProviderProxy}
416 */ 416 */
417 createNodesProviderForClass(className, nodeFilter) { 417 createNodesProviderForClass(className, nodeFilter) {
418 return this.callFactoryMethod( 418 return this.callFactoryMethod(
419 null, 'createNodesProviderForClass', WebInspector.HeapSnapshotProviderPr oxy, className, nodeFilter); 419 null, 'createNodesProviderForClass', Profiler.HeapSnapshotProviderProxy, className, nodeFilter);
420 } 420 }
421 421
422 allocationTracesTops(callback) { 422 allocationTracesTops(callback) {
423 this.callMethod(callback, 'allocationTracesTops'); 423 this.callMethod(callback, 'allocationTracesTops');
424 } 424 }
425 425
426 /** 426 /**
427 * @param {number} nodeId 427 * @param {number} nodeId
428 * @param {function(!WebInspector.HeapSnapshotCommon.AllocationNodeCallers)} c allback 428 * @param {function(!Profiler.HeapSnapshotCommon.AllocationNodeCallers)} callb ack
429 */ 429 */
430 allocationNodeCallers(nodeId, callback) { 430 allocationNodeCallers(nodeId, callback) {
431 this.callMethod(callback, 'allocationNodeCallers', nodeId); 431 this.callMethod(callback, 'allocationNodeCallers', nodeId);
432 } 432 }
433 433
434 /** 434 /**
435 * @param {number} nodeIndex 435 * @param {number} nodeIndex
436 * @param {function(?Array.<!WebInspector.HeapSnapshotCommon.AllocationStackFr ame>)} callback 436 * @param {function(?Array.<!Profiler.HeapSnapshotCommon.AllocationStackFrame> )} callback
437 */ 437 */
438 allocationStack(nodeIndex, callback) { 438 allocationStack(nodeIndex, callback) {
439 this.callMethod(callback, 'allocationStack', nodeIndex); 439 this.callMethod(callback, 'allocationStack', nodeIndex);
440 } 440 }
441 441
442 /** 442 /**
443 * @override 443 * @override
444 */ 444 */
445 dispose() { 445 dispose() {
446 throw new Error('Should never be called'); 446 throw new Error('Should never be called');
447 } 447 }
448 448
449 get nodeCount() { 449 get nodeCount() {
450 return this._staticData.nodeCount; 450 return this._staticData.nodeCount;
451 } 451 }
452 452
453 get rootNodeIndex() { 453 get rootNodeIndex() {
454 return this._staticData.rootNodeIndex; 454 return this._staticData.rootNodeIndex;
455 } 455 }
456 456
457 updateStaticData(callback) { 457 updateStaticData(callback) {
458 /** 458 /**
459 * @param {!WebInspector.HeapSnapshotCommon.StaticData} staticData 459 * @param {!Profiler.HeapSnapshotCommon.StaticData} staticData
460 * @this {WebInspector.HeapSnapshotProxy} 460 * @this {Profiler.HeapSnapshotProxy}
461 */ 461 */
462 function dataReceived(staticData) { 462 function dataReceived(staticData) {
463 this._staticData = staticData; 463 this._staticData = staticData;
464 callback(this); 464 callback(this);
465 } 465 }
466 this.callMethod(dataReceived.bind(this), 'updateStaticData'); 466 this.callMethod(dataReceived.bind(this), 'updateStaticData');
467 } 467 }
468 468
469 /** 469 /**
470 * @return {!Promise.<!WebInspector.HeapSnapshotCommon.Statistics>} 470 * @return {!Promise.<!Profiler.HeapSnapshotCommon.Statistics>}
471 */ 471 */
472 getStatistics() { 472 getStatistics() {
473 return this._callMethodPromise('getStatistics'); 473 return this._callMethodPromise('getStatistics');
474 } 474 }
475 475
476 /** 476 /**
477 * @return {!Promise.<?WebInspector.HeapSnapshotCommon.Samples>} 477 * @return {!Promise.<?Profiler.HeapSnapshotCommon.Samples>}
478 */ 478 */
479 getSamples() { 479 getSamples() {
480 return this._callMethodPromise('getSamples'); 480 return this._callMethodPromise('getSamples');
481 } 481 }
482 482
483 get totalSize() { 483 get totalSize() {
484 return this._staticData.totalSize; 484 return this._staticData.totalSize;
485 } 485 }
486 486
487 get uid() { 487 get uid() {
488 return this._profileUid; 488 return this._profileUid;
489 } 489 }
490 490
491 setProfileUid(profileUid) { 491 setProfileUid(profileUid) {
492 this._profileUid = profileUid; 492 this._profileUid = profileUid;
493 } 493 }
494 494
495 /** 495 /**
496 * @return {number} 496 * @return {number}
497 */ 497 */
498 maxJSObjectId() { 498 maxJSObjectId() {
499 return this._staticData.maxJSObjectId; 499 return this._staticData.maxJSObjectId;
500 } 500 }
501 }; 501 };
502 502
503 /** 503 /**
504 * @implements {WebInspector.HeapSnapshotGridNode.ChildrenProvider} 504 * @implements {Profiler.HeapSnapshotGridNode.ChildrenProvider}
505 * @unrestricted 505 * @unrestricted
506 */ 506 */
507 WebInspector.HeapSnapshotProviderProxy = class extends WebInspector.HeapSnapshot ProxyObject { 507 Profiler.HeapSnapshotProviderProxy = class extends Profiler.HeapSnapshotProxyObj ect {
508 /** 508 /**
509 * @param {!WebInspector.HeapSnapshotWorkerProxy} worker 509 * @param {!Profiler.HeapSnapshotWorkerProxy} worker
510 * @param {number} objectId 510 * @param {number} objectId
511 */ 511 */
512 constructor(worker, objectId) { 512 constructor(worker, objectId) {
513 super(worker, objectId); 513 super(worker, objectId);
514 } 514 }
515 515
516 /** 516 /**
517 * @override 517 * @override
518 * @param {number} snapshotObjectId 518 * @param {number} snapshotObjectId
519 * @return {!Promise<number>} 519 * @return {!Promise<number>}
520 */ 520 */
521 nodePosition(snapshotObjectId) { 521 nodePosition(snapshotObjectId) {
522 return this._callMethodPromise('nodePosition', snapshotObjectId); 522 return this._callMethodPromise('nodePosition', snapshotObjectId);
523 } 523 }
524 524
525 /** 525 /**
526 * @override 526 * @override
527 * @param {function(boolean)} callback 527 * @param {function(boolean)} callback
528 */ 528 */
529 isEmpty(callback) { 529 isEmpty(callback) {
530 this.callMethod(callback, 'isEmpty'); 530 this.callMethod(callback, 'isEmpty');
531 } 531 }
532 532
533 /** 533 /**
534 * @override 534 * @override
535 * @param {number} startPosition 535 * @param {number} startPosition
536 * @param {number} endPosition 536 * @param {number} endPosition
537 * @param {function(!WebInspector.HeapSnapshotCommon.ItemsRange)} callback 537 * @param {function(!Profiler.HeapSnapshotCommon.ItemsRange)} callback
538 */ 538 */
539 serializeItemsRange(startPosition, endPosition, callback) { 539 serializeItemsRange(startPosition, endPosition, callback) {
540 this.callMethod(callback, 'serializeItemsRange', startPosition, endPosition) ; 540 this.callMethod(callback, 'serializeItemsRange', startPosition, endPosition) ;
541 } 541 }
542 542
543 /** 543 /**
544 * @override 544 * @override
545 * @param {!WebInspector.HeapSnapshotCommon.ComparatorConfig} comparator 545 * @param {!Profiler.HeapSnapshotCommon.ComparatorConfig} comparator
546 * @return {!Promise<?>} 546 * @return {!Promise<?>}
547 */ 547 */
548 sortAndRewind(comparator) { 548 sortAndRewind(comparator) {
549 return this._callMethodPromise('sortAndRewind', comparator); 549 return this._callMethodPromise('sortAndRewind', comparator);
550 } 550 }
551 }; 551 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698