Source/WebCore: Web Inspector: more compilation fixes including making ConsoleMessage...
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Oct 2011 14:56:25 +0000 (14:56 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Oct 2011 14:56:25 +0000 (14:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69253

Reviewed by Yury Semikhatsky.

* inspector/Inspector.json:
* inspector/compile-front-end.sh:
* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessage.create):
(WebInspector.ConsoleMessage.createTextMessage):
(WebInspector.ConsoleMessageImpl):
* inspector/front-end/ConsoleModel.js:
(WebInspector.ConsoleModel.prototype._messageRepeatCountUpdated):
(WebInspector.ConsoleMessage.create):
(WebInspector.ConsoleMessage.createTextMessage):
(WebInspector.ConsoleDispatcher.prototype.messageAdded):
* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleCommandResult):
(WebInspector.ConsoleCommandResult.prototype.toMessageElement):
* inspector/front-end/CookieParser.js:
(WebInspector.Cookie.prototype.get path):
(WebInspector.Cookie.prototype.get domain):
(WebInspector.Cookie.prototype.expires):
* inspector/front-end/DOMAgent.js:
* inspector/front-end/ExtensionServer.js:
(WebInspector.ExtensionServer.prototype._onAddConsoleMessage):
* inspector/front-end/NetworkManager.js:
(WebInspector.NetworkDispatcher.prototype._updateResourceWithResponse):
(WebInspector.NetworkDispatcher.prototype.requestWillBeSent):
(WebInspector.NetworkDispatcher.prototype.requestServedFromMemoryCache):
(WebInspector.NetworkDispatcher.prototype.webSocketCreated):
(WebInspector.NetworkDispatcher.prototype._createResource):
* inspector/front-end/Resource.js:
(WebInspector.Resource):
(WebInspector.Resource.prototype.setContent):
(WebInspector.Resource.prototype.searchInContent):
* inspector/front-end/ResourceTreeModel.js:
(WebInspector.ResourceTreeModel.prototype._createResource):
* inspector/front-end/externs.js:
(WebInspector.linkifyStringAsFragmentWithCustomLinkifier):
(WebInspector.extensionServer.notifyResourceContentCommitted):
(WebInspector.resourceForURL):
(WebInspector.debuggerPresentationModel.linkifyLocation):
(WebInspector.ObjectPropertiesSection):
(WebInspector.ElementsTreeOutline):
* inspector/front-end/inspector.html:
* inspector/front-end/inspector.js:
(WebInspector.log.logMessage):
(WebInspector.log):
* inspector/generate-protocol-externs:

Tools: Unreviewed. Add Zoltán Árvai as contributor.

Patch by Csaba Osztrogonác <ossy@webkit.org> on 2011-10-03

* Scripts/webkitpy/common/config/committers.py:

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

18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/inspector/Inspector.json
Source/WebCore/inspector/compile-front-end.sh
Source/WebCore/inspector/front-end/ConsoleMessage.js
Source/WebCore/inspector/front-end/ConsoleModel.js
Source/WebCore/inspector/front-end/ConsoleView.js
Source/WebCore/inspector/front-end/CookieParser.js
Source/WebCore/inspector/front-end/DOMAgent.js
Source/WebCore/inspector/front-end/ExtensionServer.js
Source/WebCore/inspector/front-end/NetworkManager.js
Source/WebCore/inspector/front-end/Resource.js
Source/WebCore/inspector/front-end/ResourceTreeModel.js
Source/WebCore/inspector/front-end/externs.js
Source/WebCore/inspector/front-end/inspector.html
Source/WebCore/inspector/front-end/inspector.js
Source/WebCore/inspector/front-end/utilities.js
Source/WebCore/inspector/generate-protocol-externs
Tools/ChangeLog

index 463dfc3..15cf43d 100644 (file)
@@ -1,3 +1,79 @@
+2011-10-03  Pavel Feldman  <pfeldman@google.com>
+
+        Web Inspector: more compilation fixes including making ConsoleMessage a part of console model.
+        https://bugs.webkit.org/show_bug.cgi?id=69253
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/Inspector.json:
+        * inspector/compile-front-end.sh:
+        * inspector/front-end/ConsoleMessage.js:
+        (WebInspector.ConsoleMessage.create):
+        (WebInspector.ConsoleMessage.createTextMessage):
+        (WebInspector.ConsoleMessageImpl):
+        * inspector/front-end/ConsoleModel.js:
+        (WebInspector.ConsoleModel.prototype._messageRepeatCountUpdated):
+        (WebInspector.ConsoleMessage.create):
+        (WebInspector.ConsoleMessage.createTextMessage):
+        (WebInspector.ConsoleDispatcher.prototype.messageAdded):
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleCommandResult):
+        (WebInspector.ConsoleCommandResult.prototype.toMessageElement):
+        * inspector/front-end/CookieParser.js:
+        (WebInspector.Cookie.prototype.get path):
+        (WebInspector.Cookie.prototype.get domain):
+        (WebInspector.Cookie.prototype.expires):
+        * inspector/front-end/DOMAgent.js:
+        * inspector/front-end/ExtensionServer.js:
+        (WebInspector.ExtensionServer.prototype._onAddConsoleMessage):
+        * inspector/front-end/NetworkManager.js:
+        (WebInspector.NetworkDispatcher.prototype._updateResourceWithResponse):
+        (WebInspector.NetworkDispatcher.prototype.requestWillBeSent):
+        (WebInspector.NetworkDispatcher.prototype.requestServedFromMemoryCache):
+        (WebInspector.NetworkDispatcher.prototype.webSocketCreated):
+        (WebInspector.NetworkDispatcher.prototype._createResource):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource):
+        (WebInspector.Resource.prototype.setContent):
+        (WebInspector.Resource.prototype.searchInContent):
+        * inspector/front-end/ResourceTreeModel.js:
+        (WebInspector.ResourceTreeModel.prototype._createResource):
+        * inspector/front-end/externs.js:
+        (WebInspector.linkifyStringAsFragmentWithCustomLinkifier):
+        (WebInspector.extensionServer.notifyResourceContentCommitted):
+        (WebInspector.resourceForURL):
+        (WebInspector.debuggerPresentationModel.linkifyLocation):
+        (WebInspector.ObjectPropertiesSection):
+        (WebInspector.ElementsTreeOutline):
+        * inspector/front-end/inspector.html:
+        * inspector/front-end/inspector.js:
+        (WebInspector.log.logMessage):
+        (WebInspector.log):
+        * inspector/generate-protocol-externs:
+
+2011-10-03  Pavel Feldman  <pfeldman@google.com>
+
+        Web Inspector: move console message formatting from ConsoleView.js into ConsoleMessage.js
+        https://bugs.webkit.org/show_bug.cgi?id=69244
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/ConsoleMessage.js:
+        (WebInspector.ConsoleMessage):
+        (WebInspector.ConsoleMessage.prototype._formatMessage.else.else.linkifier):
+        (WebInspector.ConsoleMessage.prototype._formatMessage):
+        (WebInspector.ConsoleMessage.prototype._format):
+        (WebInspector.ConsoleMessage.prototype._formatParameter):
+        (WebInspector.ConsoleMessage.prototype._formatParameterAsValue):
+        (WebInspector.ConsoleMessage.prototype._formatParameterAsObject):
+        (WebInspector.ConsoleMessage.prototype._formatParameterAsNode):
+        (WebInspector.ConsoleMessage.prototype._formatParameterAsArray):
+        (WebInspector.ConsoleMessage.prototype._formatParameterAsString):
+        (WebInspector.ConsoleMessage.prototype._printArray):
+        (WebInspector.ConsoleMessage.prototype._formatAsArrayEntry):
+        (WebInspector.ConsoleMessage.prototype._formatWithSubstitutionString):
+        * inspector/front-end/ConsoleView.js:
+
 2011-10-03  Dirk Schulze  <krit@webkit.org>
 
         feColorMatrix saturation is not limited to range 0..1 anymore
index 6af7702..d15ba53 100644 (file)
                 ]
             },
             {
+                "id": "WebSocketRequest",
+                "type": "object",
+                "description": "WebSocket request data.",
+                "hidden": true,
+                "properties": [
+                    { "name": "requestKey3", "type": "string", "description": "HTTP response status text." },
+                    { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }
+                ]
+            },
+            {
+                "id": "WebSocketResponse",
+                "type": "object",
+                "description": "WebSocket response data.",
+                "hidden": true,
+                "properties": [
+                    { "name": "status", "type": "number", "description": "HTTP response status code." },
+                    { "name": "statusText", "type": "string", "description": "HTTP response status text." },
+                    { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." },
+                    { "name": "challengeResponse", "type": "string", "description": "Challenge response." }
+                ]
+            },
+            {
                 "id": "CachedResource",
                 "type": "object",
                 "description": "Information about the cached resource.",
                 "parameters": [
                     { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
                     { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
-                    { "name": "request", "type": "object", "description": "WebSocket request data." }
+                    { "name": "request", "$ref": "WebSocketRequest", "description": "WebSocket request data." }
                 ],
                 "hidden": true
             },
                 "parameters": [
                     { "name": "requestId", "$ref": "RequestId", "description": "Request identifier." },
                     { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp." },
-                    { "name": "response", "type": "object", "description": "WebSocket response data." }
+                    { "name": "response", "$ref": "WebSocketResponse", "description": "WebSocket response data." }
                 ],
                 "hidden": true
             },
                     { "name": "publicId", "type": "string", "optional": true, "description": "<code>DocumentType</code>'s publicId." },
                     { "name": "systemId", "type": "string", "optional": true, "description": "<code>DocumentType</code>'s systemId." },
                     { "name": "internalSubset", "type": "string", "optional": true, "description": "<code>DocumentType</code>'s internalSubset." },
+                    { "name": "xmlVersion", "type": "string", "optional": true, "description": "<code>Document</code>'s XML version in case of XML documents." },
                     { "name": "name", "type": "string", "optional": true, "description": "<code>Attr</code>'s name." },
                     { "name": "value", "type": "string", "optional": true, "description": "<code>Attr</code>'s value." }
                 ],
index ea28d60..f89c34a 100755 (executable)
@@ -34,24 +34,30 @@ python Source/WebCore/inspector/generate-protocol-externs -o Source/WebCore/insp
 java -jar ~/closure/compiler.jar --compilation_level SIMPLE_OPTIMIZATIONS --warning_level VERBOSE --language_in ECMASCRIPT5 --accept_const_keyword \
     --externs Source/WebCore/inspector/front-end/externs.js \
     --externs Source/WebCore/inspector/front-end/protocol-externs.js \
-    --module jsmodule_core:2 \
+    --module jsmodule_util:2 \
         --js Source/WebCore/inspector/front-end/utilities.js \
         --js Source/WebCore/inspector/front-end/treeoutline.js \
-    --module jsmodule_env:3 \
-        --js Source/WebCore/inspector/front-end/Settings.js \
-        --js Source/WebCore/inspector/front-end/UserMetrics.js \
+    --module jsmodule_host:1 \
         --js Source/WebCore/inspector/front-end/InspectorFrontendHostStub.js \
-    --module jsmodule_sdk:7:jsmodule_core,jsmodule_env \
+    --module jsmodule_common:4:jsmodule_util,jsmodule_host \
         --js Source/WebCore/inspector/front-end/BinarySearch.js \
+        --js Source/WebCore/inspector/front-end/Object.js \
+        --js Source/WebCore/inspector/front-end/Settings.js \
+        --js Source/WebCore/inspector/front-end/UserMetrics.js \
+    --module jsmodule_sdk:9:jsmodule_common,jsmodule_host \
         --js Source/WebCore/inspector/front-end/DOMAgent.js \
         --js Source/WebCore/inspector/front-end/DebuggerModel.js \
-        --js Source/WebCore/inspector/front-end/Object.js \
         --js Source/WebCore/inspector/front-end/Script.js \
         --js Source/WebCore/inspector/front-end/RemoteObject.js \
         --js Source/WebCore/inspector/front-end/ResourceCategory.js \
-    --module jsmodule_misc:10:jsmodule_sdk \
+        --js Source/WebCore/inspector/front-end/CookieParser.js \
+        --js Source/WebCore/inspector/front-end/ConsoleModel.js \
+        --js Source/WebCore/inspector/front-end/Resource.js \
+        --js Source/WebCore/inspector/front-end/NetworkManager.js \
+    --module jsmodule_misc:11:jsmodule_sdk \
         --js Source/WebCore/inspector/front-end/Checkbox.js \
         --js Source/WebCore/inspector/front-end/ContextMenu.js \
+        --js Source/WebCore/inspector/front-end/ConsoleMessage.js \
         --js Source/WebCore/inspector/front-end/KeyboardShortcut.js \
         --js Source/WebCore/inspector/front-end/View.js \
         --js Source/WebCore/inspector/front-end/Placard.js \
index 8b5bdc1..3e7083f 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/**
- * @constructor
- */
-WebInspector.ConsoleStackFrame = function()
+WebInspector.ConsoleMessage.create = function(source, type, level, line, url, repeatCount, message, parameters, stackTrace, request)
+{
+    return new WebInspector.ConsoleMessageImpl(source, type, level, line, url, repeatCount, message, parameters, stackTrace, request);
+}
+
+WebInspector.ConsoleMessage.createTextMessage = function(text, level)
 {
-    this.url = undefined;
-    this.functionName = undefined;
-    this.lineNumber = undefined;
-    this.columnNumber = undefined;
+    level = level || WebInspector.ConsoleMessage.MessageLevel.Log;
+    return new WebInspector.ConsoleMessageImpl(WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, WebInspector.ConsoleMessage.MessageType.Log, level, 0, null, 1, null, [text], null);
 }
 
 /**
  * @constructor
+ * @extends {WebInspector.ConsoleMessage}
  * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
  * @param {ConsoleAgent.StackTrace=} stackTrace
  * @param {WebInspector.Resource=} request
  */
-WebInspector.ConsoleMessage = function(source, type, level, line, url, repeatCount, message, parameters, stackTrace, request)
+WebInspector.ConsoleMessageImpl = function(source, type, level, line, url, repeatCount, message, parameters, stackTrace, request)
 {
+    WebInspector.ConsoleMessage.call();
+
     this.source = source;
     this.type = type;
     this.level = level;
@@ -74,17 +77,9 @@ WebInspector.ConsoleMessage = function(source, type, level, line, url, repeatCou
         "node":   this._formatParameterAsNode,
         "string": this._formatParameterAsString
     };
-
-    this._formatMessage();
 }
 
-WebInspector.ConsoleMessage.createTextMessage = function(text, level)
-{
-    level = level || WebInspector.ConsoleMessage.MessageLevel.Log;
-    return new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.ConsoleAPI, WebInspector.ConsoleMessage.MessageType.Log, level, 0, null, 1, null, [text], null);
-}
-
-WebInspector.ConsoleMessage.prototype = {
+WebInspector.ConsoleMessageImpl.prototype = {
     _formatMessage: function()
     {
         this._formattedMessage = document.createElement("span");
@@ -187,6 +182,13 @@ WebInspector.ConsoleMessage.prototype = {
         this.message = (urlElement ? urlElement.textContent + " " : "") + messageText.textContent;
     },
 
+    get formattedMessage()
+    {
+        if (!this._formattedMessage)
+            this._formatMessage();
+        return this._formattedMessage;
+    },
+
     _linkifyLocation: function(url, lineNumber, columnNumber)
     {
         // FIXME(62725): stack trace line/column numbers are one-based.
@@ -395,6 +397,9 @@ WebInspector.ConsoleMessage.prototype = {
 
     clearHighlight: function()
     {
+        if (!this._formattedMessage)
+            return;
+
         var highlightedMessage = this._formattedMessage;
         delete this._formattedMessage;
         this._formatMessage();
@@ -403,6 +408,9 @@ WebInspector.ConsoleMessage.prototype = {
 
     highlightSearchResults: function(regexObject)
     {
+        if (!this._formattedMessage)
+            return;
+
         regexObject.lastIndex = 0;
         var text = this.message;
         var match = regexObject.exec(text);
@@ -453,10 +461,10 @@ WebInspector.ConsoleMessage.prototype = {
         if (this.type === WebInspector.ConsoleMessage.MessageType.StartGroup || this.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
             element.addStyleClass("console-group-title");
 
-        element.appendChild(this._formattedMessage);
+        element.appendChild(this.formattedMessage);
 
         if (this.repeatCount > 1)
-            this._updateRepeatCount();
+            this.updateRepeatCount();
 
         return element;
     },
@@ -483,7 +491,7 @@ WebInspector.ConsoleMessage.prototype = {
         }
     },
 
-    _updateRepeatCount: function() {
+    updateRepeatCount: function() {
         if (!this.repeatCountElement) {
             this.repeatCountElement = document.createElement("span");
             this.repeatCountElement.className = "bubble";
@@ -566,7 +574,7 @@ WebInspector.ConsoleMessage.prototype = {
                 break;
         }
 
-        return sourceString + " " + typeString + " " + levelString + ": " + this._formattedMessage.textContent + "\n" + this.url + " line " + this.line;
+        return sourceString + " " + typeString + " " + levelString + ": " + this.formattedMessage.textContent + "\n" + this.url + " line " + this.line;
     },
 
     get text()
@@ -608,32 +616,4 @@ WebInspector.ConsoleMessage.prototype = {
     }
 }
 
-// Note: Keep these constants in sync with the ones in Console.h
-WebInspector.ConsoleMessage.MessageSource = {
-    HTML: "html",
-    XML: "xml",
-    JS: "javascript",
-    Network: "network",
-    ConsoleAPI: "console-api",
-    Other: "other"
-}
-
-WebInspector.ConsoleMessage.MessageType = {
-    Log: "log",
-    Dir: "dir",
-    DirXML: "dirxml",
-    Trace: "trace",
-    StartGroup: "startGroup",
-    StartGroupCollapsed: "startGroupCollapsed",
-    EndGroup: "endGroup",
-    Assert: "assert",
-    Result: "result"
-}
-
-WebInspector.ConsoleMessage.MessageLevel = {
-    Tip: "tip",
-    Log: "log",
-    Warning: "warning",
-    Error: "error",
-    Debug: "debug"
-}
+WebInspector.ConsoleMessageImpl.prototype.__proto__ = WebInspector.ConsoleMessage.prototype;
index 7aba778..ab83fde 100644 (file)
@@ -30,6 +30,7 @@
 
 /**
  * @constructor
+ * @extends {WebInspector.Object}
  */
 WebInspector.ConsoleModel = function()
 {
@@ -52,9 +53,7 @@ WebInspector.ConsoleModel.prototype = {
         if (WebInspector.settings.monitoringXHREnabled.get())
             ConsoleAgent.setMonitoringXHREnabled(true);
 
-        // There is no console agent for workers yet.
-        if (!WebInspector.WorkerManager.isWorkerFrontend())
-            ConsoleAgent.enable(this._setConsoleMessageExpiredCount.bind(this));
+        ConsoleAgent.enable(this._setConsoleMessageExpiredCount.bind(this));
     },
 
     _setConsoleMessageExpiredCount: function(count)
@@ -119,14 +118,13 @@ WebInspector.ConsoleModel.prototype = {
             msg.repeatDelta = count - prevRepeatCount;
             msg.repeatCount = msg.repeatCount + msg.repeatDelta;
             msg.totalRepeatCount = count;
-            msg._updateRepeatCount();
+            msg.updateRepeatCount();
 
             this._incrementErrorWarningCount(msg);
             this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.RepeatCountUpdated, msg);
         } else {
-            var msgCopy = new WebInspector.ConsoleMessage(msg.source, msg.type, msg.level, msg.line, msg.url, count - prevRepeatCount, msg._messageText, msg._parameters, msg._stackTrace, msg._request);
+            var msgCopy = WebInspector.ConsoleMessage.create(msg.source, msg.type, msg.level, msg.line, msg.url, count - prevRepeatCount, msg._messageText, msg._parameters, msg._stackTrace, msg._request);
             msgCopy.totalRepeatCount = count;
-            msgCopy._formatMessage();
             this.addMessage(msgCopy);
         }
     }
@@ -136,6 +134,91 @@ WebInspector.ConsoleModel.prototype.__proto__ = WebInspector.Object.prototype;
 
 /**
  * @constructor
+ */
+WebInspector.ConsoleMessage = function()
+{
+    this.repeatDelta = 0;
+    this.repeatCount = 0;
+    this._totalRepeatCount = 0;
+}
+
+WebInspector.ConsoleMessage.prototype = {
+    get totalRepeatCount()
+    {
+        return this._totalRepeatCount;
+    },
+
+    set totalRepeatCount(totalRepeatCount)
+    {
+        this._totalRepeatCount = totalRepeatCount;
+    },
+
+    updateRepeatCount: function()
+    {
+        // Implemented by concrete instances
+    }
+}
+
+/**
+ * @param {string} source
+ * @param {string} type
+ * @param {string} level
+ * @param {number} line
+ * @param {string} url
+ * @param {number} repeatCount
+ * @param {string} message
+ * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
+ * @param {ConsoleAgent.StackTrace=} stackTrace
+ * @param {WebInspector.Resource=} request
+ *
+ * @return {WebInspector.ConsoleMessage}
+ */
+WebInspector.ConsoleMessage.create = function(source, type, level, line, url, repeatCount, message, parameters, stackTrace, request)
+{
+}
+
+/**
+ * @param {string} text
+ * @param {string} level
+ * @return {WebInspector.ConsoleMessage}
+ */
+WebInspector.ConsoleMessage.createTextMessage = function(text, level)
+{
+}
+
+// Note: Keep these constants in sync with the ones in Console.h
+WebInspector.ConsoleMessage.MessageSource = {
+    HTML: "html",
+    XML: "xml",
+    JS: "javascript",
+    Network: "network",
+    ConsoleAPI: "console-api",
+    Other: "other"
+}
+
+WebInspector.ConsoleMessage.MessageType = {
+    Log: "log",
+    Dir: "dir",
+    DirXML: "dirxml",
+    Trace: "trace",
+    StartGroup: "startGroup",
+    StartGroupCollapsed: "startGroupCollapsed",
+    EndGroup: "endGroup",
+    Assert: "assert",
+    Result: "result"
+}
+
+WebInspector.ConsoleMessage.MessageLevel = {
+    Tip: "tip",
+    Log: "log",
+    Warning: "warning",
+    Error: "error",
+    Debug: "debug"
+}
+
+
+/**
+ * @constructor
  * @implements {ConsoleAgent.Dispatcher}
  * @param {WebInspector.ConsoleModel} console
  */
@@ -147,7 +230,7 @@ WebInspector.ConsoleDispatcher = function(console)
 WebInspector.ConsoleDispatcher.prototype = {
     messageAdded: function(payload)
     {
-        var consoleMessage = new WebInspector.ConsoleMessage(
+        var consoleMessage = WebInspector.ConsoleMessage.create(
             payload.source,
             payload.type,
             payload.level,
index 9ccce16..54b1ba0 100644 (file)
@@ -701,19 +701,19 @@ WebInspector.ConsoleCommandResult = function(result, wasThrown, originatingComma
 {
     var level = (wasThrown ? WebInspector.ConsoleMessage.MessageLevel.Error : WebInspector.ConsoleMessage.MessageLevel.Log);
     this.originatingCommand = originatingCommand;
-    WebInspector.ConsoleMessage.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, -1, null, 1, null, [result]);
+    WebInspector.ConsoleMessageImpl.call(this, WebInspector.ConsoleMessage.MessageSource.JS, WebInspector.ConsoleMessage.MessageType.Result, level, -1, null, 1, null, [result]);
 }
 
 WebInspector.ConsoleCommandResult.prototype = {
     toMessageElement: function()
     {
-        var element = WebInspector.ConsoleMessage.prototype.toMessageElement.call(this);
+        var element = WebInspector.ConsoleMessageImpl.prototype.toMessageElement.call(this);
         element.addStyleClass("console-user-command-result");
         return element;
     }
 }
 
-WebInspector.ConsoleCommandResult.prototype.__proto__ = WebInspector.ConsoleMessage.prototype;
+WebInspector.ConsoleCommandResult.prototype.__proto__ = WebInspector.ConsoleMessageImpl.prototype;
 
 WebInspector.ConsoleGroup = function(parentGroup)
 {
index f841ff3..f200748 100644 (file)
@@ -185,17 +185,17 @@ WebInspector.Cookie.prototype = {
 
     get path()
     {
-        return this._attributes.path;
+        return this._attributes["path"];
     },
 
     get domain()
     {
-        return this._attributes.domain;
+        return this._attributes["domain"];
     },
 
     expires: function(requestDate)
     {
-        return this._attributes.expires ? new Date(this._attributes.expires) :
+        return this._attributes["expires"] ? new Date(this._attributes["expires"]) :
             (this._attributes["max-age"] ? new Date(requestDate.getTime() + 1000 * this._attributes["max-age"]) : null);
     },
 
index 6bfb2f8..6b6fc89 100644 (file)
@@ -31,7 +31,7 @@
 
 /**
  * @constructor
- * @param {DOMAgent.Node} payload.
+ * @param {DOMAgent.Node} payload
  */
 WebInspector.DOMNode = function(doc, payload) {
     this.ownerDocument = doc;
@@ -268,7 +268,7 @@ WebInspector.DOMNode.prototype = {
     },
 
     /**
-     * @param {DOMAgent.Node} payload.
+     * @param {DOMAgent.Node} payload
      */
     _insertChild: function(prev, payload)
     {
@@ -370,7 +370,7 @@ WebInspector.DOMNode.prototype = {
 /**
  * @extends {WebInspector.DOMNode}
  * @constructor
- * @param {DOMAgent.Node} payload.
+ * @param {DOMAgent.Node} payload
  */
 WebInspector.DOMDocument = function(domAgent, payload)
 {
@@ -546,7 +546,7 @@ WebInspector.DOMAgent.prototype = {
     },
 
     /**
-     * @param {DOMAgent.Node} payload.
+     * @param {DOMAgent.Node} payload
      */
     _setDocument: function(payload)
     {
@@ -562,7 +562,7 @@ WebInspector.DOMAgent.prototype = {
     },
 
     /**
-     * @param {DOMAgent.Node} payload.
+     * @param {DOMAgent.Node} payload
      */
     _setDetachedRoot: function(payload)
     {
index fd2d850..e9c27a8 100644 (file)
@@ -330,7 +330,7 @@ WebInspector.ExtensionServer.prototype = {
         if (!level)
             return this._status.E_BADARG("message.severity", message.severity);
 
-        var consoleMessage = new WebInspector.ConsoleMessage(
+        var consoleMessage = WebInspector.ConsoleMessage.create(
             WebInspector.ConsoleMessage.MessageSource.JS,
             WebInspector.ConsoleMessage.MessageType.Log,
             level,
index 3446a6d..1ebaf72 100644 (file)
@@ -127,7 +127,7 @@ WebInspector.NetworkDispatcher.prototype = {
             resource.timing = response.timing;
 
         if (!this._mimeTypeIsConsistentWithType(resource)) {
-            WebInspector.console.addMessage(new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.Other,
+            WebInspector.console.addMessage(WebInspector.ConsoleMessage.create(WebInspector.ConsoleMessage.MessageSource.Other,
                 WebInspector.ConsoleMessage.MessageType.Log,
                 WebInspector.ConsoleMessage.MessageLevel.Warning,
                 -1,
@@ -180,7 +180,7 @@ WebInspector.NetworkDispatcher.prototype = {
         var resource = this._inflightResourcesById[requestId];
         if (resource) {
             // FIXME: move this check to the backend.
-            if (this._isNull(redirectResponse))
+            if (!redirectResponse)
                 return;
             this.responseReceived(requestId, time, "Other", redirectResponse);
             resource = this._appendRedirect(requestId, time, request.url);
@@ -258,7 +258,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     requestServedFromMemoryCache: function(requestId, frameId, loaderId, documentURL, time, initiator, cachedResource)
     {
-        var resource = this._createResource(requestId, frameId, loaderId, cachedResource.url, documentURL, initiator);
+        var resource = this._createResource(requestId, frameId, loaderId, cachedResource.url, documentURL, initiator, null);
         this._updateResourceWithCachedResource(resource, cachedResource);
         resource.cached = true;
         resource.requestMethod = "GET";
@@ -269,7 +269,7 @@ WebInspector.NetworkDispatcher.prototype = {
 
     webSocketCreated: function(requestId, requestURL)
     {
-        var resource = this._createResource(requestId, null, null, requestURL);
+        var resource = new WebInspector.Resource(requestId, requestURL, null, null);
         resource.type = WebInspector.Resource.Type.WebSocket;
         this._startResource(resource);
     },
@@ -352,11 +352,19 @@ WebInspector.NetworkDispatcher.prototype = {
         this._manager.dispatchEventToListeners(eventType, resource);
     },
 
+    /**
+     * @param {NetworkAgent.RequestId} requestId
+     * @param {string} frameId
+     * @param {NetworkAgent.LoaderId} loaderId
+     * @param {string} url
+     * @param {string} documentURL
+     * @param {NetworkAgent.Initiator} initiator
+     * @param {ConsoleAgent.StackTrace=} stackTrace
+     */
     _createResource: function(requestId, frameId, loaderId, url, documentURL, initiator, stackTrace)
     {
-        var resource = new WebInspector.Resource(requestId, url, loaderId);
+        var resource = new WebInspector.Resource(requestId, url, frameId, loaderId);
         resource.documentURL = documentURL;
-        resource.frameId = frameId;
         resource.initiator = initiator;
         resource.stackTrace = stackTrace;
         return resource;
index a22b03c..516d80a 100644 (file)
@@ -68,11 +68,17 @@ WebInspector.MIMETypes = {
 /**
  * @constructor
  * @extends {WebInspector.Object}
+ *
+ * @param {NetworkAgent.RequestId} requestId
+ * @param {string} url
+ * @param {?string} frameId
+ * @param {?NetworkAgent.LoaderId} loaderId
  */
-WebInspector.Resource = function(requestId, url, loaderId)
+WebInspector.Resource = function(requestId, url, frameId, loaderId)
 {
     this.requestId = requestId;
     this.url = url;
+    this.frameId = frameId;
     this.loaderId = loaderId;
     this._startTime = -1;
     this._endTime = -1;
@@ -81,6 +87,7 @@ WebInspector.Resource = function(requestId, url, loaderId)
     this.history = [];
     /** @type {number} */
     this.statusCode = 0;
+    this.statusText = "";
     this.requestMethod = "";
     this.requestTime = 0;
     this.receiveHeadersEnd = 0;
@@ -820,7 +827,7 @@ WebInspector.Resource.prototype = {
 
     setContent: function(newContent, majorChange, callback)
     {
-        if (!this.isEditable(this)) {
+        if (!this.isEditable()) {
             if (callback)
                 callback("Resource is not editable");
             return;
@@ -874,7 +881,10 @@ WebInspector.Resource.prototype = {
             callback(searchMatches || []);
         }
 
-        PageAgent.searchInResource(this.frameId, this.url, query, callbackWrapper);
+        if (this.frameId)
+            PageAgent.searchInResource(this.frameId, this.url, query, callbackWrapper);
+        else
+            callback([]);
     },
 
     populateImageSource: function(image)
index 4a3ec57..1f9a944 100644 (file)
@@ -387,10 +387,13 @@ WebInspector.ResourceTreeModel.prototype = {
         }
     },
 
+    /**
+     * @param {PageAgent.Frame} frame
+     * @param {string} url
+     */
     _createResource: function(frame, url)
     {
-        var resource = new WebInspector.Resource(null, url, frame.loaderId);
-        resource.frameId = frame.id;
+        var resource = new WebInspector.Resource(null, url, frame.id, frame.loaderId);
         resource.documentURL = frame.url;
         resource.mimeType = frame.mimeType;
         return resource;
index 347f1e8..3203e3d 100644 (file)
@@ -46,6 +46,8 @@ WebInspector.linkifyURLAsNode = function(url, linkText, classes, isExternal, too
 
 /** @param {string} url */
 WebInspector.linkifyStringAsFragment = function(url) {}
+/** @param {string} url */
+WebInspector.linkifyStringAsFragmentWithCustomLinkifier = function(url, linkifier) {}
 
 /**
  * @param {string} url
@@ -71,3 +73,41 @@ JSON.stringify = function(str) {}
 Element.prototype.scrollIntoViewIfNeeded = function() {}
 
 Array.prototype.remove = function(obj) {}
+
+WebInspector.extensionServer = {}
+WebInspector.extensionServer.notifyResourceContentCommitted = function(resource, content) {}
+
+/**
+ * @param {string} url
+ * @return {?WebInspector.Resource}
+ */
+WebInspector.resourceForURL = function(url) {}
+
+WebInspector.debuggerPresentationModel = {
+    linkifyLocation: function(url, lineNumber, columnNumber, className) {}
+}
+
+/**
+ * @constructor
+ */
+WebInspector.ObjectPropertiesSection = function(obj, title)
+{
+    this.element = null;
+}
+
+/**
+ * @constructor
+ * @extends {TreeOutline}
+ */
+WebInspector.ElementsTreeOutline = function()
+{
+    this.element = null;
+}
+
+/**
+ * @param {NetworkAgent.RequestId} requestId
+ * @return {?WebInspector.Resource}
+ */
+WebInspector.networkResourceById = function(requestId)
+{
+}
index c7587eb..85b17aa 100644 (file)
@@ -60,8 +60,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     <script type="text/javascript" src="TabbedPane.js"></script>
     <script type="text/javascript" src="IFrameView.js"></script>
     <script type="text/javascript" src="Drawer.js"></script>
-    <script type="text/javascript" src="ConsoleMessage.js"></script>
     <script type="text/javascript" src="ConsoleModel.js"></script>
+    <script type="text/javascript" src="ConsoleMessage.js"></script>
     <script type="text/javascript" src="ConsoleView.js"></script>
     <script type="text/javascript" src="Panel.js"></script>
     <script type="text/javascript" src="TimelineGrid.js"></script>    
index fc2b59a..9b8fbe5 100644 (file)
@@ -556,7 +556,9 @@ WebInspector.doLoadedDone = function()
 
     this.extensionServer.initExtensions();
 
-    this.console.enableAgent();
+    // There is no console agent for workers yet.
+    if (!WebInspector.WorkerManager.isWorkerFrontend())
+        this.console.enableAgent();
     DatabaseAgent.enable();
     DOMStorageAgent.enable();
 
@@ -1142,7 +1144,7 @@ WebInspector.log = function(message, messageLevel)
         message = WebInspector.RemoteObject.fromPrimitiveValue(message);
 
         // post the message
-        var msg = new WebInspector.ConsoleMessage(
+        var msg = WebInspector.ConsoleMessage.create(
             WebInspector.ConsoleMessage.MessageSource.Other,
             WebInspector.ConsoleMessage.MessageType.Log,
             messageLevel || WebInspector.ConsoleMessage.MessageLevel.Debug,
index c14f438..c9bbdc2 100644 (file)
@@ -664,7 +664,11 @@ Array.convert = function(list)
     return Array.prototype.slice.call(list);
 }
 
-String.sprintf = function(format)
+/**
+ * @param {string} format
+ * @param {...*} var_arg
+ */
+String.sprintf = function(format, var_arg)
 {
     return String.vsprintf(format, Array.prototype.slice.call(arguments, 1));
 }
index 8466298..a239fca 100755 (executable)
@@ -101,6 +101,11 @@ for domain in json_api:
                             suffix = "|undefined"
                         output_file.write("/** @type {%s%s} */ this.%s;\n" % (param_type(domain_name, property), suffix, property["name"]))
                 output_file.write("}\n")
+            elif type["type"] == "array":
+                suffix = ""
+                if ("optional" in property):
+                    suffix = "|undefined"
+                output_file.write("\n/** @typedef {Array.<%s>%s} */\n%sAgent.%s;\n" % (param_type(domain_name, type["items"]), suffix, domain_name, type["id"]))
             else:
                 output_file.write("\n/** @typedef {%s} */\n%sAgent.%s;\n" % (type_traits[type["type"]], domain_name, type["id"]))
                 
index 583cd12..411d56b 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-03  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Unreviewed. Add Zoltán Árvai as contributor.
+
+        * Scripts/webkitpy/common/config/committers.py:
+
 2011-10-03  Raphael Kubo da Costa  <kubo@profusion.mobi>
 
         [EFL] DRT: Add DumpHistoryItem.{cpp,h}