2011-01-18 Andrey Kosyakov <caseq@chromium.org>
authorcaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jan 2011 17:40:28 +0000 (17:40 +0000)
committercaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jan 2011 17:40:28 +0000 (17:40 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: fail resource.requestContent() immediately for WebSocket resources
        Remove webInspector.resources.Types from test expectations.
        https://bugs.webkit.org/show_bug.cgi?id=52628

        * inspector/extensions-api-expected.txt:
2011-01-18  Andrey Kosyakov  <caseq@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: fail resource.requestContent() immediately for WebSocket resources
        https://bugs.webkit.org/show_bug.cgi?id=52628

        * English.lproj/localizedStrings.js: Rename WebSocket -> WebSockets in resource catetegories (rest are in plural, too)
        * inspector/front-end/ExtensionServer.js: Do not expose webInspector.resources.Types in extensions API (obsolete)
        (WebInspector.ExtensionServer.prototype._buildExtensionAPIInjectedScript):
        * inspector/front-end/Resource.js:
        (WebInspector.Resource.Type.toUIString): Remove ResourceType.Media as it's not used.
        (WebInspector.Resource.Type.toString): ditto.
        (WebInspector.Resource.prototype.requestContent): Fail immediately for WebSocket resources.
        * inspector/front-end/inspector.js: Rename WebSocket -> WebSockets in resource catetegories (rest are in plural, too)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76030 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector/extensions-api-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/localizedStrings.js
Source/WebCore/inspector/front-end/ExtensionServer.js
Source/WebCore/inspector/front-end/Resource.js
Source/WebCore/inspector/front-end/inspector.js

index 9c72dc5..9927554 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-18  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: fail resource.requestContent() immediately for WebSocket resources
+        Remove webInspector.resources.Types from test expectations.
+        https://bugs.webkit.org/show_bug.cgi?id=52628
+
+        * inspector/extensions-api-expected.txt:
+
 2011-01-18  Helder Correia  <helder@sencha.com>
 
         Reviewed by Dirk Schulze.
index 038db59..1662dad 100644 (file)
@@ -39,17 +39,6 @@ RUNNING TEST: extension_testAPI
             addListener : <function>
             removeListener : <function>
         }
-        Types : {
-            Document : "document"
-            Stylesheet : "stylesheet"
-            Image : "image"
-            Font : "font"
-            Script : "script"
-            XHR : "xhr"
-            Media : "media"
-            WebSocket : "websocket"
-            Other : "other"
-        }
         getHAR : <function>
         addRequestHeaders : <function>
     }
index 1c5763a..c16b9dc 100644 (file)
@@ -1,3 +1,19 @@
+2011-01-18  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: fail resource.requestContent() immediately for WebSocket resources
+        https://bugs.webkit.org/show_bug.cgi?id=52628
+
+        * English.lproj/localizedStrings.js: Rename WebSocket -> WebSockets in resource catetegories (rest are in plural, too)
+        * inspector/front-end/ExtensionServer.js: Do not expose webInspector.resources.Types in extensions API (obsolete)
+        (WebInspector.ExtensionServer.prototype._buildExtensionAPIInjectedScript):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.Type.toUIString): Remove ResourceType.Media as it's not used.
+        (WebInspector.Resource.Type.toString): ditto.
+        (WebInspector.Resource.prototype.requestContent): Fail immediately for WebSocket resources.
+        * inspector/front-end/inspector.js: Rename WebSocket -> WebSockets in resource catetegories (rest are in plural, too)
+
 2011-01-18  Helder Correia  <helder@sencha.com>
 
         Reviewed by Dirk Schulze.
index 2f7c121..7bd3da8 100644 (file)
Binary files a/Source/WebCore/English.lproj/localizedStrings.js and b/Source/WebCore/English.lproj/localizedStrings.js differ
index 961c7a2..b97dcda 100644 (file)
@@ -396,7 +396,6 @@ WebInspector.ExtensionServer.prototype = {
             "var apiPrivate = {};" +
             "(" + WebInspector.commonExtensionSymbols.toString() + ")(apiPrivate);" +
             "(" + WebInspector.injectedExtensionAPI.toString() + ").apply(this, arguments);" +
-            "webInspector.resources.Types = " + JSON.stringify(resourceTypes) + ";" +
             platformAPI +
             "})";
     },
index 7340645..00c1fb9 100644 (file)
@@ -44,7 +44,6 @@ WebInspector.Resource.Type = {
     Font:       3,
     Script:     4,
     XHR:        5,
-    Media:      6,
     WebSocket:  7,
     Other:      8,
 
@@ -68,8 +67,6 @@ WebInspector.Resource.Type = {
                 return WebInspector.UIString("Script");
             case this.XHR:
                 return WebInspector.UIString("XHR");
-            case this.Media:
-                return WebInspector.UIString("Media");
             case this.WebSocket:
                 return WebInspector.UIString("WebSocket");
             case this.Other:
@@ -95,8 +92,6 @@ WebInspector.Resource.Type = {
                 return "script";
             case this.XHR:
                 return "xhr";
-            case this.Media:
-                return "media";
             case this.WebSocket:
                 return "websocket";
             case this.Other:
@@ -669,6 +664,13 @@ WebInspector.Resource.prototype = {
 
     requestContent: function(callback)
     {
+        // We do not support content retrieval for WebSockets at the moment.
+        // Since WebSockets are potentially long-living, fail requests immediately
+        // to prevent caller blocking until resource is marked as finished.
+        if (this.type === WebInspector.Resource.Type.WebSocket) {
+            callback(null, null);
+            return;
+        }
         if (this._content) {
             callback(this._content, this._contentEncoded);
             return;
index 796c373..293c6d9 100644 (file)
@@ -534,7 +534,7 @@ WebInspector.doLoadedDone = function()
         scripts: new WebInspector.ResourceCategory("scripts", WebInspector.UIString("Scripts"), "rgb(255,121,0)"),
         xhr: new WebInspector.ResourceCategory("xhr", WebInspector.UIString("XHR"), "rgb(231,231,10)"),
         fonts: new WebInspector.ResourceCategory("fonts", WebInspector.UIString("Fonts"), "rgb(255,82,62)"),
-        websockets: new WebInspector.ResourceCategory("websockets", WebInspector.UIString("WebSocket"), "rgb(186,186,186)"), // FIXME: Decide the color.
+        websockets: new WebInspector.ResourceCategory("websockets", WebInspector.UIString("WebSockets"), "rgb(186,186,186)"), // FIXME: Decide the color.
         other: new WebInspector.ResourceCategory("other", WebInspector.UIString("Other"), "rgb(186,186,186)")
     };