Title: [158804] trunk/Source/WebKit2
Revision
158804
Author
[email protected]
Date
2013-11-06 16:48:56 -0800 (Wed, 06 Nov 2013)

Log Message

Allow property list classes to exist in containers
https://bugs.webkit.org/show_bug.cgi?id=123938

Reviewed by Andreas Kling.

* Shared/API/Cocoa/WKRemoteObjectInterface.mm:
(isContainerClass):
Return whether a given class is a container class.

(propertyListClasses):
Return the set of property list classes.

(allowedArgumentClassesForMethod):
Allow all property list classes for container type arguments.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (158803 => 158804)


--- trunk/Source/WebKit2/ChangeLog	2013-11-07 00:39:11 UTC (rev 158803)
+++ trunk/Source/WebKit2/ChangeLog	2013-11-07 00:48:56 UTC (rev 158804)
@@ -1,3 +1,20 @@
+2013-11-06  Anders Carlsson  <[email protected]>
+
+        Allow property list classes to exist in containers
+        https://bugs.webkit.org/show_bug.cgi?id=123938
+
+        Reviewed by Andreas Kling.
+
+        * Shared/API/Cocoa/WKRemoteObjectInterface.mm:
+        (isContainerClass):
+        Return whether a given class is a container class.
+
+        (propertyListClasses):
+        Return the set of property list classes.
+
+        (allowedArgumentClassesForMethod):
+        Allow all property list classes for container type arguments.
+
 2013-11-06  Daniel Bates  <[email protected]>
 
         [iOS] Upstream Letterpress effect

Modified: trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectInterface.mm (158803 => 158804)


--- trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectInterface.mm	2013-11-07 00:39:11 UTC (rev 158803)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectInterface.mm	2013-11-07 00:48:56 UTC (rev 158804)
@@ -44,6 +44,22 @@
     HashMap<SEL, Vector<RetainPtr<NSSet>>> _allowedArgumentClasses;
 }
 
+static bool isContainerClass(Class objectClass)
+{
+    // FIXME: Add more classes here if needed.
+    static NSSet *containerClasses = [[NSSet alloc] initWithObjects:[NSArray class], [NSDictionary class], nil];
+
+    return [containerClasses containsObject:objectClass];
+}
+
+static NSSet *propertyListClasses()
+{
+    // FIXME: Add more property list classes if needed.
+    static NSSet *propertyListClasses = [[NSSet alloc] initWithObjects:[NSArray class], [NSDictionary class], [NSNumber class], [NSString class], nil];
+
+    return propertyListClasses;
+}
+
 static Vector<RetainPtr<NSSet>> allowedArgumentClassesForMethod(NSMethodSignature *methodSignature)
 {
     Vector<RetainPtr<NSSet>> result;
@@ -70,6 +86,12 @@
             continue;
         }
 
+        if (isContainerClass(objectClass)) {
+            // For container classes, we allow all simple property list classes.
+            result.uncheckedAppend(propertyListClasses());
+            continue;
+        }
+
         result.uncheckedAppend([NSSet setWithObject:objectClass]);
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to