Diff
Modified: tags/Safari-537.31.1/Source/WebKit2/ChangeLog (142915 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/ChangeLog 2013-02-14 22:00:53 UTC (rev 142915)
+++ tags/Safari-537.31.1/Source/WebKit2/ChangeLog 2013-02-14 22:01:41 UTC (rev 142916)
@@ -1,3 +1,30 @@
+2013-02-14 Lucas Forschler <lforsch...@apple.com>
+
+ Merge r142900
+
+ 2013-02-14 Sam Weinig <s...@webkit.org>
+
+ Add conversions between ObjC and C DOM wrappers
+ <rdar://problem/13205468>
+ https://bugs.webkit.org/show_bug.cgi?id=109851
+
+ Reviewed by Anders Carlsson.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
+ (WKBundleRangeHandleCreate):
+ * WebProcess/InjectedBundle/API/c/WKBundleRangeHandlePrivate.h: Added.
+ * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
+ (-[WKDOMNode _copyBundleNodeHandleRef]):
+ * WebProcess/InjectedBundle/API/mac/WKDOMNodePrivate.h: Added.
+ * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
+ (-[WKDOMRange _copyBundleRangeHandleRef]):
+ * WebProcess/InjectedBundle/API/mac/WKDOMRangePrivate.h: Added.
+ * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
+ (WebKit::InjectedBundleRangeHandle::getOrCreate):
+ * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
+ (InjectedBundleRangeHandle):
+
2013-02-12 Adenilson Cavalcanti <cavalcan...@gmail.com>
[WK2] Page reloading will crash UIProcess after WebProcess was killed
Modified: tags/Safari-537.31.1/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (142915 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-02-14 22:00:53 UTC (rev 142915)
+++ tags/Safari-537.31.1/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2013-02-14 22:01:41 UTC (rev 142916)
@@ -774,6 +774,9 @@
BC59548915C7868500FD1E3E /* WebKit2.h in Headers */ = {isa = PBXBuildFile; fileRef = BC59548815C7868500FD1E3E /* WebKit2.h */; settings = {ATTRIBUTES = (Public, ); }; };
BC597075116591D000551FCA /* ProcessModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BC597074116591D000551FCA /* ProcessModel.h */; };
BC5C75C814954DA600BC4775 /* WKConnectionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5C75C614954DA600BC4775 /* WKConnectionInternal.h */; };
+ BC5D24C216CD706D007D5461 /* WKDOMNodePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5D24C116CD706D007D5461 /* WKDOMNodePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ BC5D24C516CD7088007D5461 /* WKDOMRangePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5D24C416CD7088007D5461 /* WKDOMRangePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ BC5D24C716CD73C5007D5461 /* WKBundleRangeHandlePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5D24C616CD73C5007D5461 /* WKBundleRangeHandlePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC60C5791240A546008C5E29 /* WKBundleRangeHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = BC60C5771240A546008C5E29 /* WKBundleRangeHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC60C57A1240A546008C5E29 /* WKBundleRangeHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC60C5781240A546008C5E29 /* WKBundleRangeHandle.cpp */; };
BC64696F11DBE603006455B0 /* ImmutableArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC64696D11DBE603006455B0 /* ImmutableArray.cpp */; };
@@ -2188,6 +2191,9 @@
BC59548815C7868500FD1E3E /* WebKit2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKit2.h; sourceTree = "<group>"; };
BC597074116591D000551FCA /* ProcessModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessModel.h; sourceTree = "<group>"; };
BC5C75C614954DA600BC4775 /* WKConnectionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKConnectionInternal.h; sourceTree = "<group>"; };
+ BC5D24C116CD706D007D5461 /* WKDOMNodePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDOMNodePrivate.h; sourceTree = "<group>"; };
+ BC5D24C416CD7088007D5461 /* WKDOMRangePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKDOMRangePrivate.h; sourceTree = "<group>"; };
+ BC5D24C616CD73C5007D5461 /* WKBundleRangeHandlePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleRangeHandlePrivate.h; sourceTree = "<group>"; };
BC60C5771240A546008C5E29 /* WKBundleRangeHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleRangeHandle.h; sourceTree = "<group>"; };
BC60C5781240A546008C5E29 /* WKBundleRangeHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleRangeHandle.cpp; sourceTree = "<group>"; };
BC64696D11DBE603006455B0 /* ImmutableArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImmutableArray.cpp; sourceTree = "<group>"; };
@@ -3642,8 +3648,10 @@
BC017D0416260FF4007054F5 /* WKDOMInternals.mm */,
BC017D0516260FF4007054F5 /* WKDOMNode.h */,
BC017D0616260FF4007054F5 /* WKDOMNode.mm */,
+ BC5D24C116CD706D007D5461 /* WKDOMNodePrivate.h */,
BC39C4341626366F008BC689 /* WKDOMRange.h */,
BC39C4331626366F008BC689 /* WKDOMRange.mm */,
+ BC5D24C416CD7088007D5461 /* WKDOMRangePrivate.h */,
293EBEA91627D9C9005F89F1 /* WKDOMText.h */,
293EBEAA1627D9C9005F89F1 /* WKDOMText.mm */,
BC017D1F16263308007054F5 /* WKDOMTextIterator.h */,
@@ -4240,6 +4248,7 @@
BCF049E511FE20F600F86A58 /* WKBundlePrivate.h */,
BC60C5781240A546008C5E29 /* WKBundleRangeHandle.cpp */,
BC60C5771240A546008C5E29 /* WKBundleRangeHandle.h */,
+ BC5D24C616CD73C5007D5461 /* WKBundleRangeHandlePrivate.h */,
BC14DF9C120B635F00826C0C /* WKBundleScriptWorld.cpp */,
BC14DF9D120B635F00826C0C /* WKBundleScriptWorld.h */,
);
@@ -5553,6 +5562,9 @@
BCAF35E416CA24DA00D4E9FC /* OfflineStorageProcessMessages.h in Headers */,
BCAF35EA16CA253B00D4E9FC /* OfflineStorageProcessCreationParameters.h in Headers */,
514BDED316C98EDD00E4E25E /* StatisticsRequest.h in Headers */,
+ BC5D24C216CD706D007D5461 /* WKDOMNodePrivate.h in Headers */,
+ BC5D24C516CD7088007D5461 /* WKDOMRangePrivate.h in Headers */,
+ BC5D24C716CD73C5007D5461 /* WKBundleRangeHandlePrivate.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp (142915 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp 2013-02-14 22:00:53 UTC (rev 142915)
+++ tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp 2013-02-14 22:01:41 UTC (rev 142916)
@@ -25,6 +25,7 @@
#include "config.h"
#include "WKBundleRangeHandle.h"
+#include "WKBundleRangeHandlePrivate.h"
#include "InjectedBundleRangeHandle.h"
#include "WKAPICast.h"
@@ -36,3 +37,9 @@
{
return toAPI(InjectedBundleRangeHandle::APIType);
}
+
+WKBundleRangeHandleRef WKBundleRangeHandleCreate(JSContextRef contextRef, JSObjectRef objectRef)
+{
+ RefPtr<InjectedBundleRangeHandle> rangeHandle = InjectedBundleRangeHandle::getOrCreate(contextRef, objectRef);
+ return toAPI(rangeHandle.release().leakRef());
+}
Copied: tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandlePrivate.h (from rev 142900, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandlePrivate.h) (0 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandlePrivate.h (rev 0)
+++ tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleRangeHandlePrivate.h 2013-02-14 22:01:41 UTC (rev 142916)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2013 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 WKBundleRangeHandlePrivate_h
+#define WKBundleRangeHandlePrivate_h
+
+#include <_javascript_Core/_javascript_.h>
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKBundleRangeHandleRef WKBundleRangeHandleCreate(JSContextRef context, JSObjectRef object);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKBundleRangeHandlePrivate_h
Modified: tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.mm (142915 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.mm 2013-02-14 22:00:53 UTC (rev 142915)
+++ tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.mm 2013-02-14 22:01:41 UTC (rev 142916)
@@ -29,6 +29,8 @@
#import "WKDOMNode.h"
+#import "InjectedBundleNodeHandle.h"
+#import "WKBundleAPICast.h"
#import "WKDOMInternals.h"
#import <WebCore/Document.h>
@@ -115,4 +117,14 @@
@end
+@implementation WKDOMNode (WKPrivate)
+
+- (WKBundleNodeHandleRef)_copyBundleNodeHandleRef
+{
+ RefPtr<WebKit::InjectedBundleNodeHandle> nodeHandle = WebKit::InjectedBundleNodeHandle::getOrCreate(_impl.get());
+ return toAPI(nodeHandle.release().leakRef());
+}
+
+@end
+
#endif // defined(__LP64__) && defined(__clang__)
Copied: tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNodePrivate.h (from rev 142900, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNodePrivate.h) (0 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNodePrivate.h (rev 0)
+++ tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNodePrivate.h 2013-02-14 22:01:41 UTC (rev 142916)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+#if defined(__LP64__) && defined(__clang__)
+
+#import <WebKit2/WKDOMNode.h>
+
+@interface WKDOMNode (WKPrivate)
+
+- (WKBundleNodeHandleRef)_copyWKBundleNodeHandleRef;
+
+@end
+
+#endif // defined(__LP64__) && defined(__clang__)
Modified: tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm (142915 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm 2013-02-14 22:00:53 UTC (rev 142915)
+++ tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm 2013-02-14 22:01:41 UTC (rev 142916)
@@ -29,6 +29,8 @@
#import "WKDOMRange.h"
+#import "InjectedBundleRangeHandle.h"
+#import "WKBundleAPICast.h"
#import "WKDOMInternals.h"
#import <WebCore/Document.h>
@@ -147,4 +149,14 @@
@end
+@implementation WKDOMRange (WKPrivate)
+
+- (WKBundleRangeHandleRef)_copyBundleRangeHandleRef
+{
+ RefPtr<WebKit::InjectedBundleRangeHandle> rangeHandle = WebKit::InjectedBundleRangeHandle::getOrCreate(_impl.get());
+ return toAPI(rangeHandle.release().leakRef());
+}
+
+@end
+
#endif // defined(__LP64__) && defined(__clang__)
Copied: tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRangePrivate.h (from rev 142900, trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRangePrivate.h) (0 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRangePrivate.h (rev 0)
+++ tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRangePrivate.h 2013-02-14 22:01:41 UTC (rev 142916)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+#if defined(__LP64__) && defined(__clang__)
+
+#import <WebKit2/WKRangeNode.h>
+
+@interface WKRangeNode (WKPrivate)
+
+- (WKBundleRangeHandleRef)_copyWKBundleRangeHandleRef;
+
+@end
+
+#endif // defined(__LP64__) && defined(__clang__)
Modified: tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp (142915 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp 2013-02-14 22:00:53 UTC (rev 142915)
+++ tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp 2013-02-14 22:01:41 UTC (rev 142916)
@@ -26,6 +26,8 @@
#include "config.h"
#include "InjectedBundleRangeHandle.h"
+#include <_javascript_Core/APICast.h>
+#include <WebCore/JSRange.h>
#include <WebCore/Range.h>
#include <wtf/HashMap.h>
@@ -41,6 +43,12 @@
return cache;
}
+PassRefPtr<InjectedBundleRangeHandle> InjectedBundleRangeHandle::getOrCreate(JSContextRef, JSObjectRef object)
+{
+ Range* range = toRange(toJS(object));
+ return getOrCreate(range);
+}
+
PassRefPtr<InjectedBundleRangeHandle> InjectedBundleRangeHandle::getOrCreate(Range* range)
{
if (!range)
Modified: tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h (142915 => 142916)
--- tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h 2013-02-14 22:00:53 UTC (rev 142915)
+++ tags/Safari-537.31.1/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h 2013-02-14 22:01:41 UTC (rev 142916)
@@ -27,6 +27,7 @@
#define InjectedBundleRangeHandle_h
#include "APIObject.h"
+#include <_javascript_Core/JSBase.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
@@ -42,6 +43,7 @@
public:
static const Type APIType = TypeBundleRangeHandle;
+ static PassRefPtr<InjectedBundleRangeHandle> getOrCreate(JSContextRef, JSObjectRef);
static PassRefPtr<InjectedBundleRangeHandle> getOrCreate(WebCore::Range*);
virtual ~InjectedBundleRangeHandle();