| 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 9202ce2b689124bea4772458b3189c5749e921c8..3dcbdab9f2acd1dcc15816219a4e3514fadcef85 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js
|
| @@ -333,6 +333,35 @@ Timeline.TimelineUIUtils = class {
|
| }
|
|
|
| /**
|
| + * @param {!ProductRegistry.Registry} productRegistry
|
| + * @param {!TimelineModel.TimelineModel} model
|
| + * @param {!Map<string, string>} urlToColorCache
|
| + * @param {!SDK.TracingModel.Event} event
|
| + * @return {string}
|
| + */
|
| + static eventColorByProduct(productRegistry, model, urlToColorCache, event) {
|
| + var url = Timeline.TimelineUIUtils.eventURL(event) || '';
|
| + var color = urlToColorCache.get(url);
|
| + if (color)
|
| + return color;
|
| + var defaultColor = '#f2ecdc';
|
| + var parsedURL = url.asParsedURL();
|
| + if (!parsedURL)
|
| + return defaultColor;
|
| + var name = productRegistry && productRegistry.nameForUrl(parsedURL);
|
| + if (!name) {
|
| + name = parsedURL.host;
|
| + var rootFrames = model.rootFrames();
|
| + if (rootFrames.some(pageFrame => new Common.ParsedURL(pageFrame.url).host === name))
|
| + color = defaultColor;
|
| + }
|
| + if (!color)
|
| + color = name ? ProductRegistry.BadgePool.colorForEntryName(name) : defaultColor;
|
| + urlToColorCache.set(url, color);
|
| + return color;
|
| + }
|
| +
|
| + /**
|
| * @param {!SDK.TracingModel.Event} event
|
| * @return {string}
|
| */
|
| @@ -955,7 +984,7 @@ Timeline.TimelineUIUtils = class {
|
| static _maybeAppendProductToDetails(contentHelper, badgePool, url) {
|
| var parsedURL = url ? url.asParsedURL() : null;
|
| if (parsedURL)
|
| - contentHelper.appendElementRow('', badgePool.badgeForURL(parsedURL, true));
|
| + contentHelper.appendElementRow('', badgePool.badgeForURL(parsedURL));
|
| }
|
|
|
| /**
|
|
|