[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

pfeldman at chromium.org pfeldman at chromium.org
Wed Dec 22 12:17:15 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1bf0e9622c8e55c25ebb140ff26cbf31c2f54a3a
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Aug 18 10:09:12 2010 +0000

    2010-08-18  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: make objectId of string type instead of object.
            https://bugs.webkit.org/show_bug.cgi?id=44160
    
            * WebCore.xcodeproj/project.pbxproj:
            * inspector/front-end/InjectedScript.js:
            (injectedScriptConstructor.):
            * inspector/front-end/InjectedScriptAccess.js:
            (get InjectedScriptAccess.getForObjectId):
            * inspector/front-end/RemoteObject.js:
            (WebInspector.RemoteObject.prototype.getProperties):
            (WebInspector.RemoteObject.prototype.setPropertyValue):
            (WebInspector.RemoteObject.prototype.pushNodeToFrontend):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65597 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5de2f93..5681e06 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-18  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: make objectId of string type instead of object.
+        https://bugs.webkit.org/show_bug.cgi?id=44160
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * inspector/front-end/InjectedScript.js:
+        (injectedScriptConstructor.):
+        * inspector/front-end/InjectedScriptAccess.js:
+        (get InjectedScriptAccess.getForObjectId):
+        * inspector/front-end/RemoteObject.js:
+        (WebInspector.RemoteObject.prototype.getProperties):
+        (WebInspector.RemoteObject.prototype.setPropertyValue):
+        (WebInspector.RemoteObject.prototype.pushNodeToFrontend):
+
 2010-08-17  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index b9a43f6..d4e3d80 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -61,7 +61,7 @@ InjectedScript.prototype = {
                     this._objectGroups[objectGroupName] = group;
                 }
                 group.push(id);
-                objectId = new InjectedScript.RemoteObjectId(id, objectGroupName);
+                objectId = this._serializeObjectId(id, objectGroupName);
             }
             return InjectedScript.RemoteObject.fromObject(object, objectId, abbreviate);
         } catch (e) {
@@ -69,6 +69,20 @@ InjectedScript.prototype = {
         }
     },
 
+    _serializeObjectId: function(id, groupName)
+    {
+        return injectedScriptId + ":" + id + ":" + groupName;
+    },
+
+    _parseObjectId: function(objectId)
+    {
+        var tokens = objectId.split(":");
+        var parsedObjectId = {};
+        parsedObjectId.id = parseInt(tokens[1]);
+        parsedObjectId.groupName = tokens[2];
+        return parsedObjectId;
+    },
+
     releaseWrapperObjectGroup: function(objectGroupName)
     {
         var group = this._objectGroups[objectGroupName];
@@ -108,7 +122,8 @@ InjectedScript.prototype = {
 
     getProperties: function(objectId, ignoreHasOwnProperty, abbreviate)
     {
-        var object = this._objectForId(objectId);
+        var parsedObjectId = this._parseObjectId(objectId);
+        var object = this._objectForId(parsedObjectId);
         if (!this._isDefined(object))
             return false;
         var properties = [];
@@ -126,7 +141,7 @@ InjectedScript.prototype = {
             var isGetter = object["__lookupGetter__"] && object.__lookupGetter__(propertyName);
             if (!isGetter) {
                 try {
-                    property.value = this._wrapObject(object[propertyName], objectId.groupName, abbreviate);
+                    property.value = this._wrapObject(object[propertyName], parsedObjectId.groupName, abbreviate);
                 } catch(e) {
                     property.value = new InjectedScript.RemoteObject.fromException(e);
                 }
@@ -142,7 +157,8 @@ InjectedScript.prototype = {
 
     setPropertyValue: function(objectId, propertyName, expression)
     {
-        var object = this._objectForId(objectId);
+        var parsedObjectId = this._parseObjectId(objectId);
+        var object = this._objectForId(parsedObjectId);
         if (!this._isDefined(object))
             return false;
     
@@ -305,9 +321,9 @@ InjectedScript.prototype = {
         return InjectedScriptHost.nodeForId(nodeId);
     },
 
-    _objectForId: function(objectId)
+    _objectForId: function(parsedObjectId)
     {
-        return this._idToWrappedObject[objectId.id];
+        return this._idToWrappedObject[parsedObjectId.id];
     },
 
     resolveNode: function(nodeId)
@@ -332,7 +348,8 @@ InjectedScript.prototype = {
 
     pushNodeToFrontend: function(objectId)
     {
-        var object = this._objectForId(objectId);
+        var parsedObjectId = this._parseObjectId(objectId);
+        var object = this._objectForId(parsedObjectId);
         if (!object || this._type(object) !== "node")
             return false;
         return InjectedScriptHost.pushNodePathToFrontend(object, false, false);
@@ -497,14 +514,6 @@ InjectedScript.prototype = {
 
 var injectedScript = new InjectedScript();
 
-// FIXME: RemoteObjectId and RemoteObject structs must match the WebInspector.* ones. Should reuse same file instead.
-InjectedScript.RemoteObjectId = function(id, groupName)
-{
-    this.worldId = injectedScriptId;
-    this.id = id;
-    this.groupName = groupName;
-}
-
 InjectedScript.RemoteObject = function(objectId, type, description, hasChildren)
 {
     this.objectId = objectId;
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js
index 71e5bd3..ce264dd 100644
--- a/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -47,6 +47,13 @@ InjectedScriptAccess.getForNode = function(node)
     return InjectedScriptAccess.get(-node.id);
 }
 
+InjectedScriptAccess.getForObjectId = function(objectId)
+{
+    // FIXME: move to native layer.
+    var tokens = objectId.split(":");
+    return InjectedScriptAccess.get(parseInt(tokens[0]));
+}
+
 InjectedScriptAccess.getDefault = function()
 {
     return InjectedScriptAccess.get(0);
diff --git a/WebCore/inspector/front-end/RemoteObject.js b/WebCore/inspector/front-end/RemoteObject.js
index ed029ef..003d483 100644
--- a/WebCore/inspector/front-end/RemoteObject.js
+++ b/WebCore/inspector/front-end/RemoteObject.js
@@ -28,13 +28,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.RemoteObjectId = function(worldId, id, groupName)
-{
-    this.worldId = worldId;
-    this.id = id;
-    this.groupName = groupName;
-}
-
 WebInspector.RemoteObject = function(objectId, type, description, hasChildren)
 {
     this._objectId = objectId;
@@ -120,7 +113,7 @@ WebInspector.RemoteObject.prototype = {
                 properties[i].value = WebInspector.RemoteObject.fromPayload(properties[i].value);
             callback(properties);
         }
-        InjectedScriptAccess.get(this._objectId.worldId).getProperties(this._objectId, ignoreHasOwnProperty, abbreviate, remoteObjectBinder);
+        InjectedScriptAccess.getForObjectId(this._objectId).getProperties(this._objectId, ignoreHasOwnProperty, abbreviate, remoteObjectBinder);
     },
 
     setPropertyValue: function(name, value, callback)
@@ -129,12 +122,12 @@ WebInspector.RemoteObject.prototype = {
             callback(false);
             return;
         }
-        InjectedScriptAccess.get(this._objectId.worldId).setPropertyValue(this._objectId, name, value, callback);
+        InjectedScriptAccess.getForObjectId(this._objectId).setPropertyValue(this._objectId, name, value, callback);
     },
 
     pushNodeToFrontend: function(callback)
     {
-        InjectedScriptAccess.get(this._objectId.worldId).pushNodeToFrontend(this._objectId, callback);
+        InjectedScriptAccess.getForObjectId(this._objectId).pushNodeToFrontend(this._objectId, callback);
     }
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list