Skip to content

Commit 3ce67c1

Browse files
findit-for-meCommit bot
authored andcommitted
Revert of DevTools: render product badges behind the setting. (patchset #6 id:100001 of https://codereview.chromium.org/2879943003/ )
Reason for revert: Findit (https://goo.gl/kROfz5) identified CL at revision 471581 as the culprit for failures in the build cycles as shown on: https://findit-for-me.appspot.com/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtLzBiYjk2ZmFjMTY3YjUyNjZlNTZiNzYzOGNmZTFhMzVhOGY3ZmE0ODgM Original issue's description: > DevTools: render product badges behind the setting. > > Review-Url: https://codereview.chromium.org/2879943003 > Cr-Commit-Position: refs/heads/master@{#471581} > Committed: https://chromium.googlesource.com/chromium/src/+/0bb96fac167b5266e56b7638cfe1a35a8f7fa488 [email protected],[email protected],[email protected],[email protected] # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2880913002 Cr-Commit-Position: refs/heads/master@{#471583}
1 parent 2342364 commit 3ce67c1

File tree

16 files changed

+81
-310
lines changed

16 files changed

+81
-310
lines changed

BUILD.gn

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,8 @@ all_devtools_files = [
390390
"front_end/persistence/PersistenceUtils.js",
391391
"front_end/platform/module.json",
392392
"front_end/platform/utilities.js",
393-
"front_end/product_registry/BadgePool.js",
394-
"front_end/product_registry/ProductRegistry.js",
395-
"front_end/product_registry/badge.css",
396393
"front_end/product_registry/module.json",
397-
"front_end/product_registry/popup.css",
394+
"front_end/product_registry/ProductRegistry.js",
398395
"front_end/product_registry_impl/module.json",
399396
"front_end/product_registry_impl/ProductRegistryImpl.js",
400397
"front_end/product_registry_impl/ProductRegistryData.js",

front_end/common/Color.js

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -817,67 +817,3 @@ Common.Color.PageHighlight = {
817817
Shape: Common.Color.fromRGBA([96, 82, 177, 0.8]),
818818
ShapeMargin: Common.Color.fromRGBA([96, 82, 127, .6])
819819
};
820-
821-
Common.Color.Generator = class {
822-
/**
823-
* @param {!{min: number, max: number}|number=} hueSpace
824-
* @param {!{min: number, max: number, count: (number|undefined)}|number=} satSpace
825-
* @param {!{min: number, max: number, count: (number|undefined)}|number=} lightnessSpace
826-
* @param {!{min: number, max: number, count: (number|undefined)}|number=} alphaSpace
827-
*/
828-
constructor(hueSpace, satSpace, lightnessSpace, alphaSpace) {
829-
this._hueSpace = hueSpace || {min: 0, max: 360};
830-
this._satSpace = satSpace || 67;
831-
this._lightnessSpace = lightnessSpace || 80;
832-
this._alphaSpace = alphaSpace || 1;
833-
/** @type {!Map<string, string>} */
834-
this._colors = new Map();
835-
}
836-
837-
/**
838-
* @param {string} id
839-
* @param {string} color
840-
*/
841-
setColorForID(id, color) {
842-
this._colors.set(id, color);
843-
}
844-
845-
/**
846-
* @param {string} id
847-
* @return {string}
848-
*/
849-
colorForID(id) {
850-
var color = this._colors.get(id);
851-
if (!color) {
852-
color = this._generateColorForID(id);
853-
this._colors.set(id, color);
854-
}
855-
return color;
856-
}
857-
858-
/**
859-
* @param {string} id
860-
* @return {string}
861-
*/
862-
_generateColorForID(id) {
863-
var hash = String.hashCode(id);
864-
var h = this._indexToValueInSpace(hash, this._hueSpace);
865-
var s = this._indexToValueInSpace(hash >> 8, this._satSpace);
866-
var l = this._indexToValueInSpace(hash >> 16, this._lightnessSpace);
867-
var a = this._indexToValueInSpace(hash >> 24, this._alphaSpace);
868-
return `hsla(${h}, ${s}%, ${l}%, ${a})`;
869-
}
870-
871-
/**
872-
* @param {number} index
873-
* @param {!{min: number, max: number, count: (number|undefined)}|number} space
874-
* @return {number}
875-
*/
876-
_indexToValueInSpace(index, space) {
877-
if (typeof space === 'number')
878-
return space;
879-
var count = space.count || space.max - space.min;
880-
index %= count;
881-
return space.min + Math.floor(index / (count - 1) * (space.max - space.min));
882-
}
883-
};

front_end/inspector.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{ "name": "sources" },
2121
{ "name": "timeline", "condition": "!v8only" },
2222
{ "name": "timeline_model", "condition": "!v8only" },
23-
{ "name": "product_registry", "condition": "!v8only", "type": "autostart" },
23+
{ "name": "product_registry", "condition": "!v8only" },
2424
{ "name": "product_registry_impl", "condition": "!v8only", "type": "remote" },
2525
{ "name": "profiler" },
2626
{ "name": "resources", "condition": "!v8only" },

front_end/network/NetworkDataGridNode.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ Network.NetworkRequestNode = class extends Network.NetworkNode {
361361
/** @type {?Element} */
362362
this._nameCell = null;
363363
/** @type {?Element} */
364-
this._nameBadgeElement = null;
365-
/** @type {?Element} */
366364
this._initiatorCell = null;
365+
/** @type {?Element} */
366+
this._linkifiedInitiatorAnchor = null;
367367
this._request = request;
368368
this._isNavigationRequest = false;
369369
this.selectable = true;
@@ -933,9 +933,6 @@ Network.NetworkRequestNode = class extends Network.NetworkNode {
933933
iconElement.classList.add(this._request.resourceType().name());
934934

935935
cell.appendChild(iconElement);
936-
if (!this._nameBadgeElement)
937-
this._nameBadgeElement = this.parentView().badgePool.badgeForURL(this._request.parsedURL);
938-
cell.appendChild(this._nameBadgeElement);
939936
cell.createTextChild(this._request.networkManager().target().decorateLabel(this._request.name()));
940937
this._appendSubtitle(cell, this._request.path());
941938
cell.title = this._request.url();

front_end/network/NetworkLogView.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Network.NetworkLogView = class extends UI.VBox {
9090
this._currentMatchedRequestNode = null;
9191
this._currentMatchedRequestIndex = -1;
9292

93+
/** @type {!Components.Linkifier} */
9394
this.linkifier = new Components.Linkifier();
94-
this.badgePool = new ProductRegistry.BadgePool();
9595

9696
this._recording = false;
9797
this._preserveLog = false;
@@ -922,7 +922,6 @@ Network.NetworkLogView = class extends UI.VBox {
922922

923923
this._timeCalculator.setWindow(null);
924924
this.linkifier.reset();
925-
this.badgePool.reset();
926925

927926
if (this._activeGroupLookup)
928927
this._activeGroupLookup.reset();

front_end/network/RequestTimingView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ Network.RequestTimingView = class extends UI.VBox {
282282
* @param {number} right
283283
*/
284284
function addTiming(serverTiming, right) {
285-
var colorGenerator = new Common.Color.Generator({min: 0, max: 360, count: 36}, {min: 50, max: 80}, 80);
285+
var colorGenerator = new PerfUI.FlameChart.ColorGenerator({min: 0, max: 360, count: 36}, {min: 50, max: 80}, 80);
286286
var isTotal = serverTiming.metric.toLowerCase() === 'total';
287287
var tr = tableElement.createChild('tr', isTotal ? 'network-timing-footer' : '');
288288
var metric = tr.createChild('td', 'network-timing-metric');

front_end/perf_ui/FlameChart.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,73 @@ PerfUI.FlameChart.Events = {
14931493
EntryHighlighted: Symbol('EntryHighlighted')
14941494
};
14951495

1496+
/**
1497+
* @unrestricted
1498+
*/
1499+
PerfUI.FlameChart.ColorGenerator = class {
1500+
/**
1501+
* @param {!{min: number, max: number}|number=} hueSpace
1502+
* @param {!{min: number, max: number, count: (number|undefined)}|number=} satSpace
1503+
* @param {!{min: number, max: number, count: (number|undefined)}|number=} lightnessSpace
1504+
* @param {!{min: number, max: number, count: (number|undefined)}|number=} alphaSpace
1505+
*/
1506+
constructor(hueSpace, satSpace, lightnessSpace, alphaSpace) {
1507+
this._hueSpace = hueSpace || {min: 0, max: 360};
1508+
this._satSpace = satSpace || 67;
1509+
this._lightnessSpace = lightnessSpace || 80;
1510+
this._alphaSpace = alphaSpace || 1;
1511+
/** @type {!Map<string, string>} */
1512+
this._colors = new Map();
1513+
}
1514+
1515+
/**
1516+
* @param {string} id
1517+
* @param {string} color
1518+
*/
1519+
setColorForID(id, color) {
1520+
this._colors.set(id, color);
1521+
}
1522+
1523+
/**
1524+
* @param {string} id
1525+
* @return {string}
1526+
*/
1527+
colorForID(id) {
1528+
var color = this._colors.get(id);
1529+
if (!color) {
1530+
color = this._generateColorForID(id);
1531+
this._colors.set(id, color);
1532+
}
1533+
return color;
1534+
}
1535+
1536+
/**
1537+
* @param {string} id
1538+
* @return {string}
1539+
*/
1540+
_generateColorForID(id) {
1541+
var hash = String.hashCode(id);
1542+
var h = this._indexToValueInSpace(hash, this._hueSpace);
1543+
var s = this._indexToValueInSpace(hash >> 8, this._satSpace);
1544+
var l = this._indexToValueInSpace(hash >> 16, this._lightnessSpace);
1545+
var a = this._indexToValueInSpace(hash >> 24, this._alphaSpace);
1546+
return `hsla(${h}, ${s}%, ${l}%, ${a})`;
1547+
}
1548+
1549+
/**
1550+
* @param {number} index
1551+
* @param {!{min: number, max: number, count: (number|undefined)}|number} space
1552+
* @return {number}
1553+
*/
1554+
_indexToValueInSpace(index, space) {
1555+
if (typeof space === 'number')
1556+
return space;
1557+
var count = space.count || space.max - space.min;
1558+
index %= count;
1559+
return space.min + Math.floor(index / (count - 1) * (space.max - space.min));
1560+
}
1561+
};
1562+
14961563
/**
14971564
* @implements {PerfUI.TimelineGrid.Calculator}
14981565
* @unrestricted

front_end/product_registry/BadgePool.js

Lines changed: 0 additions & 156 deletions
This file was deleted.

front_end/product_registry/badge.css

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)