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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js

Issue 2752403002: [DevTools] Migrate usages of Target to RuntimeModel where makes sense (Closed)
Patch Set: review comments addressed Created 3 years, 9 months 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Sources.SourceMapNamesResolver = {}; 4 Sources.SourceMapNamesResolver = {};
5 5
6 Sources.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache'); 6 Sources.SourceMapNamesResolver._cachedMapSymbol = Symbol('cache');
7 Sources.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifi ers'); 7 Sources.SourceMapNamesResolver._cachedIdentifiersSymbol = Symbol('cachedIdentifi ers');
8 8
9 /** 9 /**
10 * @unrestricted 10 * @unrestricted
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 var promise = new Promise(fulfill => callback = fulfill); 310 var promise = new Promise(fulfill => callback = fulfill);
311 callFrame.evaluate(thisMapping, 'backtrace', false, true, false, true, onEva luated.bind(null, callback)); 311 callFrame.evaluate(thisMapping, 'backtrace', false, true, false, true, onEva luated.bind(null, callback));
312 return promise; 312 return promise;
313 } 313 }
314 314
315 /** 315 /**
316 * @param {function(!SDK.RemoteObject)} callback 316 * @param {function(!SDK.RemoteObject)} callback
317 * @param {?Protocol.Runtime.RemoteObject} evaluateResult 317 * @param {?Protocol.Runtime.RemoteObject} evaluateResult
318 */ 318 */
319 function onEvaluated(callback, evaluateResult) { 319 function onEvaluated(callback, evaluateResult) {
320 var remoteObject = evaluateResult ? 320 var remoteObject = evaluateResult ? callFrame.debuggerModel.runtimeModel().c reateRemoteObject(evaluateResult) :
321 callFrame.debuggerModel.target().runtimeModel.createRemoteObject(evaluat eResult) : 321 callFrame.thisObject();
322 callFrame.thisObject(); 322 callback(/** @type {!SDK.RemoteObject} */ (remoteObject));
323 callback(remoteObject);
324 } 323 }
325 }; 324 };
326 325
327 /** 326 /**
328 * @param {!SDK.DebuggerModel.Scope} scope 327 * @param {!SDK.DebuggerModel.Scope} scope
329 * @return {!SDK.RemoteObject} 328 * @return {!SDK.RemoteObject}
330 */ 329 */
331 Sources.SourceMapNamesResolver.resolveScopeInObject = function(scope) { 330 Sources.SourceMapNamesResolver.resolveScopeInObject = function(scope) {
332 var startLocation = scope.startLocation(); 331 var startLocation = scope.startLocation();
333 var endLocation = scope.endLocation(); 332 var endLocation = scope.endLocation();
(...skipping 22 matching lines...) Expand all
356 /** 355 /**
357 * @override 356 * @override
358 * @return {?Protocol.Runtime.CustomPreview} 357 * @return {?Protocol.Runtime.CustomPreview}
359 */ 358 */
360 customPreview() { 359 customPreview() {
361 return this._object.customPreview(); 360 return this._object.customPreview();
362 } 361 }
363 362
364 /** 363 /**
365 * @override 364 * @override
365 * @return {!Protocol.Runtime.RemoteObjectId|undefined}
366 */
367 get objectId() {
368 return this._object.objectId;
369 }
370
371 /**
372 * @override
366 * @return {string} 373 * @return {string}
367 */ 374 */
368 get type() { 375 get type() {
369 return this._object.type; 376 return this._object.type;
370 } 377 }
371 378
372 /** 379 /**
373 * @override 380 * @override
374 * @return {string|undefined} 381 * @return {string|undefined}
375 */ 382 */
376 get subtype() { 383 get subtype() {
377 return this._object.subtype; 384 return this._object.subtype;
378 } 385 }
379 386
380 /** 387 /**
381 * @override 388 * @override
389 * @return {*}
390 */
391 get value() {
392 return this._object.value;
393 }
394
395 /**
396 * @override
382 * @return {string|undefined} 397 * @return {string|undefined}
383 */ 398 */
384 get description() { 399 get description() {
385 return this._object.description; 400 return this._object.description;
386 } 401 }
387 402
388 /** 403 /**
389 * @override 404 * @override
390 * @return {boolean} 405 * @return {boolean}
391 */ 406 */
392 get hasChildren() { 407 get hasChildren() {
393 return this._object.hasChildren; 408 return this._object.hasChildren;
394 } 409 }
395 410
396 /** 411 /**
397 * @override 412 * @override
413 * @return {!Protocol.Runtime.ObjectPreview|undefined}
414 */
415 get preview() {
416 return this._object.preview;
417 }
418
419 /**
420 * @override
398 * @return {number} 421 * @return {number}
399 */ 422 */
400 arrayLength() { 423 arrayLength() {
401 return this._object.arrayLength(); 424 return this._object.arrayLength();
402 } 425 }
403 426
404 /** 427 /**
405 * @override 428 * @override
406 * @param {boolean} generatePreview 429 * @param {boolean} generatePreview
407 * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObj ectProperty>)} callback 430 * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObj ectProperty>)} callback
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 actualName = compiledName; 499 actualName = compiledName;
477 break; 500 break;
478 } 501 }
479 } 502 }
480 this._object.setPropertyValue(actualName, value, callback); 503 this._object.setPropertyValue(actualName, value, callback);
481 } 504 }
482 } 505 }
483 506
484 /** 507 /**
485 * @override 508 * @override
509 * @param {!Array.<string>} propertyPath
510 * @param {function(?SDK.RemoteObject, boolean=)} callback
511 */
512 getProperty(propertyPath, callback) {
513 this._object.getProperty(propertyPath, callback);
514 }
515
516 /**
517 * @override
486 * @return {!Promise<?Array<!SDK.EventListener>>} 518 * @return {!Promise<?Array<!SDK.EventListener>>}
487 */ 519 */
488 eventListeners() { 520 eventListeners() {
489 return this._object.eventListeners(); 521 return this._object.eventListeners();
490 } 522 }
491 523
492 /** 524 /**
493 * @override 525 * @override
494 * @param {!Protocol.Runtime.CallArgument} name 526 * @param {!Protocol.Runtime.CallArgument} name
495 * @param {function(string=)} callback 527 * @param {function(string=)} callback
(...skipping 17 matching lines...) Expand all
513 * @param {function(this:Object, ...)} functionDeclaration 545 * @param {function(this:Object, ...)} functionDeclaration
514 * @param {!Array<!Protocol.Runtime.CallArgument>|undefined} args 546 * @param {!Array<!Protocol.Runtime.CallArgument>|undefined} args
515 * @param {function(*)} callback 547 * @param {function(*)} callback
516 */ 548 */
517 callFunctionJSON(functionDeclaration, args, callback) { 549 callFunctionJSON(functionDeclaration, args, callback) {
518 this._object.callFunctionJSON(functionDeclaration, args, callback); 550 this._object.callFunctionJSON(functionDeclaration, args, callback);
519 } 551 }
520 552
521 /** 553 /**
522 * @override 554 * @override
523 * @return {!SDK.Target}
524 */ 555 */
525 target() { 556 release() {
526 return this._object.target(); 557 this._object.release();
527 } 558 }
528 559
529 /** 560 /**
530 * @override 561 * @override
531 * @return {?SDK.DebuggerModel} 562 * @return {!SDK.DebuggerModel}
532 */ 563 */
533 debuggerModel() { 564 debuggerModel() {
534 return this._object.debuggerModel(); 565 return this._object.debuggerModel();
535 } 566 }
536 567
537 /** 568 /**
538 * @override 569 * @override
570 * @return {!SDK.RuntimeModel}
571 */
572 runtimeModel() {
573 return this._object.runtimeModel();
574 }
575
576 /**
577 * @override
539 * @return {boolean} 578 * @return {boolean}
540 */ 579 */
541 isNode() { 580 isNode() {
542 return this._object.isNode(); 581 return this._object.isNode();
543 } 582 }
544 }; 583 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698