Title: [159156] trunk/Source/WebKit2
Revision
159156
Author
[email protected]
Date
2013-11-12 16:04:05 -0800 (Tue, 12 Nov 2013)

Log Message

Remove ImmutableArray::isMutable
https://bugs.webkit.org/show_bug.cgi?id=124242

Reviewed by Dan Bernstein.

* Shared/API/c/WKMutableArray.cpp:
(WKArrayIsMutable):
* Shared/Cocoa/WKNSArray.mm:
(-[WKNSArray copyWithZone:]):
* Shared/ImmutableArray.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (159155 => 159156)


--- trunk/Source/WebKit2/ChangeLog	2013-11-12 23:37:46 UTC (rev 159155)
+++ trunk/Source/WebKit2/ChangeLog	2013-11-13 00:04:05 UTC (rev 159156)
@@ -1,5 +1,18 @@
 2013-11-12  Anders Carlsson  <[email protected]>
 
+        Remove ImmutableArray::isMutable
+        https://bugs.webkit.org/show_bug.cgi?id=124242
+
+        Reviewed by Dan Bernstein.
+
+        * Shared/API/c/WKMutableArray.cpp:
+        (WKArrayIsMutable):
+        * Shared/Cocoa/WKNSArray.mm:
+        (-[WKNSArray copyWithZone:]):
+        * Shared/ImmutableArray.h:
+
+2013-11-12  Anders Carlsson  <[email protected]>
+
         WKMutableArrayRef should be an ImmutableArray
         https://bugs.webkit.org/show_bug.cgi?id=124239
 

Modified: trunk/Source/WebKit2/Shared/API/c/WKMutableArray.cpp (159155 => 159156)


--- trunk/Source/WebKit2/Shared/API/c/WKMutableArray.cpp	2013-11-12 23:37:46 UTC (rev 159155)
+++ trunk/Source/WebKit2/Shared/API/c/WKMutableArray.cpp	2013-11-13 00:04:05 UTC (rev 159156)
@@ -38,7 +38,8 @@
 
 bool WKArrayIsMutable(WKArrayRef arrayRef)
 {
-    return toImpl(arrayRef)->isMutable();
+    // FIXME: This function should be removed.
+    return false;
 }
 
 void WKArrayAppendItem(WKMutableArrayRef arrayRef, WKTypeRef itemRef)

Modified: trunk/Source/WebKit2/Shared/Cocoa/WKNSArray.mm (159155 => 159156)


--- trunk/Source/WebKit2/Shared/Cocoa/WKNSArray.mm	2013-11-12 23:37:46 UTC (rev 159155)
+++ trunk/Source/WebKit2/Shared/Cocoa/WKNSArray.mm	2013-11-13 00:04:05 UTC (rev 159156)
@@ -58,11 +58,7 @@
 
 - (id)copyWithZone:(NSZone *)zone
 {
-    if (!reinterpret_cast<ImmutableArray*>(&_array)->isMutable())
-        return [self retain];
-
-    auto elements = reinterpret_cast<ImmutableArray*>(&_array)->elements();
-    return ImmutableArray::create(std::move(elements)).leakRef()->wrapper();
+    return [self retain];
 }
 
 #pragma mark WKObject protocol implementation

Modified: trunk/Source/WebKit2/Shared/ImmutableArray.h (159155 => 159156)


--- trunk/Source/WebKit2/Shared/ImmutableArray.h	2013-11-12 23:37:46 UTC (rev 159155)
+++ trunk/Source/WebKit2/Shared/ImmutableArray.h	2013-11-13 00:04:05 UTC (rev 159156)
@@ -35,7 +35,7 @@
 
 // ImmutableArray - An immutable array type suitable for vending to an API.
 
-class ImmutableArray : public TypedAPIObject<APIObject::TypeArray> {
+class ImmutableArray FINAL : public TypedAPIObject<APIObject::TypeArray> {
 public:
     static PassRefPtr<ImmutableArray> create();
     static PassRefPtr<ImmutableArray> create(Vector<RefPtr<APIObject>> elements);
@@ -56,8 +56,6 @@
     APIObject* at(size_t i) const { return m_elements[i].get(); }
     size_t size() const { return m_elements.size(); }
 
-    virtual bool isMutable() { return false; }
-
     const Vector<RefPtr<APIObject>>& elements() const { return m_elements; }
     Vector<RefPtr<APIObject>>& elements() { return m_elements; }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to