Commit 2d6dcff9 authored by pfeldman's avatar pfeldman Committed by Commit bot

DevTools: enable private field checks as a part of compilation.

Review-Url: https://codereview.chromium.org/2573673002
Cr-Commit-Position: refs/heads/master@{#438085}
parent 6287f21e
......@@ -13,7 +13,6 @@ InspectorTest.importScript("../../../../../Source/devtools/front_end/platform/ut
InspectorTest.importScript("../../../../../Source/devtools/front_end/common/UIString.js");
InspectorTest.importScript("../../../../../Source/devtools/front_end/profiler/HeapSnapshotCommon.js");
InspectorTest.importScript("../../../../../Source/devtools/front_end/heap_snapshot_worker/HeapSnapshot.js");
InspectorTest.importScript("../../../../../Source/devtools/front_end/heap_snapshot_worker/JSHeapSnapshot.js");
InspectorTest.importScript("../../../../../Source/devtools/front_end/common/TextUtils.js");
InspectorTest.importScript("../../../../../Source/devtools/front_end/heap_snapshot_worker/HeapSnapshotLoader.js");
......
......@@ -512,7 +512,6 @@ devtools_heap_snapshot_worker_js_files = [
"front_end/heap_snapshot_worker/HeapSnapshotLoader.js",
"front_end/heap_snapshot_worker/HeapSnapshotWorker.js",
"front_end/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.js",
"front_end/heap_snapshot_worker/JSHeapSnapshot.js",
"front_end/platform/utilities.js",
"front_end/profiler/HeapSnapshotCommon.js",
]
......
......@@ -8,7 +8,6 @@
"HeapSnapshot.js",
"HeapSnapshotLoader.js",
"HeapSnapshotWorkerDispatcher.js",
"JSHeapSnapshot.js",
"HeapSnapshotWorker.js"
]
}
......@@ -287,14 +287,15 @@ Network.NetworkDataGridNode = class extends UI.SortableDataGridNode {
/**
* @override
* @param {!Element} element
*/
createCells() {
createCells(element) {
this._nameCell = null;
this._initiatorCell = null;
this._element.classList.toggle('network-error-row', this._isFailed());
this._element.classList.toggle('network-navigation-row', this._isNavigationRequest);
super.createCells();
element.classList.toggle('network-error-row', this._isFailed());
element.classList.toggle('network-navigation-row', this._isNavigationRequest);
super.createCells(element);
}
/**
......
......@@ -19,10 +19,6 @@ Network.NetworkOverview = class extends UI.TimelineOverviewBase {
this._restoringWindow = false;
/** @type {boolean} */
this._updateScheduled = false;
/** @type {number} */
this._canvasWidth = 0;
/** @type {number} */
this._canvasHeight = 0;
SDK.targetManager.addModelListener(
SDK.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this._loadEventFired, this);
......@@ -111,7 +107,7 @@ Network.NetworkOverview = class extends UI.TimelineOverviewBase {
onResize() {
var width = this.element.offsetWidth;
var height = this.element.offsetHeight;
this._calculator.setDisplayWindow(width);
this.calculator().setDisplayWindow(width);
this.resetCanvas();
var numBands = (((height - 1) / Network.NetworkOverview._bandHeight) - 1) | 0;
this._numBands = (numBands > 0) ? numBands : 1;
......@@ -164,27 +160,26 @@ Network.NetworkOverview = class extends UI.TimelineOverviewBase {
update() {
this._updateScheduled = false;
var newBoundary =
new Network.NetworkTimeBoundary(this._calculator.minimumBoundary(), this._calculator.maximumBoundary());
var calculator = this.calculator();
var newBoundary = new Network.NetworkTimeBoundary(calculator.minimumBoundary(), calculator.maximumBoundary());
if (!this._lastBoundary || !newBoundary.equals(this._lastBoundary)) {
var span = this._calculator.boundarySpan();
var span = calculator.boundarySpan();
while (this._span < span)
this._span *= 1.25;
this._calculator.setBounds(this._calculator.minimumBoundary(), this._calculator.minimumBoundary() + this._span);
this._lastBoundary =
new Network.NetworkTimeBoundary(this._calculator.minimumBoundary(), this._calculator.maximumBoundary());
calculator.setBounds(calculator.minimumBoundary(), calculator.minimumBoundary() + this._span);
this._lastBoundary = new Network.NetworkTimeBoundary(calculator.minimumBoundary(), calculator.maximumBoundary());
if (this._windowStart || this._windowEnd) {
this._restoringWindow = true;
var startTime = this._calculator.minimumBoundary();
var totalTime = this._calculator.boundarySpan();
var startTime = calculator.minimumBoundary();
var totalTime = calculator.boundarySpan();
var left = (this._windowStart - startTime) / totalTime;
var right = (this._windowEnd - startTime) / totalTime;
this._restoringWindow = false;
}
}
var context = this._canvas.getContext('2d');
var calculator = this._calculator;
var context = this.context();
var linesByType = {};
var paddingTop = 2;
......@@ -233,7 +228,7 @@ Network.NetworkOverview = class extends UI.TimelineOverviewBase {
var band = this._bandId(request.connectionId);
var y = (band === -1) ? 0 : (band % this._numBands + 1);
var timeRanges =
Network.RequestTimingView.calculateRequestTimeRanges(request, this._calculator.minimumBoundary());
Network.RequestTimingView.calculateRequestTimeRanges(request, this.calculator().minimumBoundary());
for (var j = 0; j < timeRanges.length; ++j) {
var type = timeRanges[j].name;
if (band !== -1 || type === Network.RequestTimeRangeNames.Total)
......@@ -241,7 +236,7 @@ Network.NetworkOverview = class extends UI.TimelineOverviewBase {
}
}
context.clearRect(0, 0, this._canvas.width, this._canvas.height);
context.clearRect(0, 0, this.width(), this.height());
context.save();
context.scale(window.devicePixelRatio, window.devicePixelRatio);
context.lineWidth = 2;
......
......@@ -212,15 +212,15 @@ Network.ResourceWebSocketFrameNode = class extends UI.SortableDataGridNode {
/**
* @override
* @param {!Element} element
*/
createCells() {
var element = this._element;
createCells(element) {
element.classList.toggle(
'websocket-frame-view-row-error', this._frame.type === SDK.NetworkRequest.WebSocketFrameType.Error);
element.classList.toggle(
'websocket-frame-view-row-outcoming', this._frame.type === SDK.NetworkRequest.WebSocketFrameType.Send);
element.classList.toggle('websocket-frame-view-row-opcode', !this._isTextFrame);
super.createCells();
super.createCells(element);
}
/**
......
......@@ -102,6 +102,14 @@ Timeline.CountersGraph = class extends UI.VBox {
return this;
}
/**
* @protected
* @return {!TimelineModel.TimelineModel}
*/
model() {
return this._model;
}
/**
* @override
*/
......
......@@ -59,7 +59,7 @@ Timeline.MemoryCountersGraph = class extends Timeline.CountersGraph {
*/
refreshRecords() {
this.reset();
var events = this._model.mainThreadEvents();
var events = this.model().mainThreadEvents();
for (var i = 0; i < events.length; ++i) {
var event = events[i];
if (event.name !== TimelineModel.TimelineModel.RecordType.UpdateCounters)
......
......@@ -528,7 +528,7 @@ Timeline.TimelineFilmStripOverview = class extends Timeline.TimelineEventOvervie
if (!this._filmStripModel.frames().length)
return Promise.resolve(/** @type {?Element} */ (null));
var time = this._calculator.positionToTime(x);
var time = this.calculator().positionToTime(x);
var frame = this._filmStripModel.frameByTimestamp(time);
if (frame === this._lastFrame)
return Promise.resolve(this._lastElement);
......
......@@ -23,7 +23,7 @@ Timeline.TimelineFlameChartNetworkDataProvider = class extends Timeline.Timeline
height: 17,
collapsible: true,
color: UI.themeSupport.patchColor('#222', UI.ThemeSupport.ColorUsage.Foreground),
font: this._font,
font: this.font(),
backgroundColor: UI.themeSupport.patchColor('white', UI.ThemeSupport.ColorUsage.Background),
nestingLevel: 0,
useFirstLineForOverview: false,
......
......@@ -1255,14 +1255,15 @@ UI.DataGridNode = class extends Common.Object {
*/
element() {
if (!this._element) {
this.createElement();
this.createCells();
var element = this.createElement();
this.createCells(element);
}
return /** @type {!Element} */ (this._element);
}
/**
* @protected
* @return {!Element}
*/
createElement() {
this._element = createElement('tr');
......@@ -1276,17 +1277,33 @@ UI.DataGridNode = class extends Common.Object {
this._element.classList.add('selected');
if (this.revealed)
this._element.classList.add('revealed');
return this._element;
}
/**
* @return {?Element}
*/
existingElement() {
return this._element || null;
}
/**
* @protected
*/
resetElement() {
this._element = null;
}
/**
* @param {!Element} element
* @protected
*/
createCells() {
this._element.removeChildren();
createCells(element) {
element.removeChildren();
var columnsArray = this.dataGrid._visibleColumnsArray;
for (var i = 0; i < columnsArray.length; ++i)
this._element.appendChild(this.createCell(columnsArray[i].id));
this._element.appendChild(this._createTDWithClass('corner'));
element.appendChild(this.createCell(columnsArray[i].id));
element.appendChild(this._createTDWithClass('corner'));
}
/**
......@@ -1439,7 +1456,7 @@ UI.DataGridNode = class extends Common.Object {
this._element = null;
if (!this._element)
return;
this.createCells();
this.createCells(this._element);
}
/**
......
......@@ -89,10 +89,11 @@ UI.ShowMoreDataGridNode = class extends UI.DataGridNode {
/**
* @override
* @param {!Element} element
*/
createCells() {
createCells(element) {
this._hasCells = false;
super.createCells();
super.createCells(element);
}
/**
......
......@@ -506,6 +506,14 @@ UI.TimelineOverviewBase = class extends UI.VBox {
return this._context;
}
/**
* @protected
* @return {?UI.TimelineOverviewCalculator}
*/
calculator() {
return this._calculator;
}
/**
* @override
*/
......
......@@ -221,7 +221,7 @@ UI.ViewportDataGrid = class extends UI.DataGrid {
for (var i = 0; i < this._visibleNodes.length; ++i) {
var oldNode = this._visibleNodes[i];
if (!visibleNodesSet.has(oldNode) && oldNode.attached()) {
var element = oldNode._element;
var element = oldNode.existingElement();
if (element === this._wheelTarget)
this._hiddenWheelTarget = oldNode.abandonElement();
else
......@@ -306,18 +306,13 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
* @return {!Element}
*/
element() {
if (!this._element) {
this.createElement();
this.createCells();
var existingElement = this.existingElement();
var element = existingElement || this.createElement();
if (!existingElement || this._stale) {
this.createCells(element);
this._stale = false;
}
if (this._stale) {
this.createCells();
this._stale = false;
}
return /** @type {!Element} */ (this._element);
return element;
}
/**
......@@ -391,7 +386,7 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
_unlink() {
if (this.attached()) {
this._element.remove();
this.existingElement().remove();
this.wasDetached();
}
this.dataGrid = null;
......@@ -407,8 +402,8 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
if (!this._expanded)
return;
this._expanded = false;
if (this._element)
this._element.classList.remove('expanded');
if (this.existingElement())
this.existingElement().classList.remove('expanded');
this.dataGrid.scheduleUpdateStructure();
}
......@@ -433,7 +428,7 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
* @return {boolean}
*/
attached() {
return !!(this.dataGrid && this._element && this._element.parentElement);
return !!(this.dataGrid && this.existingElement() && this.existingElement().parentElement);
}
/**
......@@ -444,7 +439,7 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
this._stale = true;
this.dataGrid.scheduleUpdate();
} else {
this._element = null;
this.resetElement();
}
}
......@@ -452,10 +447,10 @@ UI.ViewportDataGridNode = class extends UI.DataGridNode {
* @return {?Element}
*/
abandonElement() {
var result = this._element;
var result = this.existingElement();
if (result)
result.style.display = 'none';
this._element = null;
this.resetElement();
return result;
}
......
......@@ -11,7 +11,7 @@ public class DevToolsCodingConvention extends CodingConventions.Proxy {
@Override
public boolean isPrivate(String name) {
return false; // name.length() > 1 && name.charAt(0) == '_' && name.charAt(1) != '_';
return name.length() > 1 && name.charAt(0) == '_' && name.charAt(1) != '_';
}
@Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment