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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js

Issue 2833583003: DevTools: proper management of ResourceTreeModel in NetworkProject (Closed)
Patch Set: Created 3 years, 8 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
Index: third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
index 95e20682336f8f7ed6e94b3884def3a53260c3ce..c31e38de0eb1ab5115d48ef41c08ce47b8f3f690 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
@@ -28,9 +28,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/**
- * @unrestricted
- */
SDK.ResourceTreeModel = class extends SDK.SDKModel {
/**
* @param {!SDK.Target} target
@@ -44,18 +41,21 @@ SDK.ResourceTreeModel = class extends SDK.SDKModel {
networkManager.addEventListener(
SDK.NetworkManager.Events.RequestUpdateDropped, this._onRequestUpdateDropped, this);
}
-
this._agent = target.pageAgent();
this._agent.enable();
this._securityOriginManager = target.model(SDK.SecurityOriginManager);
- this._fetchResourceTree();
-
target.registerPageDispatcher(new SDK.PageDispatcher(this));
+ /** @type {!Map<string, !SDK.ResourceTreeFrame>} */
+ this._frames = new Map();
+ this._cachedResourcesProcessed = false;
this._pendingReloadOptions = null;
this._reloadSuspensionCount = 0;
this._isInterstitialShowing = false;
+ this.mainFrame = null;
+
+ this._fetchResourceTree();
}
/**
@@ -101,7 +101,6 @@ SDK.ResourceTreeModel = class extends SDK.SDKModel {
}
_fetchResourceTree() {
- /** @type {!Map<string, !SDK.ResourceTreeFrame>} */
this._frames = new Map();
dgozman 2017/04/20 17:23:17 You can just remove this - it's only called from c
lushnikov 2017/04/21 00:51:27 it is also called from test - i preferred to keep
this._cachedResourcesProcessed = false;
this._agent.getResourceTree(this._processCachedResources.bind(this));

Powered by Google App Engine
This is Rietveld 408576698