From 572a174a2cf2c6e5bca9ceb8990a9e1229c5c75d Mon Sep 17 00:00:00 2001 From: "pfeldman@chromium.org" Date: Fri, 13 Apr 2012 14:33:22 +0000 Subject: [PATCH] Web Inspector: follow up to r114116 - fixing QT test https://bugs.webkit.org/show_bug.cgi?id=83892 Reviewed by Yury Semikhatsky. Source/WebCore: Requesting content for the scripts exclusively via the page agent now. * inspector/front-end/Resource.js: (WebInspector.Resource.prototype.get content): (WebInspector.Resource.prototype.get contentEncoded): (WebInspector.Resource.prototype.requestContent): (WebInspector.ResourceRevision.prototype.requestContent): LayoutTests: * inspector/debugger/raw-source-code.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114133 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 9 +++++++++ LayoutTests/inspector/debugger/raw-source-code.html | 9 ++++++++- Source/WebCore/ChangeLog | 15 +++++++++++++++ Source/WebCore/inspector/front-end/Resource.js | 20 +++----------------- 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 9cfb885..ee60b99 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,12 @@ +2012-04-13 Pavel Feldman + + Web Inspector: follow up to r114116 - fixing QT test + https://bugs.webkit.org/show_bug.cgi?id=83892 + + Reviewed by Yury Semikhatsky. + + * inspector/debugger/raw-source-code.html: + 2012-04-13 Yi Shen InsertHTML fails to insert h6 if the insertion point is before some text. diff --git a/LayoutTests/inspector/debugger/raw-source-code.html b/LayoutTests/inspector/debugger/raw-source-code.html index 3ce1bb0..6a50f4e 100644 --- a/LayoutTests/inspector/debugger/raw-source-code.html +++ b/LayoutTests/inspector/debugger/raw-source-code.html @@ -15,11 +15,17 @@ function test() callback(undefined, mockContentsMap[requestId], false); } + PageAgent.getResourceContent = function(frameId, url, callback) + { + callback(undefined, mockContentsMap[url], false); + } + function createRequestMock(type, finished, content) { var requestId = ++lastRequestId + ""; + var url = "http://fake.url/" + requestId; WebInspector.resourceTreeModel._addFrame(new WebInspector.ResourceTreeFrame(WebInspector.resourceTreeModel, null, {id: "frame-id"})); - var request = new WebInspector.NetworkRequest(requestId, "http://fake.url", "http://fake.url", "frame-id", "loader-id"); + var request = new WebInspector.NetworkRequest(requestId, url, "http://fake.url", "frame-id", "loader-id"); request.type = type === "document" ? WebInspector.resourceTypes.Document : WebInspector.resourceTypes.Script; WebInspector.networkManager._dispatcher._startNetworkRequest(request); @@ -27,6 +33,7 @@ function test() finishRequest(request); mockContentsMap[requestId] = content; + mockContentsMap[url] = content; return request; } diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 80fb4ec..94c63df 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,18 @@ +2012-04-13 Pavel Feldman + + Web Inspector: follow up to r114116 - fixing QT test + https://bugs.webkit.org/show_bug.cgi?id=83892 + + Reviewed by Yury Semikhatsky. + + Requesting content for the scripts exclusively via the page agent now. + + * inspector/front-end/Resource.js: + (WebInspector.Resource.prototype.get content): + (WebInspector.Resource.prototype.get contentEncoded): + (WebInspector.Resource.prototype.requestContent): + (WebInspector.ResourceRevision.prototype.requestContent): + 2012-04-13 Yi Shen InsertHTML fails to insert h6 if the insertion point is before some text. diff --git a/Source/WebCore/inspector/front-end/Resource.js b/Source/WebCore/inspector/front-end/Resource.js index abca201..7924cb0 100644 --- a/Source/WebCore/inspector/front-end/Resource.js +++ b/Source/WebCore/inspector/front-end/Resource.js @@ -289,9 +289,7 @@ WebInspector.Resource.prototype = { */ get content() { - if (typeof this._content !== "undefined") - return this._content; - return this._request ? this._request.content : this._content; + return this._content; }, /** @@ -299,9 +297,7 @@ WebInspector.Resource.prototype = { */ get contentEncoded() { - if (typeof this._contentEncoded !== "undefined") - return this._contentEncoded; - return this._request ? this._request.contentEncoded : this._contentEncoded; + return this._contentEncoded; }, /** @@ -368,11 +364,6 @@ WebInspector.Resource.prototype = { */ requestContent: function(callback) { - if (this._request) { - this._request.requestContent(callback); - return; - } - if (typeof this._content !== "undefined") { callback(this._content, !!this._contentEncoded); return; @@ -533,12 +524,7 @@ WebInspector.ResourceRevision.prototype = { callback(error ? null : content); } - // FIXME: https://bugs.webkit.org/show_bug.cgi?id=61363 We should separate NetworkResource (NetworkPanel resource) - // from ResourceRevision (ResourcesPanel/ScriptsPanel resource) and request content accordingly. - if (this._resource.request) - NetworkAgent.getResponseBody(this._resource.request.requestId, callbackWrapper); - else - PageAgent.getResourceContent(this._resource.frameId, this._resource.url, callbackWrapper); + PageAgent.getResourceContent(this._resource.frameId, this._resource.url, callbackWrapper); } } -- 2.7.4