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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js

Issue 2738773002: DevTools: [Bindings] add resources to every frame. (Closed)
Patch Set: rebaseline tests Created 3 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 | « third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/pause-in-removed-frame-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
index 6cea05b6809fea62ec437a308a933c07bf0e3029..19a97cfbe7ff2d1d72afca49e3875ac2078e7612 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
@@ -83,7 +83,8 @@ Bindings.NetworkProject = class extends SDK.SDKObject {
resourceTreeModel.addEventListener(
SDK.ResourceTreeModel.Events.FrameWillNavigate, this._frameWillNavigate, this),
resourceTreeModel.addEventListener(
- SDK.ResourceTreeModel.Events.MainFrameNavigated, this._mainFrameNavigated, this));
+ SDK.ResourceTreeModel.Events.MainFrameNavigated, this._mainFrameNavigated, this),
+ resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameDetached, this._frameDetached, this));
}
var debuggerModel = SDK.DebuggerModel.fromTarget(target);
@@ -313,20 +314,22 @@ Bindings.NetworkProject = class extends SDK.SDKObject {
resource.contentURL().startsWith('data:'))
return;
+ var frame = SDK.ResourceTreeFrame.fromResource(resource);
// Never load document twice.
- if (this._workspace.uiSourceCodeForURL(resource.url))
+ var projectId = Bindings.NetworkProject.projectId(this.target(), frame, false);
+ var project = this._workspaceProjects.get(projectId);
+ if (project && project.uiSourceCodeForURL(resource.url))
return;
- var uiSourceCode = this._createFile(resource, SDK.ResourceTreeFrame.fromResource(resource), false);
+ var uiSourceCode = this._createFile(resource, frame, false);
uiSourceCode[Bindings.NetworkProject._resourceSymbol] = resource;
this._addUISourceCodeWithProvider(uiSourceCode, resource, this._resourceMetadata(resource));
}
/**
- * @param {!Common.Event} event
+ * @param {!SDK.ResourceTreeFrame} frame
*/
- _frameWillNavigate(event) {
- var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data);
+ _removeFrameResources(frame) {
var project = this._workspaceProject(frame, false);
for (var resource of frame.resources())
project.removeUISourceCode(resource.url);
@@ -338,9 +341,24 @@ Bindings.NetworkProject = class extends SDK.SDKObject {
/**
* @param {!Common.Event} event
*/
+ _frameWillNavigate(event) {
+ var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data);
+ this._removeFrameResources(frame);
+ }
+
+ /**
+ * @param {!Common.Event} event
+ */
+ _frameDetached(event) {
+ var frame = /** @type {!SDK.ResourceTreeFrame} */ (event.data);
+ this._removeFrameResources(frame);
+ }
+
+ /**
+ * @param {!Common.Event} event
+ */
_mainFrameNavigated(event) {
this._reset();
- this._populate();
}
_suspendStateChanged() {
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/sources/debugger/pause-in-removed-frame-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698