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
+2012-04-13 Pavel Feldman <pfeldman@chromium.org>
+
+ 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 <yi.4.shen@nokia.com>
InsertHTML fails to insert h6 if the insertion point is before some text.
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);
finishRequest(request);
mockContentsMap[requestId] = content;
+ mockContentsMap[url] = content;
return request;
}
+2012-04-13 Pavel Feldman <pfeldman@chromium.org>
+
+ 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 <yi.4.shen@nokia.com>
InsertHTML fails to insert h6 if the insertion point is before some text.
*/
get content()
{
- if (typeof this._content !== "undefined")
- return this._content;
- return this._request ? this._request.content : this._content;
+ return this._content;
},
/**
*/
get contentEncoded()
{
- if (typeof this._contentEncoded !== "undefined")
- return this._contentEncoded;
- return this._request ? this._request.contentEncoded : this._contentEncoded;
+ return this._contentEncoded;
},
/**
*/
requestContent: function(callback)
{
- if (this._request) {
- this._request.requestContent(callback);
- return;
- }
-
if (typeof this._content !== "undefined") {
callback(this._content, !!this._contentEncoded);
return;
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);
}
}