Title: [158939] trunk/Source/WebKit2
- Revision
- 158939
- Author
- [email protected]
- Date
- 2013-11-08 12:22:36 -0800 (Fri, 08 Nov 2013)
Log Message
More work on WKBrowsingContextHandle
https://bugs.webkit.org/show_bug.cgi?id=124060
Reviewed by Beth Dakin.
Implement -hash and -isEqual: and add -[WKWebProcessPlugInBrowserContextController handle].
* Shared/API/Cocoa/WKBrowsingContextHandle.mm:
(-[WKBrowsingContextHandle hash]):
(-[WKBrowsingContextHandle isEqual:]):
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(decodeInvocation):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController mainFrameDocument]):
(-[WKWebProcessPlugInBrowserContextController selectedRange]):
(-[WKWebProcessPlugInBrowserContextController handle]):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (158938 => 158939)
--- trunk/Source/WebKit2/ChangeLog 2013-11-08 20:06:14 UTC (rev 158938)
+++ trunk/Source/WebKit2/ChangeLog 2013-11-08 20:22:36 UTC (rev 158939)
@@ -1,5 +1,26 @@
2013-11-08 Anders Carlsson <[email protected]>
+ More work on WKBrowsingContextHandle
+ https://bugs.webkit.org/show_bug.cgi?id=124060
+
+ Reviewed by Beth Dakin.
+
+ Implement -hash and -isEqual: and add -[WKWebProcessPlugInBrowserContextController handle].
+
+ * Shared/API/Cocoa/WKBrowsingContextHandle.mm:
+ (-[WKBrowsingContextHandle hash]):
+ (-[WKBrowsingContextHandle isEqual:]):
+ * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
+ (decodeInvocation):
+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+ (-[WKWebProcessPlugInBrowserContextController mainFrameDocument]):
+ (-[WKWebProcessPlugInBrowserContextController selectedRange]):
+ (-[WKWebProcessPlugInBrowserContextController handle]):
+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h:
+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
+
+2013-11-08 Anders Carlsson <[email protected]>
+
Add A WKBrowsingContextHandle class
https://bugs.webkit.org/show_bug.cgi?id=124058
Modified: trunk/Source/WebKit2/Shared/API/Cocoa/WKBrowsingContextHandle.mm (158938 => 158939)
--- trunk/Source/WebKit2/Shared/API/Cocoa/WKBrowsingContextHandle.mm 2013-11-08 20:06:14 UTC (rev 158938)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/WKBrowsingContextHandle.mm 2013-11-08 20:22:36 UTC (rev 158939)
@@ -40,6 +40,19 @@
return self;
}
+- (NSUInteger)hash
+{
+ return _pageID;
+}
+
+- (BOOL)isEqual:(id)object
+{
+ if (![object isKindOfClass:[WKBrowsingContextHandle class]])
+ return NO;
+
+ return _pageID == static_cast<WKBrowsingContextHandle *>(object)->_pageID;
+}
+
- (void)encodeWithCoder:(NSCoder *)coder
{
[coder encodeInt64:_pageID forKey:@"pageID"];
Modified: trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm (158938 => 158939)
--- trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm 2013-11-08 20:06:14 UTC (rev 158938)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm 2013-11-08 20:22:36 UTC (rev 158939)
@@ -420,7 +420,7 @@
[NSException raise:NSInvalidUnarchiveOperationException format:@"Invocation had no type signature"];
NSMethodSignature *remoteMethodSignature = [NSMethodSignature signatureWithObjCTypes:typeSignature.UTF8String];
- if (![localMethodSignature isEqualTo:remoteMethodSignature])
+ if (![localMethodSignature isEqual:remoteMethodSignature])
[NSException raise:NSInvalidUnarchiveOperationException format:@"Local and remote method signatures are not equal for method \"%@\"", selectorString];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:localMethodSignature];
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (158938 => 158939)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm 2013-11-08 20:06:14 UTC (rev 158938)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm 2013-11-08 20:22:36 UTC (rev 158939)
@@ -25,12 +25,11 @@
#import "config.h"
-#import "WKWebProcessPlugInBrowserContextController.h"
#import "WKWebProcessPlugInBrowserContextControllerInternal.h"
-#import "WKWebProcessPlugInBrowserContextControllerPrivate.h"
#if WK_API_ENABLED
+#import "WKBrowsingContextHandleInternal.h"
#import "WKBundleAPICast.h"
#import "WKBundlePage.h"
#import "WKBundlePagePrivate.h"
@@ -40,14 +39,13 @@
#import <WebCore/Document.h>
#import <WebCore/Frame.h>
-@interface WKWebProcessPlugInBrowserContextController () {
- // Underlying WKBundlePageRef.
+using namespace WebCore;
+using namespace WebKit;
+
+@implementation WKWebProcessPlugInBrowserContextController {
WKRetainPtr<WKBundlePageRef> _bundlePageRef;
}
-@end
-@implementation WKWebProcessPlugInBrowserContextController (Internal)
-
- (id)_initWithBundlePageRef:(WKBundlePageRef)bundlePageRef
{
self = [super init];
@@ -59,26 +57,22 @@
return self;
}
-@end
-
-@implementation WKWebProcessPlugInBrowserContextController
-
- (WKDOMDocument *)mainFrameDocument
{
- WebCore::Frame* webCoreMainFrame = WebKit::toImpl(self._bundlePageRef)->mainFrame();
+ WebCore::Frame* webCoreMainFrame = toImpl(_bundlePageRef.get())->mainFrame();
if (!webCoreMainFrame)
return nil;
- return WebKit::toWKDOMDocument(webCoreMainFrame->document());
+ return toWKDOMDocument(webCoreMainFrame->document());
}
- (WKDOMRange *)selectedRange
{
- RefPtr<WebCore::Range> range = WebKit::toImpl(self._bundlePageRef)->currentSelectionAsRange();
+ RefPtr<WebCore::Range> range = toImpl(_bundlePageRef.get())->currentSelectionAsRange();
if (!range)
return nil;
- return WebKit::toWKDOMRange(range.get());
+ return toWKDOMRange(range.get());
}
@end
@@ -90,6 +84,11 @@
return _bundlePageRef.get();
}
+- (WKBrowsingContextHandle *)handle
+{
+ return [[[WKBrowsingContextHandle alloc] _initWithPageID:toImpl(_bundlePageRef.get())->pageID()] autorelease];
+}
+
@end
#endif // WK_API_ENABLED
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h (158938 => 158939)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h 2013-11-08 20:06:14 UTC (rev 158938)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h 2013-11-08 20:22:36 UTC (rev 158939)
@@ -23,12 +23,12 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "WKWebProcessPlugInBrowserContextController.h"
+#import "WKWebProcessPlugInBrowserContextControllerPrivate.h"
#import "WKBase.h"
#if WK_API_ENABLED
-@interface WKWebProcessPlugInBrowserContextController (Internal)
+@interface WKWebProcessPlugInBrowserContextController ()
- (id)_initWithBundlePageRef:(WKBundlePageRef)bundlePageRef;
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h (158938 => 158939)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h 2013-11-08 20:06:14 UTC (rev 158938)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h 2013-11-08 20:22:36 UTC (rev 158939)
@@ -27,10 +27,16 @@
#if WK_API_ENABLED
+#import <WebKit2/WKBase.h>
+
+@class WKBrowsingContextHandle;
+
@interface WKWebProcessPlugInBrowserContextController (Private)
-@property(readonly) WKBundlePageRef _bundlePageRef;
+@property (nonatomic, readonly) WKBundlePageRef _bundlePageRef;
+@property (nonatomic, readonly) WKBrowsingContextHandle *handle;
+
@end
#endif // WK_API_ENABLED
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes