Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js |
| index 2126ac1eb21a93fb05b01c7251e63c45297e975a..5b5f31ec25e5ac0a8d8fc0de75a73f6ad2dafbdb 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js |
| @@ -36,23 +36,23 @@ WebInspector.CallStackSidebarPane = function() |
| this.callFrameList.show(this.element); |
| this._linkifier = new WebInspector.Linkifier(); |
| WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this._asyncStackTracesStateChanged, this); |
| - WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this._blackboxingStateChanged, this); |
| + WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this._update, this); |
| /** @type {!Array<!WebInspector.CallStackSidebarPane.CallFrame>} */ |
| this.callFrames = []; |
| this._locationPool = new WebInspector.LiveLocationPool(); |
| -} |
| - |
| -/** @enum {string} */ |
| -WebInspector.CallStackSidebarPane.Events = { |
| - CallFrameSelected: "CallFrameSelected", |
| + WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerPaused, this._update, this); |
| + WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.DebuggerResumed, this._update, this); |
| + WebInspector.context.addFlavorChangeListener(WebInspector.Target, this._update, this); |
| + WebInspector.context.addFlavorChangeListener(WebInspector.DebuggerModel.CallFrame, this._updateCallFrame, this); |
| } |
| WebInspector.CallStackSidebarPane.prototype = { |
| - /** |
| - * @param {?WebInspector.DebuggerPausedDetails} details |
| - */ |
| - update: function(details) |
| + _update: function() |
| { |
| + var target = WebInspector.context.flavor(WebInspector.Target); |
| + var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); |
| + var details = debuggerModel.debuggerPausedDetails(); |
|
dgozman
2016/08/11 01:42:16
debuggerModel could be null
|
| + |
| this.callFrameList.detach(); |
| this.callFrameList.clear(); |
| this._linkifier.reset(); |
| @@ -101,6 +101,7 @@ WebInspector.CallStackSidebarPane.prototype = { |
| this.element.insertBefore(element, this.element.firstChild); |
| this._hiddenCallFramesMessageElement = element; |
| } |
| + WebInspector.viewManager.revealViewWithWidget(this); |
| }, |
| /** |
| @@ -248,19 +249,6 @@ WebInspector.CallStackSidebarPane.prototype = { |
| } |
| }, |
| - _blackboxingStateChanged: function() |
| - { |
| - if (!this._debuggerModel) |
| - return; |
| - var details = this._debuggerModel.debuggerPausedDetails(); |
| - if (!details) |
| - return; |
| - this.update(details); |
| - var selectedCallFrame = this._debuggerModel.selectedCallFrame(); |
| - if (selectedCallFrame) |
| - this.setSelectedCallFrame(selectedCallFrame); |
| - }, |
| - |
| _asyncStackTracesStateChanged: function() |
| { |
| var enabled = WebInspector.moduleSetting("enableAsyncStackTraces").get(); |
| @@ -288,11 +276,9 @@ WebInspector.CallStackSidebarPane.prototype = { |
| this._selectNextVisibleCallFrame(0); |
| }, |
| - /** |
| - * @param {!WebInspector.DebuggerModel.CallFrame} x |
| - */ |
| - setSelectedCallFrame: function(x) |
| + _updateCallFrame: function() |
| { |
| + var x = WebInspector.context.flavor(WebInspector.DebuggerModel.CallFrame); |
|
dgozman
2016/08/11 01:42:16
x -> selectedCallFrame
|
| for (var i = 0; i < this.callFrames.length; ++i) { |
| var callFrame = this.callFrames[i]; |
| callFrame.setSelected(callFrame._debuggerCallFrame === x); |
| @@ -375,7 +361,7 @@ WebInspector.CallStackSidebarPane.prototype = { |
| callFrameItem.element.scrollIntoViewIfNeeded(); |
| var callFrame = callFrameItem._debuggerCallFrame; |
| if (callFrame) |
| - this.dispatchEventToListeners(WebInspector.CallStackSidebarPane.Events.CallFrameSelected, callFrame); |
| + callFrame.debuggerModel.setSelectedCallFrame(callFrame); |
| }, |
| _copyStackTrace: function() |