Skip to content

Commit

Permalink
squash 'resources/unpacked/devtools' changes from 51d8180..30ad697
Browse files Browse the repository at this point in the history
30ad697 [Devtools] New structure and colorize rows for network products
d46aaf6 [Devtools][Regression] Fixed websocket frame selection loss on frame received
fb9c652 DevTools: Don't focus layers panel when it is shown
ba54910 Reland of DevTools: fix aggregated donut chart cache population (patchset #1 id:1 of https://codereview.chromium.org/2839083002/ )
ef9fa0f Revert of DevTools: Show screenshots on the main flamechart (patchset #3 id:40001 of https://codereview.chromium.org/2830343004/ )
a75caae [DevTools] Host paint profiles in PaintProfilerModel
97e8024 DevTools: clicking in console messages should not jump to bottom

git-subtree-dir: resources/unpacked/devtools
git-subtree-split: 30ad697
  • Loading branch information
darwin committed Apr 29, 2017
1 parent b0f1d0e commit 452e532
Show file tree
Hide file tree
Showing 32 changed files with 629 additions and 678 deletions.
15 changes: 8 additions & 7 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ all_devtools_files = [
"front_end/network/networkLogView.css",
"front_end/network/NetworkLogView.js",
"front_end/network/NetworkLogViewColumns.js",
"front_end/network/NetworkGroupers.js",
"front_end/network/networkManageCustomHeadersView.css",
"front_end/network/NetworkManageCustomHeadersView.js",
"front_end/network/NetworkOverview.js",
Expand All @@ -339,8 +340,6 @@ all_devtools_files = [
"front_end/network_conditions/module.json",
"front_end/network_conditions/NetworkConditionsSelector.js",
"front_end/network_conditions/networkConditionsSettingsTab.css",
"front_end/network_group_lookup/module.json",
"front_end/network_group_lookup/NetworkProductGroupLookup.js",
"front_end/network_log/HAREntry.js",
"front_end/network_log/module.json",
"front_end/network_log/NetworkLog.js",
Expand Down Expand Up @@ -378,9 +377,11 @@ all_devtools_files = [
"front_end/platform/module.json",
"front_end/platform/utilities.js",
"front_end/product_registry/module.json",
"front_end/product_registry/ProductNameForURL.js",
"front_end/product_registry/ProductRegistryData.js",
"front_end/product_registry/sha1/sha1.js",
"front_end/product_registry/ProductRegistry.js",
"front_end/product_registry_impl/module.json",
"front_end/product_registry_impl/ProductRegistryImpl.js",
"front_end/product_registry_impl/ProductRegistryData.js",
"front_end/product_registry_impl/sha1/sha1.js",
"front_end/profiler/BottomUpProfileDataGrid.js",
"front_end/profiler/CPUProfileFlameChart.js",
"front_end/profiler/CPUProfileView.js",
Expand Down Expand Up @@ -870,6 +871,7 @@ generated_resources = [
"$resources_out_dir/network/network_module.js",
"$resources_out_dir/object_ui/object_ui_module.js",
"$resources_out_dir/perf_ui/perf_ui_module.js",
"$resources_out_dir/product_registry/product_registry_module.js",
"$resources_out_dir/profiler/profiler_module.js",
"$resources_out_dir/quick_open/quick_open_module.js",
"$resources_out_dir/resources/resources_module.js",
Expand All @@ -892,8 +894,7 @@ generated_remote_modules = [
"$resources_out_dir/cm_modes/cm_modes_module.js",
"$resources_out_dir/emulated_devices/emulated_devices_module.js",
"$resources_out_dir/gonzales/gonzales_module.js",
"$resources_out_dir/network_group_lookup/network_group_lookup_module.js",
"$resources_out_dir/product_registry/product_registry_module.js",
"$resources_out_dir/product_registry_impl/product_registry_impl_module.js",
"$resources_out_dir/screencast/screencast_module.js",
]

Expand Down
16 changes: 9 additions & 7 deletions front_end/console/ConsoleView.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,8 @@ Console.ConsoleView = class extends UI.VBox {
* @override
*/
focus() {
if (this._prompt.hasFocus())
return;
// Set caret position before setting focus in order to avoid scrolling
// by focus().
this._prompt.moveCaretToEndOfPrompt();
this._prompt.focus();
if (!this._prompt.hasFocus())
this._prompt.focus();
}

/**
Expand Down Expand Up @@ -666,8 +662,14 @@ Console.ConsoleView = class extends UI.VBox {
*/
_messagesClicked(event) {
var targetElement = event.deepElementFromPoint();
if (!targetElement || targetElement.isComponentSelectionCollapsed())

// Do not focus prompt if messages have selection.
if (!targetElement || targetElement.isComponentSelectionCollapsed()) {
var clickedOutsideMessageList = event.target === this._messagesElement;
if (clickedOutsideMessageList)
this._prompt.moveCaretToEndOfPrompt();
this.focus();
}
var groupMessage = event.target.enclosingNodeOrSelfWithClass('console-group-title');
if (!groupMessage)
return;
Expand Down
4 changes: 2 additions & 2 deletions front_end/inspector.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
{ "name": "services", "type": "autostart" },
{ "name": "elements", "condition": "!v8only" },
{ "name": "network", "condition": "!v8only" },
{ "name": "network_group_lookup", "condition": "!v8only", "type": "remote" },
{ "name": "sources" },
{ "name": "timeline", "condition": "!v8only" },
{ "name": "timeline_model", "condition": "!v8only" },
{ "name": "product_registry", "condition": "!v8only", "type": "remote" },
{ "name": "product_registry", "condition": "!v8only" },
{ "name": "product_registry_impl", "condition": "!v8only", "type": "remote" },
{ "name": "profiler" },
{ "name": "resources", "condition": "!v8only" },
{ "name": "audits", "condition": "!v8only" },
Expand Down
4 changes: 1 addition & 3 deletions front_end/layer_viewer/PaintProfilerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,9 @@ LayerViewer.PaintProfilerCommandLogView = class extends UI.ThrottledWidget {
}

/**
* @param {?SDK.Target} target
* @param {!Array.<!SDK.PaintProfilerLogItem>} log
*/
setCommandLog(target, log) {
this._target = target;
setCommandLog(log) {
this._log = log;
/** @type {!Map<!SDK.PaintProfilerLogItem>} */
this._treeItemCache = new Map();
Expand Down
2 changes: 1 addition & 1 deletion front_end/layers/LayerPaintProfilerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Layers.LayerPaintProfilerView = class extends UI.SplitWidget {
* @this {Layers.LayerPaintProfilerView}
*/
function setSnapshotAndLog(snapshot, log) {
this._logTreeView.setCommandLog(snapshot && snapshot.target(), log || []);
this._logTreeView.setCommandLog(log || []);
this._paintProfilerView.setSnapshotAndLog(snapshot, log || [], null);
if (snapshot)
snapshot.release();
Expand Down
40 changes: 19 additions & 21 deletions front_end/layers/LayerTreeModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
Layers.LayerTreeModel = class extends SDK.SDKModel {
constructor(target) {
super(target);
this._layerTreeAgent = target.layerTreeAgent();
target.registerLayerTreeDispatcher(new Layers.LayerTreeDispatcher(this));
this._paintProfilerModel = /** @type {!SDK.PaintProfilerModel} */ (target.model(SDK.PaintProfilerModel));
var resourceTreeModel = target.model(SDK.ResourceTreeModel);
if (resourceTreeModel) {
resourceTreeModel.addEventListener(
Expand All @@ -48,7 +50,7 @@ Layers.LayerTreeModel = class extends SDK.SDKModel {
if (!this._enabled)
return;
this._enabled = false;
this.target().layerTreeAgent().disable();
this._layerTreeAgent.disable();
}

enable() {
Expand All @@ -61,8 +63,8 @@ Layers.LayerTreeModel = class extends SDK.SDKModel {
_forceEnable() {
this._lastPaintRectByLayerId = {};
if (!this._layerTree)
this._layerTree = new Layers.AgentLayerTree(this.target());
this.target().layerTreeAgent().enable();
this._layerTree = new Layers.AgentLayerTree(this);
this._layerTreeAgent.enable();
}

/**
Expand Down Expand Up @@ -134,10 +136,11 @@ Layers.LayerTreeModel.Events = {
*/
Layers.AgentLayerTree = class extends SDK.LayerTreeBase {
/**
* @param {?SDK.Target} target
* @param {!Layers.LayerTreeModel} layerTreeModel
*/
constructor(target) {
super(target);
constructor(layerTreeModel) {
super(layerTreeModel.target());
this._layerTreeModel = layerTreeModel;
}

/**
Expand Down Expand Up @@ -186,7 +189,7 @@ Layers.AgentLayerTree = class extends SDK.LayerTreeBase {
if (layer)
layer._reset(layers[i]);
else
layer = new Layers.AgentLayer(this.target(), layers[i]);
layer = new Layers.AgentLayer(this._layerTreeModel, layers[i]);
this._layersById[layerId] = layer;
var backendNodeId = layers[i].backendNodeId;
if (backendNodeId)
Expand Down Expand Up @@ -218,11 +221,11 @@ Layers.AgentLayerTree = class extends SDK.LayerTreeBase {
*/
Layers.AgentLayer = class {
/**
* @param {?SDK.Target} target
* @param {!Layers.LayerTreeModel} layerTreeModel
* @param {!Protocol.LayerTree.Layer} layerPayload
*/
constructor(target, layerPayload) {
this._target = target;
constructor(layerTreeModel, layerPayload) {
this._layerTreeModel = layerTreeModel;
this._reset(layerPayload);
}

Expand Down Expand Up @@ -401,14 +404,9 @@ Layers.AgentLayer = class {
* @param {function(!Array.<string>)} callback
*/
requestCompositingReasons(callback) {
if (!this._target) {
callback([]);
return;
}

var wrappedCallback = Protocol.inspectorBackend.wrapClientCallback(
callback, 'Protocol.LayerTree.reasonsForCompositingLayer(): ', undefined, []);
this._target.layerTreeAgent().compositingReasons(this.id(), wrappedCallback);
this._layerTreeModel._layerTreeAgent.compositingReasons(this.id(), wrappedCallback);
}

/**
Expand Down Expand Up @@ -436,11 +434,11 @@ Layers.AgentLayer = class {
* @return {!Array<!Promise<?SDK.SnapshotWithRect>>}
*/
snapshots() {
var rect = {x: 0, y: 0, width: this.width(), height: this.height()};
var promise = this._target.layerTreeAgent().makeSnapshot(
this.id(), (error, snapshotId) => error || !this._target ?
null :
{rect: rect, snapshot: new SDK.PaintProfilerSnapshot(this._target, snapshotId)});
var promise = this._layerTreeModel._paintProfilerModel.makeSnapshot(this.id()).then(snapshot => {
if (!snapshot)
return null;
return {rect: {x: 0, y: 0, width: this.width(), height: this.height()}, snapshot: snapshot};
});
return [promise];
}

Expand Down
1 change: 0 additions & 1 deletion front_end/layers/LayersPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ Layers.LayersPanel = class extends UI.PanelWithSidebar {
super.wasShown();
if (this._model)
this._model.enable();
this._layerTreeOutline.focus();
}

/**
Expand Down
Loading

0 comments on commit 452e532

Please sign in to comment.