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

Unified Diff: Source/devtools/front_end/sdk/CSSWorkspaceBinding.js

Issue 429593006: DevTools: Do not re-create CSSWorkspaceBinding TargetInfo on MainFrameNavigated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revert _dispose() Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/CSSWorkspaceBinding.js
diff --git a/Source/devtools/front_end/sdk/CSSWorkspaceBinding.js b/Source/devtools/front_end/sdk/CSSWorkspaceBinding.js
index f1ab7294d134779142153b3195a8b3c9d81a0074..e32eae29e7ec6c9af5a6e864c10c57dd026ad72e 100644
--- a/Source/devtools/front_end/sdk/CSSWorkspaceBinding.js
+++ b/Source/devtools/front_end/sdk/CSSWorkspaceBinding.js
@@ -71,10 +71,7 @@ WebInspector.CSSWorkspaceBinding.prototype = {
_mainFrameCreatedOrNavigated: function(event)
{
var target = /** @type {!WebInspector.ResourceTreeModel} */ (event.target).target();
- var info = this._targetToTargetInfo.remove(target);
- if (info)
- info._dispose();
- this._targetToTargetInfo.put(target, new WebInspector.CSSWorkspaceBinding.TargetInfo(target, WebInspector.workspace, WebInspector.networkWorkspaceBinding));
+ this._targetToTargetInfo.get(target)._reset();
},
/**
@@ -234,8 +231,14 @@ WebInspector.CSSWorkspaceBinding.TargetInfo.prototype = {
_dispose: function()
{
+ this._reset();
this._target.cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded, this._styleSheetAdded, this);
this._target.cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved, this._styleSheetRemoved, this);
+ },
+
+ _reset: function()
+ {
+ this._headerInfoById.clear();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698