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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js

Issue 2886393003: DevTools: Use badges to render products in timeline details. (Closed)
Patch Set: Created 3 years, 7 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/timeline/TimelineUIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
index 0dbde349affeef34e0de2d2800bb843633d38cca..e70b7cfb189f9a9f71282a26b796f6002969c951 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
@@ -909,7 +909,7 @@ Timeline.TimelineUIUtils = class {
break;
}
- await Timeline.TimelineUIUtils._maybeAppendProductToDetails(contentHelper, url || eventData && eventData['url']);
+ Timeline.TimelineUIUtils._maybeAppendProductToDetails(contentHelper, url || eventData && eventData['url']);
if (timelineData.timeWaitingForMainThread) {
contentHelper.appendTextRow(
@@ -948,16 +948,13 @@ Timeline.TimelineUIUtils = class {
/**
* @param {!Timeline.TimelineDetailsContentHelper} contentHelper
* @param {?string} url
- * @return {!Promise}
*/
- static async _maybeAppendProductToDetails(contentHelper, url) {
- var parsedURL = url && url.asParsedURL();
+ static _maybeAppendProductToDetails(contentHelper, url) {
+ var parsedURL = url ? url.asParsedURL() : null;
if (!parsedURL)
return;
- var registry = await ProductRegistry.instance();
- var name = registry.nameForUrl(parsedURL);
- if (name)
- contentHelper.appendTextRow(Common.UIString('Product'), name);
+ var badgePool = new ProductRegistry.BadgePool();
pfeldman 2017/05/18 20:18:34 Pool is a pool for a reason, you need to reset it
alph 2017/05/18 22:56:02 Done.
+ contentHelper.appendElementRow('', badgePool.badgeForURL(parsedURL, true));
}
/**
@@ -1109,7 +1106,7 @@ Timeline.TimelineUIUtils = class {
const duration = request.endTime - (request.startTime || -Infinity);
if (request.url)
contentHelper.appendElementRow(Common.UIString('URL'), Components.Linkifier.linkifyURL(request.url));
- await Timeline.TimelineUIUtils._maybeAppendProductToDetails(contentHelper, request.url);
+ Timeline.TimelineUIUtils._maybeAppendProductToDetails(contentHelper, request.url);
if (isFinite(duration))
contentHelper.appendTextRow(Common.UIString('Duration'), Number.millisToString(duration, true));
if (request.requestMethod)

Powered by Google App Engine
This is Rietveld 408576698