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

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

Issue 2186753002: [DevTools] Track URL through the target (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 d70ad805d030110f17e108ddd7e7509b521c45af..6c5f7668d91e344c62fcd84597b3cb0b19bf9370 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
@@ -53,7 +53,6 @@ WebInspector.ResourceTreeModel = function(target, networkManager, securityOrigin
target.registerPageDispatcher(new WebInspector.PageDispatcher(this));
- this._inspectedPageURL = "";
this._pendingReloadOptions = null;
this._reloadSuspensionCount = 0;
@@ -128,32 +127,14 @@ WebInspector.ResourceTreeModel.prototype = {
{
if (!error) {
this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources);
- this._inspectedPageURL = mainFramePayload.frame.url;
this._addFramesRecursively(null, mainFramePayload);
- this._dispatchInspectedURLChanged();
+ this.target().setInspectedURL(mainFramePayload.frame.url);
}
this._cachedResourcesProcessed = true;
this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded);
},
/**
- * @return {string}
- */
- inspectedPageURL: function()
- {
- return this._inspectedPageURL;
- },
-
- /**
- * @return {string}
- */
- inspectedPageDomain: function()
- {
- var parsedURL = this._inspectedPageURL ? this._inspectedPageURL.asParsedURL() : null;
- return parsedURL ? parsedURL.host : "";
- },
-
- /**
* @return {boolean}
*/
cachedResourcesLoaded: function()
@@ -161,12 +142,6 @@ WebInspector.ResourceTreeModel.prototype = {
return this._cachedResourcesProcessed;
},
- _dispatchInspectedURLChanged: function()
- {
- InspectorFrontendHost.inspectedURLChanged(this._inspectedPageURL);
- this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged, this._inspectedPageURL);
- },
-
/**
* @param {!WebInspector.ResourceTreeFrame} frame
* @param {boolean=} aboutToNavigate
@@ -249,7 +224,7 @@ WebInspector.ResourceTreeModel.prototype = {
var addedOrigin = frame.securityOrigin;
if (frame.isMainFrame())
- this._inspectedPageURL = frame.url;
+ this.target().setInspectedURL(frame.url);
dgozman 2016/07/27 17:26:06 Let's do this at the end of the method, so that ev
eostroukhov-old 2016/07/27 17:46:58 Done.
this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, frame);
if (frame.isMainFrame()) {
@@ -266,9 +241,6 @@ WebInspector.ResourceTreeModel.prototype = {
var resources = frame.resources();
for (var i = 0; i < resources.length; ++i)
this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded, resources[i]);
-
- if (frame.isMainFrame())
- this._dispatchInspectedURLChanged();
},
/**
@@ -378,8 +350,6 @@ WebInspector.ResourceTreeModel.prototype = {
this._addFrame(frame);
var frameResource = this._createResourceFromFramePayload(framePayload, framePayload.url, WebInspector.resourceTypes.Document, framePayload.mimeType);
- if (frame.isMainFrame())
- this._inspectedPageURL = frameResource.url;
dgozman 2016/07/27 17:26:06 Where did this go?
eostroukhov-old 2016/07/27 17:46:58 This is ultimately only called from _processCached
frame.addResource(frameResource);
for (var i = 0; frameTreePayload.childFrames && i < frameTreePayload.childFrames.length; ++i)

Powered by Google App Engine
This is Rietveld 408576698