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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js

Issue 2623143002: DevTools: insert console message decorations in order
Patch Set: ac Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
index ebfcb1feb6d6ac7017e75158ed000ff4e0d40de0..e8927df87530f85bece9cc137cecbcaa85f8387b 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -457,6 +457,10 @@ SDK.ExecutionContext = class extends SDK.SDKObject {
this.frameId = frameId;
this._label = name;
+ /** @type {string} */
+ this._versionId = '';
dgozman 2017/01/20 00:01:32 We cannot have versionId/versionStatus in Executio
+ /** @type {string} */
+ this._versionStatus = '';
var parsedUrl = origin.asParsedURL();
if (!this._label && parsedUrl)
this._label = parsedUrl.lastPathComponentWithFragment();
@@ -573,17 +577,27 @@ SDK.ExecutionContext = class extends SDK.SDKObject {
}
/**
+ * @param {boolean} showStatus
* @return {string}
*/
- label() {
- return this._label;
+ label(showStatus) {
+ var text = this._versionId ? this._label + ' #' + this._versionId : this._label;
+ if (this._versionStatus && showStatus)
+ return text + ' (' + this._versionStatus + ')';
+ return text;
}
/**
* @param {string} label
+ * @param {string=} versionId
+ * @param {string=} versionStatus
*/
- setLabel(label) {
+ setLabel(label, versionId, versionStatus) {
this._label = label;
+ if (typeof versionId === 'string')
+ this._versionId = versionId;
+ if (typeof versionStatus === 'string')
+ this._versionStatus = versionStatus;
this.runtimeModel.dispatchEventToListeners(SDK.RuntimeModel.Events.ExecutionContextChanged, this);
}
};

Powered by Google App Engine
This is Rietveld 408576698