https://bugs.webkit.org/show_bug.cgi?id=83773
Reviewed by Yury Semikhatsky.
This step moves request-related views from being resource-based to request-based.
See https://bugs.webkit.org/show_bug.cgi?id=61363 for the meta bug.
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/compile-front-end.py:
* inspector/front-end/ContentProviders.js:
(WebInspector.ResourceContentProvider):
(WebInspector.ResourceContentProvider.prototype.requestContent):
(WebInspector.ResourceContentProvider.prototype.searchInContent):
* inspector/front-end/NetworkItemView.js:
(WebInspector.NetworkItemView):
(WebInspector.RequestContentView):
(WebInspector.RequestContentView.prototype._ensureInnerViewShown):
* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkLogView.prototype._showPopover):
* inspector/front-end/NetworkRequest.js:
(WebInspector.NetworkRequest.prototype.resource):
* inspector/front-end/RawSourceCode.js:
(WebInspector.RawSourceCode.prototype._createContentProvider):
* inspector/front-end/RequestCookiesView.js: Renamed from Source/WebCore/inspector/front-end/ResourceCookiesView.js.
(WebInspector.RequestCookiesView):
* inspector/front-end/RequestHTMLView.js: Renamed from Source/WebCore/inspector/front-end/ResourceHTMLView.js.
(WebInspector.RequestHTMLView):
(WebInspector.RequestHTMLView.prototype._createIFrame):
* inspector/front-end/RequestHeadersView.js: Renamed from Source/WebCore/inspector/front-end/ResourceHeadersView.js.
(WebInspector.RequestHeadersView):
* inspector/front-end/RequestJSONView.js: Renamed from Source/WebCore/inspector/front-end/ResourceJSONView.js.
(WebInspector.RequestJSONView):
(WebInspector.RequestJSONView.parseJSON.WebInspector.RequestJSONView.parseJSONP):
* inspector/front-end/RequestPreviewView.js: Renamed from Source/WebCore/inspector/front-end/ResourcePreviewView.js.
(WebInspector.RequestPreviewView):
(WebInspector.RequestPreviewView.prototype.contentLoaded):
(WebInspector.RequestPreviewView.prototype._createPreviewView):
* inspector/front-end/RequestResponseView.js: Renamed from Source/WebCore/inspector/front-end/ResourceResponseView.js.
(WebInspector.RequestResponseView):
(WebInspector.RequestResponseView.prototype.get sourceView):
(WebInspector.RequestResponseView.prototype.contentLoaded):
* inspector/front-end/RequestTimingView.js: Renamed from Source/WebCore/inspector/front-end/ResourceTimingView.js.
(WebInspector.RequestTimingView):
(WebInspector.RequestTimingView.prototype._refresh):
* inspector/front-end/RequestView.js: Copied from Source/WebCore/inspector/front-end/NetworkRequest.js.
(WebInspector.RequestView):
(WebInspector.RequestView.prototype.hasContent):
(WebInspector.RequestView.hasTextContent):
(WebInspector.RequestView.nonSourceViewForRequest):
* inspector/front-end/ResourceView.js:
(WebInspector.ResourceSourceFrame._canonicalMIMEType):
(WebInspector.ResourceSourceFrame._mimeTypeForResource):
(WebInspector.ResourceSourceFrame.prototype.requestContent):
(WebInspector.ResourceSourceFrame.prototype._contentChanged):
(WebInspector.ResourceRevisionSourceFrame.prototype.requestContent):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/inspector.html:
Tools: Web Inspector: Disabling Inspector causes build failure on Windows
https://bugs.webkit.org/show_bug.cgi?id=83557
Patch by Vivek Galatage <vivekgalatage@gmail.com> on 2012-04-11
Reviewed by Pavel Feldman.
The calls to inspector APIs are not put under ENABLE(INSPECTOR) guard.
This change brings all such API calls under the guard.
* WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:
(LayoutTestController):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
LayoutTests: Web Inspector: extracting NetworkRequest from Resource (step 2)
https://bugs.webkit.org/show_bug.cgi?id=83773
Reviewed by Yury Semikhatsky.
* http/tests/inspector/network/network-request-revision-content.html:
* http/tests/inspector/network/request-parameters-decoding.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113966
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: extracting NetworkRequest from Resource (step 2)
+ https://bugs.webkit.org/show_bug.cgi?id=83773
+
+ Reviewed by Yury Semikhatsky.
+
+ * http/tests/inspector/network/network-request-revision-content.html:
+ * http/tests/inspector/network/request-parameters-decoding.html:
+
2012-04-12 Zalan Bujtas <zbujtas@gmail.com>
[Qt][WK2] Zoom gesture with double tap crashes on iframe when main frame has scroll offset.
-Tests ResourceJSONView ability to parse JSON passed in XHR, JSONP
+Tests RequestJSONView ability to parse JSON passed in XHR, JSONP
Bug 65559
var testData;
testData = "while(1);";
- InspectorTest.assertTrue(!WebInspector.ResourceJSONView.parseJSON(testData), "Should not be able to parse \"" + testData + "\".");
+ InspectorTest.assertTrue(!WebInspector.RequestJSONView.parseJSON(testData), "Should not be able to parse \"" + testData + "\".");
testData = "{\"name\": \"value\"";
- InspectorTest.assertTrue(!WebInspector.ResourceJSONView.parseJSON(testData), "Should not be able to parse \"" + testData + "\".");
+ InspectorTest.assertTrue(!WebInspector.RequestJSONView.parseJSON(testData), "Should not be able to parse \"" + testData + "\".");
testData = "{\"name\": \"value\"}";
- var parsedJSON = WebInspector.ResourceJSONView.parseJSON(testData);
+ var parsedJSON = WebInspector.RequestJSONView.parseJSON(testData);
InspectorTest.assertEquals(parsedJSON.prefix, "");
InspectorTest.assertEquals(parsedJSON.data.name, "value");
InspectorTest.assertEquals(parsedJSON.suffix, "");
testData = "while(1); {\"name\": \"value\"}";
- parsedJSON = WebInspector.ResourceJSONView.parseJSON(testData);
+ parsedJSON = WebInspector.RequestJSONView.parseJSON(testData);
InspectorTest.assertEquals(parsedJSON.prefix, "while(1); ");
InspectorTest.assertEquals(parsedJSON.data.name, "value");
InspectorTest.assertEquals(parsedJSON.suffix, "");
testData = "func({)";
- InspectorTest.assertTrue(!WebInspector.ResourceJSONView.parseJSONP(testData), "Should not be able to parse \"" + testData + "\".");
+ InspectorTest.assertTrue(!WebInspector.RequestJSONView.parseJSONP(testData), "Should not be able to parse \"" + testData + "\".");
testData = "func){(";
- InspectorTest.assertTrue(!WebInspector.ResourceJSONView.parseJSONP(testData), "Should not be able to parse \"" + testData + "\".");
+ InspectorTest.assertTrue(!WebInspector.RequestJSONView.parseJSONP(testData), "Should not be able to parse \"" + testData + "\".");
testData = "func({\"name\": \"value\"}";
- InspectorTest.assertTrue(!WebInspector.ResourceJSONView.parseJSONP(testData), "Should not be able to parse \"" + testData + "\".");
+ InspectorTest.assertTrue(!WebInspector.RequestJSONView.parseJSONP(testData), "Should not be able to parse \"" + testData + "\".");
testData = "func{\"name\": \"value\"})";
- InspectorTest.assertTrue(!WebInspector.ResourceJSONView.parseJSONP(testData), "Should not be able to parse \"" + testData + "\".");
+ InspectorTest.assertTrue(!WebInspector.RequestJSONView.parseJSONP(testData), "Should not be able to parse \"" + testData + "\".");
testData = "func({\"name\": \"value\"})";
- var parsedJSONP = WebInspector.ResourceJSONView.parseJSONP(testData);
+ var parsedJSONP = WebInspector.RequestJSONView.parseJSONP(testData);
InspectorTest.assertEquals(parsedJSONP.prefix, "func(");
InspectorTest.assertEquals(parsedJSONP.data.name, "value");
InspectorTest.assertEquals(parsedJSONP.suffix, ")");
</script>
</head>
<body onload="runTest()">
-<p>Tests ResourceJSONView ability to parse JSON passed in XHR, JSONP</p>
+<p>Tests RequestJSONView ability to parse JSON passed in XHR, JSONP</p>
<a href="https://bugs.webkit.org/show_bug.cgi?id=65559">Bug 65559</a>
</body>
</html>
function step2(msg)
{
var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
- request.addRevision("");
- request.history[0].requestContent(step3);
+ var resource = request.resource();
+ resource.addRevision("");
+ resource.history[0].requestContent(step3);
}
function step3()
{
var request = WebInspector.panels.network.requests[WebInspector.panels.network.requests.length - 1];
- InspectorTest.addResult(request.url);
- InspectorTest.addResult(request.content);
+ var resource = request.resource();
+ InspectorTest.addResult(resource.url);
+ InspectorTest.addResult(resource.content);
InspectorTest.completeTest();
}
}
function test()
{
var value = "Test+%21%40%23%24%25%5E%26*%28%29_%2B+parameters.";
- var parameterElement = WebInspector.ResourceHeadersView.prototype._formatParameter(value, "", true);
+ var parameterElement = WebInspector.RequestHeadersView.prototype._formatParameter(value, "", true);
InspectorTest.addResult("Original value: " + value);
InspectorTest.addResult("Decoded value: " + parameterElement.textContent);
InspectorTest.completeTest();
+2012-04-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Web Inspector: extracting NetworkRequest from Resource (step 2)
+ https://bugs.webkit.org/show_bug.cgi?id=83773
+
+ Reviewed by Yury Semikhatsky.
+
+ This step moves request-related views from being resource-based to request-based.
+ See https://bugs.webkit.org/show_bug.cgi?id=61363 for the meta bug.
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/compile-front-end.py:
+ * inspector/front-end/ContentProviders.js:
+ (WebInspector.ResourceContentProvider):
+ (WebInspector.ResourceContentProvider.prototype.requestContent):
+ (WebInspector.ResourceContentProvider.prototype.searchInContent):
+ * inspector/front-end/NetworkItemView.js:
+ (WebInspector.NetworkItemView):
+ (WebInspector.RequestContentView):
+ (WebInspector.RequestContentView.prototype._ensureInnerViewShown):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkLogView.prototype._showPopover):
+ * inspector/front-end/NetworkRequest.js:
+ (WebInspector.NetworkRequest.prototype.resource):
+ * inspector/front-end/RawSourceCode.js:
+ (WebInspector.RawSourceCode.prototype._createContentProvider):
+ * inspector/front-end/RequestCookiesView.js: Renamed from Source/WebCore/inspector/front-end/ResourceCookiesView.js.
+ (WebInspector.RequestCookiesView):
+ * inspector/front-end/RequestHTMLView.js: Renamed from Source/WebCore/inspector/front-end/ResourceHTMLView.js.
+ (WebInspector.RequestHTMLView):
+ (WebInspector.RequestHTMLView.prototype._createIFrame):
+ * inspector/front-end/RequestHeadersView.js: Renamed from Source/WebCore/inspector/front-end/ResourceHeadersView.js.
+ (WebInspector.RequestHeadersView):
+ * inspector/front-end/RequestJSONView.js: Renamed from Source/WebCore/inspector/front-end/ResourceJSONView.js.
+ (WebInspector.RequestJSONView):
+ (WebInspector.RequestJSONView.parseJSON.WebInspector.RequestJSONView.parseJSONP):
+ * inspector/front-end/RequestPreviewView.js: Renamed from Source/WebCore/inspector/front-end/ResourcePreviewView.js.
+ (WebInspector.RequestPreviewView):
+ (WebInspector.RequestPreviewView.prototype.contentLoaded):
+ (WebInspector.RequestPreviewView.prototype._createPreviewView):
+ * inspector/front-end/RequestResponseView.js: Renamed from Source/WebCore/inspector/front-end/ResourceResponseView.js.
+ (WebInspector.RequestResponseView):
+ (WebInspector.RequestResponseView.prototype.get sourceView):
+ (WebInspector.RequestResponseView.prototype.contentLoaded):
+ * inspector/front-end/RequestTimingView.js: Renamed from Source/WebCore/inspector/front-end/ResourceTimingView.js.
+ (WebInspector.RequestTimingView):
+ (WebInspector.RequestTimingView.prototype._refresh):
+ * inspector/front-end/RequestView.js: Copied from Source/WebCore/inspector/front-end/NetworkRequest.js.
+ (WebInspector.RequestView):
+ (WebInspector.RequestView.prototype.hasContent):
+ (WebInspector.RequestView.hasTextContent):
+ (WebInspector.RequestView.nonSourceViewForRequest):
+ * inspector/front-end/ResourceView.js:
+ (WebInspector.ResourceSourceFrame._canonicalMIMEType):
+ (WebInspector.ResourceSourceFrame._mimeTypeForResource):
+ (WebInspector.ResourceSourceFrame.prototype.requestContent):
+ (WebInspector.ResourceSourceFrame.prototype._contentChanged):
+ (WebInspector.ResourceRevisionSourceFrame.prototype.requestContent):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+
2012-04-12 Yury Semikhatsky <yurys@chromium.org>
Unreviewed. Fix a couple of compiler annotations after r113963.
'inspector/front-end/PropertiesSidebarPane.js',
'inspector/front-end/RawSourceCode.js',
'inspector/front-end/RemoteObject.js',
+ 'inspector/front-end/RequestCookiesView.js',
+ 'inspector/front-end/RequestHeadersView.js',
+ 'inspector/front-end/RequestJSONView.js',
+ 'inspector/front-end/RequestHTMLView.js',
+ 'inspector/front-end/RequestPreviewView.js',
+ 'inspector/front-end/RequestResponseView.js',
+ 'inspector/front-end/RequestTimingView.js',
+ 'inspector/front-end/RequestView.js',
'inspector/front-end/Resource.js',
- 'inspector/front-end/ResourceCookiesView.js',
- 'inspector/front-end/ResourceHeadersView.js',
- 'inspector/front-end/ResourceJSONView.js',
- 'inspector/front-end/ResourceHTMLView.js',
- 'inspector/front-end/ResourceResponseView.js',
'inspector/front-end/ResourceScriptMapping.js',
- 'inspector/front-end/ResourceTimingView.js',
'inspector/front-end/ResourceTreeModel.js',
'inspector/front-end/ResourceType.js',
'inspector/front-end/ResourceUtils.js',
'inspector/front-end/ResourceView.js',
'inspector/front-end/ResourcesPanel.js',
- 'inspector/front-end/ResourcePreviewView.js',
'inspector/front-end/ScopeChainSidebarPane.js',
'inspector/front-end/Script.js',
'inspector/front-end/ScriptFormatter.js',
>
</File>
<File
- RelativePath="..\inspector\front-end\Resource.js"
+ RelativePath="..\inspector\front-end\RequestCookiesView.js"
>
</File>
<File
- RelativePath="..\inspector\front-end\ResourceCookiesView.js"
+ RelativePath="..\inspector\front-end\RequestHeadersView.js"
>
</File>
<File
- RelativePath="..\inspector\front-end\ResourceHeadersView.js"
+ RelativePath="..\inspector\front-end\RequestHTMLView.js"
>
</File>
<File
- RelativePath="..\inspector\front-end\ResourceHTMLView.js"
+ RelativePath="..\inspector\front-end\RequestJSONView.js"
>
</File>
<File
- RelativePath="..\inspector\front-end\ResourceJSONView.js"
+ RelativePath="..\inspector\front-end\RequestPreviewView.js"
>
</File>
<File
- RelativePath="..\inspector\front-end\ResourcePreviewView.js"
+ RelativePath="..\inspector\front-end\RequestResponseView.js"
>
</File>
<File
- RelativePath="..\inspector\front-end\ResourceResponseView.js"
+ RelativePath="..\inspector\front-end\RequestTimingView.js"
>
</File>
<File
- RelativePath="..\inspector\front-end\resourcesPanel.css"
+ RelativePath="..\inspector\front-end\RequestView.js"
>
</File>
<File
- RelativePath="..\inspector\front-end\ResourcesPanel.js"
+ RelativePath="..\inspector\front-end\Resource.js"
>
</File>
<File
- RelativePath="..\inspector\front-end\ResourceScriptMapping.js"
+ RelativePath="..\inspector\front-end\resourcesPanel.css"
>
</File>
<File
- RelativePath="..\inspector\front-end\ResourceTimingView.js"
+ RelativePath="..\inspector\front-end\ResourcesPanel.js"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\front-end\ResourceScriptMapping.js"
>
</File>
<File
"FontView.js",
"ImageView.js",
"NetworkItemView.js",
- "ResourceCookiesView.js",
- "ResourceHeadersView.js",
- "ResourceHTMLView.js",
- "ResourceJSONView.js",
- "ResourcePreviewView.js",
- "ResourceResponseView.js",
- "ResourceTimingView.js",
+ "RequestCookiesView.js",
+ "RequestHeadersView.js",
+ "RequestHTMLView.js",
+ "RequestJSONView.js",
+ "RequestPreviewView.js",
+ "RequestResponseView.js",
+ "RequestTimingView.js",
+ "RequestView.js",
"ResourceView.js",
"NetworkPanel.js",
]
/**
* @constructor
* @implements {WebInspector.ContentProvider}
- * @param {WebInspector.NetworkRequest} request
+ * @param {WebInspector.Resource} resource
*/
-WebInspector.ResourceContentProvider = function(request)
+WebInspector.ResourceContentProvider = function(resource)
{
- this._mimeType = request.type === WebInspector.resourceTypes.Script ? "text/javascript" : "text/html";
- this._request = request;
+ this._mimeType = resource.type === WebInspector.resourceTypes.Script ? "text/javascript" : "text/html";
+ this._resource = resource;
};
WebInspector.ResourceContentProvider.prototype = {
{
callback(this._mimeType, content);
}
- this._request.requestContent(didRequestContent.bind(this));
+ this._resource.requestContent(didRequestContent.bind(this));
},
/**
*/
searchInContent: function(query, caseSensitive, isRegex, callback)
{
- this._request.searchInContent(query, caseSensitive, isRegex, callback);
+ this._resource.searchInContent(query, caseSensitive, isRegex, callback);
}
}
*/
/**
- * @extends {WebInspector.TabbedPane}
* @constructor
+ * @extends {WebInspector.TabbedPane}
+ * @param {WebInspector.NetworkRequest} request
*/
-WebInspector.NetworkItemView = function(resource)
+WebInspector.NetworkItemView = function(request)
{
WebInspector.TabbedPane.call(this);
-
this.element.addStyleClass("network-item-view");
- var headersView = new WebInspector.ResourceHeadersView(resource.request);
+ var headersView = new WebInspector.RequestHeadersView(request);
this.appendTab("headers", WebInspector.UIString("Headers"), headersView);
- var responseView = new WebInspector.ResourceResponseView(resource);
- var previewView = new WebInspector.ResourcePreviewView(resource, responseView);
+ var responseView = new WebInspector.RequestResponseView(request);
+ var previewView = new WebInspector.RequestPreviewView(request, responseView);
this.appendTab("preview", WebInspector.UIString("Preview"), previewView);
this.appendTab("response", WebInspector.UIString("Response"), responseView);
- if (resource.requestCookies || resource.responseCookies) {
- this._cookiesView = new WebInspector.ResourceCookiesView(resource.request);
+ if (request.requestCookies || request.responseCookies) {
+ this._cookiesView = new WebInspector.RequestCookiesView(request);
this.appendTab("cookies", WebInspector.UIString("Cookies"), this._cookiesView);
}
- if (resource.timing) {
- var timingView = new WebInspector.ResourceTimingView(resource.request);
+ if (request.timing) {
+ var timingView = new WebInspector.RequestTimingView(request);
this.appendTab("timing", WebInspector.UIString("Timing"), timingView);
}
WebInspector.NetworkItemView.prototype.__proto__ = WebInspector.TabbedPane.prototype;
/**
- * @extends {WebInspector.ResourceView}
* @constructor
+ * @extends {WebInspector.RequestView}
+ * @param {WebInspector.NetworkRequest} request
*/
-WebInspector.ResourceContentView = function(resource)
+WebInspector.RequestContentView = function(request)
{
- WebInspector.ResourceView.call(this, resource);
+ WebInspector.RequestView.call(this, request);
}
-WebInspector.ResourceContentView.prototype = {
+WebInspector.RequestContentView.prototype = {
hasContent: function()
{
return true;
this.contentLoaded();
}
- this.resource.requestContent(callback.bind(this));
+ this.request.requestContent(callback.bind(this));
},
contentLoaded: function()
}
}
-WebInspector.ResourceContentView.prototype.__proto__ = WebInspector.ResourceView.prototype;
+WebInspector.RequestContentView.prototype.__proto__ = WebInspector.RequestView.prototype;
_showPopover: function(anchor, popover)
{
var request = anchor.parentElement.request;
- var tableElement = WebInspector.ResourceTimingView.createTimingTable(request);
+ var tableElement = WebInspector.RequestTimingView.createTimingTable(request);
popover.show(tableElement, anchor);
},
_createContentProvider: function()
{
- if (this._request && this._request.finished) {
- return new WebInspector.ResourceContentProvider(this._request);
- }
+ if (this._request && this._request.finished)
+ return new WebInspector.ResourceContentProvider(this._request.resource());
if (this._scripts.length === 1 && !this._scripts[0].lineOffset && !this._scripts[0].columnOffset)
return new WebInspector.ScriptContentProvider(this._scripts[0]);
return new WebInspector.ConcatenatedScriptsContentProvider(this._scripts);
* @extends {WebInspector.View}
* @param {WebInspector.NetworkRequest} request
*/
-WebInspector.ResourceCookiesView = function(request)
+WebInspector.RequestCookiesView = function(request)
{
WebInspector.View.call(this);
this.element.addStyleClass("resource-cookies-view");
request.addEventListener(WebInspector.NetworkRequest.Events.ResponseHeadersChanged, this._refreshCookies, this);
}
-WebInspector.ResourceCookiesView.prototype = {
+WebInspector.RequestCookiesView.prototype = {
wasShown: function()
{
if (!this._gotCookies) {
}
}
-WebInspector.ResourceCookiesView.prototype.__proto__ = WebInspector.View.prototype;
+WebInspector.RequestCookiesView.prototype.__proto__ = WebInspector.View.prototype;
/**
* @constructor
- * @extends {WebInspector.ResourceView}
+ * @extends {WebInspector.RequestView}
+ * @param {WebInspector.NetworkRequest} request
*/
-WebInspector.ResourceHTMLView = function(resource)
+WebInspector.RequestHTMLView = function(request)
{
- WebInspector.ResourceView.call(this, resource);
+ WebInspector.RequestView.call(this, request);
this.element.addStyleClass("html");
}
-WebInspector.ResourceHTMLView.prototype = {
+WebInspector.RequestHTMLView.prototype = {
hasContent: function()
{
return true;
this.element.appendChild(iframe);
iframe.setAttribute("sandbox", ""); // Forbid to run JavaScript and set unique origin.
- iframe.contentDocument.body.innerHTML = this.resource.content;
+ iframe.contentDocument.body.innerHTML = this.request.content;
}
}
-WebInspector.ResourceHTMLView.prototype.__proto__ = WebInspector.ResourceView.prototype;
+WebInspector.RequestHTMLView.prototype.__proto__ = WebInspector.RequestView.prototype;
* @extends {WebInspector.View}
* @param {WebInspector.NetworkRequest} request
*/
-WebInspector.ResourceHeadersView = function(request)
+WebInspector.RequestHeadersView = function(request)
{
WebInspector.View.call(this);
this.registerRequiredCSS("resourceView.css");
this._refreshHTTPInformation();
}
-WebInspector.ResourceHeadersView.prototype = {
+WebInspector.RequestHeadersView.prototype = {
/**
* @param {string} name
* @param {string} value
}
}
-WebInspector.ResourceHeadersView.prototype.__proto__ = WebInspector.View.prototype;
+WebInspector.RequestHeadersView.prototype.__proto__ = WebInspector.View.prototype;
*/
/**
- * @extends {WebInspector.ResourceView}
* @constructor
+ * @extends {WebInspector.RequestView}
+ * @param {WebInspector.NetworkRequest} request
*/
-WebInspector.ResourceJSONView = function(resource, parsedJSON)
+WebInspector.RequestJSONView = function(request, parsedJSON)
{
- WebInspector.ResourceView.call(this, resource);
+ WebInspector.RequestView.call(this, request);
this._parsedJSON = parsedJSON;
this.element.addStyleClass("json");
}
-WebInspector.ResourceJSONView.parseJSON = function(text)
+WebInspector.RequestJSONView.parseJSON = function(text)
{
var prefix = "";
}
}
-WebInspector.ResourceJSONView.parseJSONP = function(text)
+WebInspector.RequestJSONView.parseJSONP = function(text)
{
// Taking everything between first and last parentheses
var start = text.indexOf("(");
}
}
-WebInspector.ResourceJSONView.prototype = {
+WebInspector.RequestJSONView.prototype = {
hasContent: function()
{
return true;
}
}
-WebInspector.ResourceJSONView.prototype.__proto__ = WebInspector.ResourceView.prototype;
+WebInspector.RequestJSONView.prototype.__proto__ = WebInspector.RequestView.prototype;
/**
* @constructor
*/
/**
- * @extends {WebInspector.ResourceContentView}
* @constructor
+ * @extends {WebInspector.RequestContentView}
+ * @param {WebInspector.NetworkRequest} request
*/
-WebInspector.ResourcePreviewView = function(resource, responseView)
+WebInspector.RequestPreviewView = function(request, responseView)
{
- WebInspector.ResourceContentView.call(this, resource);
+ WebInspector.RequestContentView.call(this, request);
this._responseView = responseView;
}
-WebInspector.ResourcePreviewView.prototype = {
+WebInspector.RequestPreviewView.prototype = {
contentLoaded: function()
{
- if (!this.resource.content) {
+ if (!this.request.content) {
if (!this._emptyView) {
this._emptyView = this._createEmptyView();
this._emptyView.show(this.element);
_createPreviewView: function()
{
- if (this.resource.hasErrorStatusCode() && this.resource.content)
- return new WebInspector.ResourceHTMLView(this.resource);
+ if (this.request.hasErrorStatusCode() && this.request.content)
+ return new WebInspector.RequestHTMLView(this.request);
- if (this.resource.type === WebInspector.resourceTypes.XHR && this.resource.content) {
- var parsedJSON = WebInspector.ResourceJSONView.parseJSON(this.resource.content);
+ if (this.request.type === WebInspector.resourceTypes.XHR && this.request.content) {
+ var parsedJSON = WebInspector.RequestJSONView.parseJSON(this.request.content);
if (parsedJSON)
- return new WebInspector.ResourceJSONView(this.resource, parsedJSON);
+ return new WebInspector.RequestJSONView(this.request, parsedJSON);
}
- if (this.resource.content && this.resource.type === WebInspector.resourceTypes.Script && this.resource.mimeType === "application/json") {
- var parsedJSONP = WebInspector.ResourceJSONView.parseJSONP(this.resource.content);
+ if (this.request.content && this.request.type === WebInspector.resourceTypes.Script && this.request.mimeType === "application/json") {
+ var parsedJSONP = WebInspector.RequestJSONView.parseJSONP(this.request.content);
if (parsedJSONP)
- return new WebInspector.ResourceJSONView(this.resource, parsedJSONP);
+ return new WebInspector.RequestJSONView(this.request, parsedJSONP);
}
if (this._responseView.sourceView)
return this._responseView.sourceView;
- if (this.resource.type === WebInspector.resourceTypes.Other)
+ if (this.request.type === WebInspector.resourceTypes.Other)
return this._createEmptyView();
- return WebInspector.ResourceView.nonSourceViewForResource(this.resource);
+ return WebInspector.RequestView.nonSourceViewForRequest(this.request);
}
}
-WebInspector.ResourcePreviewView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
+WebInspector.RequestPreviewView.prototype.__proto__ = WebInspector.RequestContentView.prototype;
*/
/**
- * @extends {WebInspector.ResourceContentView}
* @constructor
+ * @extends {WebInspector.RequestContentView}
+ * @param {WebInspector.NetworkRequest} request
*/
-WebInspector.ResourceResponseView = function(resource)
+WebInspector.RequestResponseView = function(request)
{
- WebInspector.ResourceContentView.call(this, resource);
+ WebInspector.RequestContentView.call(this, request);
}
-WebInspector.ResourceResponseView.prototype = {
+WebInspector.RequestResponseView.prototype = {
get sourceView()
{
- if (!this._sourceView && WebInspector.ResourceView.hasTextContent(this.resource))
- this._sourceView = new WebInspector.ResourceSourceFrame(this.resource);
+ if (!this._sourceView && WebInspector.RequestView.hasTextContent(this.request))
+ this._sourceView = new WebInspector.ResourceSourceFrame(this.request);
return this._sourceView;
},
contentLoaded: function()
{
- if (!this.resource.content || !this.sourceView) {
+ if (!this.request.content || !this.sourceView) {
if (!this._emptyView) {
this._emptyView = new WebInspector.EmptyView(WebInspector.UIString("This request has no response data available."));
this._emptyView.show(this.element);
}
}
-WebInspector.ResourceResponseView.prototype.__proto__ = WebInspector.ResourceContentView.prototype;
+WebInspector.RequestResponseView.prototype.__proto__ = WebInspector.RequestContentView.prototype;
* @extends {WebInspector.View}
* @param {WebInspector.NetworkRequest} request
*/
-WebInspector.ResourceTimingView = function(request)
+WebInspector.RequestTimingView = function(request)
{
WebInspector.View.call(this);
this.element.addStyleClass("resource-timing-view");
request.addEventListener(WebInspector.NetworkRequest.Events.TimingChanged, this._refresh, this);
}
-WebInspector.ResourceTimingView.prototype = {
+WebInspector.RequestTimingView.prototype = {
wasShown: function()
{
if (!this._request.timing) {
if (this._tableElement)
this._tableElement.parentElement.removeChild(this._tableElement);
- this._tableElement = WebInspector.ResourceTimingView.createTimingTable(this._request);
+ this._tableElement = WebInspector.RequestTimingView.createTimingTable(this._request);
this.element.appendChild(this._tableElement);
}
}
-WebInspector.ResourceTimingView.createTimingTable = function(request)
+WebInspector.RequestTimingView.createTimingTable = function(request)
{
var tableElement = document.createElement("table");
var rows = [];
return tableElement;
}
-WebInspector.ResourceTimingView.prototype.__proto__ = WebInspector.View.prototype;
+WebInspector.RequestTimingView.prototype.__proto__ = WebInspector.View.prototype;
--- /dev/null
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.View}
+ * @param {WebInspector.NetworkRequest} request
+ */
+WebInspector.RequestView = function(request)
+{
+ WebInspector.View.call(this);
+ this.registerRequiredCSS("resourceView.css");
+
+ this.element.addStyleClass("resource-view");
+ this.request = request;
+}
+
+WebInspector.RequestView.prototype = {
+ hasContent: function()
+ {
+ return false;
+ }
+}
+
+WebInspector.RequestView.prototype.__proto__ = WebInspector.View.prototype;
+
+/**
+ * @param {WebInspector.NetworkRequest} request
+ */
+WebInspector.RequestView.hasTextContent = function(request)
+{
+ if (request.type.isTextType())
+ return true;
+ if (request.type === WebInspector.resourceTypes.Other)
+ return request.content && !request.contentEncoded;
+ return false;
+}
+
+/**
+ * @param {WebInspector.NetworkRequest} request
+ */
+WebInspector.RequestView.nonSourceViewForRequest = function(request)
+{
+ switch (request.type) {
+ case WebInspector.resourceTypes.Image:
+ return new WebInspector.ImageView(request);
+ case WebInspector.resourceTypes.Font:
+ return new WebInspector.FontView(request);
+ default:
+ return new WebInspector.RequestView(request);
+ }
+}
},
/**
+ * @return {WebInspector.Resource}
+ */
+ resource: function()
+ {
+ return this;
+ },
+
+ /**
* @type {string}
*/
get url()
WebInspector.ResourceView.prototype.__proto__ = WebInspector.View.prototype;
+/**
+ * @param {WebInspector.Resource} resource
+ */
WebInspector.ResourceView.hasTextContent = function(resource)
{
if (resource.type.isTextType())
return false;
}
+/**
+ * @param {WebInspector.Resource} resource
+ */
WebInspector.ResourceView.nonSourceViewForResource = function(resource)
{
switch (resource.type) {
this._resource.addEventListener(WebInspector.Resource.Events.RevisionAdded, this._contentChanged, this);
}
-//This is a map from resource.type to mime types
-//found in WebInspector.SourceTokenizer.Registry.
-WebInspector.ResourceSourceFrame.DefaultMIMETypeForResourceType = {
- 0: "text/html",
- 1: "text/css",
- 4: "text/javascript"
+WebInspector.ResourceSourceFrame._canonicalMIMEType = function(resource)
+{
+ var type = resource.type;
+ if (type === WebInspector.resourceTypes.Document)
+ return "text/html";
+ if (type === WebInspector.resourceTypes.Stylesheet)
+ return "text/css";
+ if (type === WebInspector.resourceTypes.Script)
+ return "text/javascript";
}
-WebInspector.ResourceSourceFrame.mimeTypeForResource = function(resource) {
- return WebInspector.ResourceSourceFrame.DefaultMIMETypeForResourceType[resource.type] || resource.mimeType;
+WebInspector.ResourceSourceFrame._mimeTypeForResource = function(resource)
+{
+ return WebInspector.ResourceSourceFrame._canonicalMIMEType(resource) || resource.mimeType;
}
WebInspector.ResourceSourceFrame.prototype = {
{
function contentLoaded(text)
{
- var mimeType = WebInspector.ResourceSourceFrame.mimeTypeForResource(this.resource);
+ var mimeType = WebInspector.ResourceSourceFrame._mimeTypeForResource(this._resource);
callback(mimeType, text);
}
_contentChanged: function(event)
{
- this.setContent(WebInspector.ResourceSourceFrame.mimeTypeForResource[this._resource], this._resource.content);
+ this.setContent(WebInspector.ResourceSourceFrame._mimeTypeForResource[this._resource], this._resource.content);
}
}
{
function contentLoaded(text)
{
- var mimeType = WebInspector.ResourceSourceFrame.mimeTypeForResource(this.resource);
+ var mimeType = WebInspector.ResourceSourceFrame._mimeTypeForResource(this.resource);
callback(mimeType, text);
}
<file>RawSourceCode.js</file>
<file>RemoteObject.js</file>
<file>Resource.js</file>
- <file>ResourceCookiesView.js</file>
- <file>ResourceJSONView.js</file>
- <file>ResourceHTMLView.js</file>
- <file>ResourceHeadersView.js</file>
- <file>ResourcePreviewView.js</file>
- <file>ResourceResponseView.js</file>
+ <file>RequestCookiesView.js</file>
+ <file>RequestJSONView.js</file>
+ <file>RequestHTMLView.js</file>
+ <file>RequestHeadersView.js</file>
+ <file>RequestPreviewView.js</file>
+ <file>RequestResponseView.js</file>
+ <file>RequestTimingView.js</file>
+ <file>RequestView.js</file>
<file>ResourceScriptMapping.js</file>
- <file>ResourceTimingView.js</file>
<file>ResourceTreeModel.js</file>
<file>ResourceType.js</file>
<file>ResourceUtils.js</file>
<script type="text/javascript" src="TextViewer.js"></script>
<script type="text/javascript" src="SourceFrame.js"></script>
<script type="text/javascript" src="ResourceView.js"></script>
+ <script type="text/javascript" src="RequestView.js"></script>
<script type="text/javascript" src="JavaScriptSourceFrame.js"></script>
<script type="text/javascript" src="SplitView.js"></script>
<script type="text/javascript" src="TabbedEditorContainer.js"></script>
<script type="text/javascript" src="AuditFormatters.js"></script>
<script type="text/javascript" src="NetworkItemView.js"></script>
<script type="text/javascript" src="EmptyView.js"></script>
- <script type="text/javascript" src="ResourceHeadersView.js"></script>
- <script type="text/javascript" src="ResourceCookiesView.js"></script>
- <script type="text/javascript" src="ResourceTimingView.js"></script>
- <script type="text/javascript" src="ResourceJSONView.js"></script>
- <script type="text/javascript" src="ResourceHTMLView.js"></script>
- <script type="text/javascript" src="ResourceResponseView.js"></script>
- <script type="text/javascript" src="ResourcePreviewView.js"></script>
+ <script type="text/javascript" src="RequestHeadersView.js"></script>
+ <script type="text/javascript" src="RequestCookiesView.js"></script>
+ <script type="text/javascript" src="RequestTimingView.js"></script>
+ <script type="text/javascript" src="RequestJSONView.js"></script>
+ <script type="text/javascript" src="RequestHTMLView.js"></script>
+ <script type="text/javascript" src="RequestResponseView.js"></script>
+ <script type="text/javascript" src="RequestPreviewView.js"></script>
<script type="text/javascript" src="ScriptFormatter.js"></script>
<script type="text/javascript" src="DOMSyntaxHighlighter.js"></script>
<script type="text/javascript" src="TextEditorModel.js"></script>
+2012-04-11 Vivek Galatage <vivekgalatage@gmail.com>
+
+ Web Inspector: Disabling Inspector causes build failure on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=83557
+
+ Reviewed by Pavel Feldman.
+
+ The calls to inspector APIs are not put under ENABLE(INSPECTOR) guard.
+ This change brings all such API calls under the guard.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (LayoutTestController):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::invoke):
+
2012-04-11 Dirk Pranke <dpranke@chromium.org>
Fix regression introduced in r113927.