Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(688)

Unified Diff: Source/devtools/front_end/SplitView.js

Issue 208053003: Fix HeapSnapshotView leaks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/HeapSnapshotView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/SplitView.js
diff --git a/Source/devtools/front_end/SplitView.js b/Source/devtools/front_end/SplitView.js
index 8a69df9d84d3f7b3d1106a8ad89ba0651b811feb..1128ee75c3f663f631df9a2e780538f653184072 100644
--- a/Source/devtools/front_end/SplitView.js
+++ b/Source/devtools/front_end/SplitView.js
@@ -42,8 +42,6 @@ WebInspector.SplitView = function(isVertical, secondIsSidebar, settingName, defa
this.registerRequiredCSS("splitView.css");
this.element.classList.add("split-view");
- WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this);
-
this._mainView = new WebInspector.VBox();
this._mainView.makeLayoutBoundary();
this._mainElement = this._mainView.element;
@@ -572,7 +570,13 @@ WebInspector.SplitView.prototype = {
wasShown: function()
{
- this._updateLayout();
+ this._forceUpdateLayout();
+ WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this);
+ },
+
+ willHide: function()
+ {
+ WebInspector.zoomManager.removeEventListener(WebInspector.ZoomManager.Events.ZoomChanged, this._onZoomChanged, this);
},
onResize: function()
@@ -779,15 +783,19 @@ WebInspector.SplitView.prototype = {
setting.set(state);
},
+ _forceUpdateLayout: function()
+ {
+ // Force layout even if sidebar size does not change.
+ this._sidebarSize = -1;
+ this._updateLayout();
+ },
+
/**
* @param {!WebInspector.Event} event
*/
_onZoomChanged: function(event)
{
- // Force layout even if sidebar size does not change.
- this._sidebarSize = -1;
- if (this.isShowing())
- this._updateLayout();
+ this._forceUpdateLayout();
},
/**
« no previous file with comments | « Source/devtools/front_end/HeapSnapshotView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698