Diff
Modified: trunk/Source/WebKit2/ChangeLog (159154 => 159155)
--- trunk/Source/WebKit2/ChangeLog 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/ChangeLog 2013-11-12 23:37:46 UTC (rev 159155)
@@ -1,5 +1,18 @@
2013-11-12 Anders Carlsson <[email protected]>
+ WKMutableArrayRef should be an ImmutableArray
+ https://bugs.webkit.org/show_bug.cgi?id=124239
+
+ Reviewed by Sam Weinig.
+
+ * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
+ (ensureObjectStream):
+ * Shared/API/c/WKMutableArray.cpp:
+ (WKMutableArrayCreate):
+ * Shared/API/c/WKSharedAPICast.h:
+
+2013-11-12 Anders Carlsson <[email protected]>
+
Remove more functionality from MutableArray
https://bugs.webkit.org/show_bug.cgi?id=124235
Modified: trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm (159154 => 159155)
--- trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm 2013-11-12 23:37:46 UTC (rev 159155)
@@ -26,7 +26,7 @@
#import "config.h"
#import "WKRemoteObjectCoder.h"
-#import "MutableArray.h"
+#import "ImmutableArray.h"
#import "MutableDictionary.h"
#import "WKRemoteObjectInterfaceInternal.h"
#import "WebData.h"
@@ -59,7 +59,7 @@
@implementation WKRemoteObjectEncoder {
RefPtr<MutableDictionary> _rootDictionary;
- MutableArray* _objectStream;
+ ImmutableArray* _objectStream;
MutableDictionary* _currentDictionary;
}
@@ -94,7 +94,7 @@
if (encoder->_objectStream)
return;
- RefPtr<MutableArray> objectStream = MutableArray::create();
+ RefPtr<ImmutableArray> objectStream = ImmutableArray::create();
encoder->_objectStream = objectStream.get();
encoder->_rootDictionary->set(objectStreamKey, objectStream.release());
Modified: trunk/Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp (159154 => 159155)
--- trunk/Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp 2013-11-12 23:37:46 UTC (rev 159155)
@@ -26,7 +26,7 @@
#include "config.h"
#include "WKContextMenuItem.h"
-#include "MutableArray.h"
+#include "ImmutableArray.h"
#include "WebContextMenuItem.h"
#include "WebContextMenuItemData.h"
#include "WKAPICast.h"
Modified: trunk/Source/WebKit2/Shared/API/c/WKMutableArray.cpp (159154 => 159155)
--- trunk/Source/WebKit2/Shared/API/c/WKMutableArray.cpp 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/Shared/API/c/WKMutableArray.cpp 2013-11-12 23:37:46 UTC (rev 159155)
@@ -26,14 +26,14 @@
#include "config.h"
#include "WKMutableArray.h"
-#include "MutableArray.h"
+#include "ImmutableArray.h"
#include "WKAPICast.h"
using namespace WebKit;
WKMutableArrayRef WKMutableArrayCreate()
{
- return toAPI(MutableArray::create().leakRef());
+ return const_cast<WKMutableArrayRef>(toAPI(ImmutableArray::create().leakRef()));
}
bool WKArrayIsMutable(WKArrayRef arrayRef)
Modified: trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h (159154 => 159155)
--- trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h 2013-11-12 23:37:46 UTC (rev 159155)
@@ -100,7 +100,6 @@
WK_ADD_API_MAPPING(WKErrorRef, WebError)
WK_ADD_API_MAPPING(WKGraphicsContextRef, WebGraphicsContext)
WK_ADD_API_MAPPING(WKImageRef, WebImage)
-WK_ADD_API_MAPPING(WKMutableArrayRef, MutableArray)
WK_ADD_API_MAPPING(WKMutableDictionaryRef, MutableDictionary)
WK_ADD_API_MAPPING(WKPointRef, WebPoint)
WK_ADD_API_MAPPING(WKRectRef, WebRect)
@@ -115,6 +114,8 @@
WK_ADD_API_MAPPING(WKURLResponseRef, WebURLResponse)
WK_ADD_API_MAPPING(WKUserContentURLPatternRef, WebUserContentURLPattern)
+template<> struct APITypeInfo<WKMutableArrayRef> { typedef ImmutableArray* ImplType; };
+
#if PLATFORM(MAC)
WK_ADD_API_MAPPING(WKWebArchiveRef, WebArchive)
WK_ADD_API_MAPPING(WKWebArchiveResourceRef, WebArchiveResource)
Deleted: trunk/Source/WebKit2/Shared/MutableArray.cpp (159154 => 159155)
--- trunk/Source/WebKit2/Shared/MutableArray.cpp 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/Shared/MutableArray.cpp 2013-11-12 23:37:46 UTC (rev 159155)
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MutableArray.h"
-
-namespace WebKit {
-
-MutableArray::MutableArray()
- : ImmutableArray(Vector<RefPtr<APIObject>>())
-{
-}
-
-MutableArray::~MutableArray()
-{
-}
-
-} // namespace WebKit
Deleted: trunk/Source/WebKit2/Shared/MutableArray.h (159154 => 159155)
--- trunk/Source/WebKit2/Shared/MutableArray.h 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/Shared/MutableArray.h 2013-11-12 23:37:46 UTC (rev 159155)
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MutableArray_h
-#define MutableArray_h
-
-#include "ImmutableArray.h"
-#include <wtf/Forward.h>
-
-namespace WebKit {
-
-// MutableArray - A mutable array type suitable for vending to an API.
-
-class MutableArray : public ImmutableArray {
-public:
- static PassRefPtr<MutableArray> create()
- {
- return adoptRef(new MutableArray);
- }
-
- ~MutableArray();
-
- virtual bool isMutable() { return true; }
-
-private:
- MutableArray();
-};
-
-} // namespace WebKit
-
-#endif // MutableArray_h
Modified: trunk/Source/WebKit2/Shared/WebRenderObject.h (159154 => 159155)
--- trunk/Source/WebKit2/Shared/WebRenderObject.h 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/Shared/WebRenderObject.h 2013-11-12 23:37:46 UTC (rev 159155)
@@ -26,8 +26,7 @@
#ifndef WebRenderObject_h
#define WebRenderObject_h
-#include "APIObject.h"
-#include "MutableArray.h"
+#include "ImmutableArray.h"
#include <WebCore/IntRect.h>
#include <wtf/PassRefPtr.h>
#include <wtf/text/WTFString.h>
Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp (159154 => 159155)
--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.cpp 2013-11-12 23:37:46 UTC (rev 159155)
@@ -26,8 +26,8 @@
#include "config.h"
#include "WebNotificationProvider.h"
+#include "ImmutableArray.h"
#include "ImmutableDictionary.h"
-#include "MutableArray.h"
#include "WKAPICast.h"
#include "WebNotification.h"
#include "WebNotificationManagerProxy.h"
Modified: trunk/Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp (159154 => 159155)
--- trunk/Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp 2013-11-12 23:37:46 UTC (rev 159155)
@@ -29,8 +29,8 @@
#include "WebPageContextMenuClient.h"
+#include "ImmutableArray.h"
#include "Logging.h"
-#include "MutableArray.h"
#include "WebContextMenuItem.h"
#include "WKAPICast.h"
#include "WKSharedAPICast.h"
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (159154 => 159155)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-11-12 23:37:46 UTC (rev 159155)
@@ -1023,8 +1023,6 @@
BCAF361F16CA28CD00D4E9FC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC3DE46815A91763008D26FC /* Foundation.framework */; };
BCAF362016CA28D600D4E9FC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC3DE46815A91763008D26FC /* Foundation.framework */; };
BCAF362216CA292B00D4E9FC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC3DE46815A91763008D26FC /* Foundation.framework */; };
- BCB0AD33122F285800B1341E /* MutableArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC8049D122F0D6B00103529 /* MutableArray.cpp */; };
- BCB0AD34122F285800B1341E /* MutableArray.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC8049E122F0D6B00103529 /* MutableArray.h */; };
BCB0AEE9122F53E300B1341E /* MutableDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB0AEE7122F53E300B1341E /* MutableDictionary.h */; };
BCB0AEEA122F53E300B1341E /* MutableDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB0AEE8122F53E300B1341E /* MutableDictionary.cpp */; };
BCB0B0DC12305A2500B1341E /* WebContextUserMessageCoders.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB0B0DB12305A2500B1341E /* WebContextUserMessageCoders.h */; };
@@ -2622,8 +2620,6 @@
BCC56F771159957D001CCAF9 /* MachPort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachPort.h; sourceTree = "<group>"; };
BCC57159115ADAEF001CCAF9 /* WebSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSystemInterface.h; sourceTree = "<group>"; };
BCC5715A115ADAEF001CCAF9 /* WebSystemInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSystemInterface.mm; sourceTree = "<group>"; };
- BCC8049D122F0D6B00103529 /* MutableArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MutableArray.cpp; sourceTree = "<group>"; };
- BCC8049E122F0D6B00103529 /* MutableArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MutableArray.h; sourceTree = "<group>"; };
BCC8B373125FB69000DE46A4 /* WKGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKGeometry.h; sourceTree = "<group>"; };
BCC938E01180DE440085E5FE /* WKContextPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextPrivate.h; sourceTree = "<group>"; };
BCCB75C51203A1CE00222D1B /* WebContextMessageKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMessageKinds.h; sourceTree = "<group>"; };
@@ -3364,8 +3360,6 @@
BCBCB0CC1215E33A00DE59CA /* ImmutableDictionary.cpp */,
BCBCB0CA1215E32100DE59CA /* ImmutableDictionary.h */,
1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */,
- BCC8049D122F0D6B00103529 /* MutableArray.cpp */,
- BCC8049E122F0D6B00103529 /* MutableArray.h */,
BCB0AEE8122F53E300B1341E /* MutableDictionary.cpp */,
BCB0AEE7122F53E300B1341E /* MutableDictionary.h */,
C02BFF1512514FD8009CCBEA /* NativeWebKeyboardEvent.h */,
@@ -5588,7 +5582,6 @@
1A3EED0F161A535400AEB4F5 /* MessageReceiverMap.h in Headers */,
1A119A95127B796200A9ECB1 /* MessageSender.h in Headers */,
C0E3AA7C1209E83C00A49D01 /* Module.h in Headers */,
- BCB0AD34122F285800B1341E /* MutableArray.h in Headers */,
BCB0AEE9122F53E300B1341E /* MutableDictionary.h in Headers */,
1A6FBA2A11E6862700DB1371 /* NetscapeBrowserFuncs.h in Headers */,
1A6FBD2811E69BC200DB1371 /* NetscapePlugin.h in Headers */,
@@ -6888,7 +6881,6 @@
C0E3AA7B1209E83500A49D01 /* Module.cpp in Sources */,
C0E3AA7A1209E83000A49D01 /* ModuleMac.mm in Sources */,
370F34A21829BE1E009027C8 /* WKNavigationData.mm in Sources */,
- BCB0AD33122F285800B1341E /* MutableArray.cpp in Sources */,
BCB0AEEA122F53E300B1341E /* MutableDictionary.cpp in Sources */,
C02BFF1E1251502E009CCBEA /* NativeWebKeyboardEventMac.mm in Sources */,
31EA25D2134F78C0005B1452 /* NativeWebMouseEventMac.mm in Sources */,
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp (159154 => 159155)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp 2013-11-12 23:14:41 UTC (rev 159154)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp 2013-11-12 23:37:46 UTC (rev 159155)
@@ -32,7 +32,6 @@
#include "ImmutableArray.h"
#include "InjectedBundleHitTestResult.h"
#include "Logging.h"
-#include "MutableArray.h"
#include "WebContextMenuItem.h"
#include "WKAPICast.h"
#include "WKBundleAPICast.h"