Reverted r158538.
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Nov 2013 02:57:56 +0000 (02:57 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Nov 2013 02:57:56 +0000 (02:57 +0000)
* Shared/Cocoa/WKNSArray.mm:
(-[WKNSArray copyWithZone:]):
* Shared/Cocoa/WKNSDictionary.mm:
(-[WKNSDictionary copyWithZone:]):
* Shared/ImmutableArray.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Cocoa/WKNSArray.mm
Source/WebKit2/Shared/Cocoa/WKNSDictionary.mm
Source/WebKit2/Shared/ImmutableArray.h

index f41ecb8..f5405b5 100644 (file)
@@ -1,5 +1,15 @@
 2013-11-03  Dan Bernstein  <mitz@apple.com>
 
+        Reverted r158538.
+
+        * Shared/Cocoa/WKNSArray.mm:
+        (-[WKNSArray copyWithZone:]):
+        * Shared/Cocoa/WKNSDictionary.mm:
+        (-[WKNSDictionary copyWithZone:]):
+        * Shared/ImmutableArray.h:
+
+2013-11-03  Dan Bernstein  <mitz@apple.com>
+
         [Cocoa] Wrappers' -copyWithZone: should copy if the collection is mutable
         https://bugs.webkit.org/show_bug.cgi?id=123707
 
index e321a3c..e54caba 100644 (file)
@@ -58,11 +58,7 @@ using namespace WebKit;
 
 - (id)copyWithZone:(NSZone *)zone
 {
-    if (!reinterpret_cast<ImmutableArray*>(&_array)->isMutable())
-        return [self retain];
-
-    auto entries = reinterpret_cast<ImmutableArray*>(&_array)->entries();
-    return ImmutableArray::adopt(entries).leakRef()->wrapper();
+    return [self retain];
 }
 
 #pragma mark WKObject protocol implementation
index 9a42c52..e80f454 100644 (file)
@@ -78,11 +78,7 @@ using namespace WebKit;
 
 - (id)copyWithZone:(NSZone *)zone
 {
-    if (!reinterpret_cast<ImmutableDictionary*>(&_dictionary)->isMutable())
-        return [self retain];
-
-    auto map = reinterpret_cast<ImmutableDictionary*>(&_dictionary)->map();
-    return ImmutableDictionary::adopt(map).leakRef()->wrapper();
+    return [self retain];
 }
 
 #pragma mark WKObject protocol implementation
index c97d558..82a96c0 100644 (file)
@@ -65,8 +65,6 @@ public:
 
     virtual bool isMutable() { return false; }
 
-    const Vector<RefPtr<APIObject>>& entries() { return m_entries; }
-
 protected:
     ImmutableArray();
     ImmutableArray(AdoptTag, APIObject** entries, size_t);