OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 copyright | 8 * * Redistributions of source code must retain the above copyright |
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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
450 super(target); | 450 super(target); |
451 this.id = id; | 451 this.id = id; |
452 this.name = name; | 452 this.name = name; |
453 this.origin = origin; | 453 this.origin = origin; |
454 this.isDefault = isDefault; | 454 this.isDefault = isDefault; |
455 this.runtimeModel = target.runtimeModel; | 455 this.runtimeModel = target.runtimeModel; |
456 this.debuggerModel = SDK.DebuggerModel.fromTarget(target); | 456 this.debuggerModel = SDK.DebuggerModel.fromTarget(target); |
457 this.frameId = frameId; | 457 this.frameId = frameId; |
458 | 458 |
459 this._label = name; | 459 this._label = name; |
460 /** @type {string|undefined} */ | |
461 this._versionId; | |
allada
2017/01/19 02:38:08
nit: lets make these empty strings when undefined.
luoe
2017/01/19 23:22:59
Done.
| |
462 /** @type {string|undefined} */ | |
463 this._versionStatus; | |
460 var parsedUrl = origin.asParsedURL(); | 464 var parsedUrl = origin.asParsedURL(); |
461 if (!this._label && parsedUrl) | 465 if (!this._label && parsedUrl) |
462 this._label = parsedUrl.lastPathComponentWithFragment(); | 466 this._label = parsedUrl.lastPathComponentWithFragment(); |
463 } | 467 } |
464 | 468 |
465 /** | 469 /** |
466 * @param {!SDK.ExecutionContext} a | 470 * @param {!SDK.ExecutionContext} a |
467 * @param {!SDK.ExecutionContext} b | 471 * @param {!SDK.ExecutionContext} b |
468 * @return {number} | 472 * @return {number} |
469 */ | 473 */ |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
566 return; | 570 return; |
567 } | 571 } |
568 callback(this.runtimeModel.createRemoteObject(result), exceptionDetails); | 572 callback(this.runtimeModel.createRemoteObject(result), exceptionDetails); |
569 } | 573 } |
570 this.target().runtimeAgent().evaluate( | 574 this.target().runtimeAgent().evaluate( |
571 expression, objectGroup, includeCommandLineAPI, silent, this.id, returnB yValue, generatePreview, userGesture, | 575 expression, objectGroup, includeCommandLineAPI, silent, this.id, returnB yValue, generatePreview, userGesture, |
572 false, evalCallback.bind(this)); | 576 false, evalCallback.bind(this)); |
573 } | 577 } |
574 | 578 |
575 /** | 579 /** |
580 * @param {boolean} showStatus | |
576 * @return {string} | 581 * @return {string} |
577 */ | 582 */ |
578 label() { | 583 label(showStatus) { |
579 return this._label; | 584 var text = this._versionId ? this._label + ' #' + this._versionId : this._la bel; |
585 if (this._versionStatus && showStatus) | |
586 return text + ' (' + this._versionStatus + ')'; | |
587 return text; | |
580 } | 588 } |
581 | 589 |
582 /** | 590 /** |
583 * @param {string} label | 591 * @param {string} label |
592 * @param {string=} versionId | |
593 * @param {string=} versionStatus | |
584 */ | 594 */ |
585 setLabel(label) { | 595 setLabel(label, versionId, versionStatus) { |
586 this._label = label; | 596 this._label = label; |
597 if (versionId) | |
598 this._versionId = versionId; | |
599 if (versionStatus) | |
600 this._versionStatus = versionStatus; | |
587 this.runtimeModel.dispatchEventToListeners(SDK.RuntimeModel.Events.Execution ContextChanged, this); | 601 this.runtimeModel.dispatchEventToListeners(SDK.RuntimeModel.Events.Execution ContextChanged, this); |
588 } | 602 } |
589 }; | 603 }; |
590 | 604 |
591 | 605 |
592 /** | 606 /** |
593 * @unrestricted | 607 * @unrestricted |
594 */ | 608 */ |
595 SDK.EventListener = class extends SDK.SDKObject { | 609 SDK.EventListener = class extends SDK.SDKObject { |
596 /** | 610 /** |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
785 this._type === 'wheel'; | 799 this._type === 'wheel'; |
786 } | 800 } |
787 | 801 |
788 /** | 802 /** |
789 * @return {boolean} | 803 * @return {boolean} |
790 */ | 804 */ |
791 isNormalListenerType() { | 805 isNormalListenerType() { |
792 return this._listenerType === 'normal'; | 806 return this._listenerType === 'normal'; |
793 } | 807 } |
794 }; | 808 }; |
OLD | NEW |