Diff
Modified: trunk/Source/WebKit2/ChangeLog (159774 => 159775)
--- trunk/Source/WebKit2/ChangeLog 2013-11-26 00:21:07 UTC (rev 159774)
+++ trunk/Source/WebKit2/ChangeLog 2013-11-26 00:47:51 UTC (rev 159775)
@@ -1,5 +1,34 @@
2013-11-25 Dan Bernstein <m...@apple.com>
+ [Cocoa] Use class extensions for IPI
+ https://bugs.webkit.org/show_bug.cgi?id=124870
+
+ Reviewed by Sam Weinig.
+
+ * UIProcess/API/mac/WKBrowsingContextController.mm: Reordered methods so that the Private
+ cateogry isn’t stuck between the API methods and the internal methods.
+ (-[WKBrowsingContextController setPaginationMode:]):
+ (-[WKBrowsingContextController paginationMode]):
+ (-[WKBrowsingContextController setPaginationBehavesLikeColumns:]):
+ (-[WKBrowsingContextController paginationBehavesLikeColumns]):
+ (-[WKBrowsingContextController setPageLength:]):
+ (-[WKBrowsingContextController pageLength]):
+ (-[WKBrowsingContextController setGapBetweenPages:]):
+ (-[WKBrowsingContextController gapBetweenPages]):
+ (-[WKBrowsingContextController pageCount]):
+ (-[WKBrowsingContextController handle]):
+ * UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Changed Internal category into
+ a class extension.
+
+ * UIProcess/API/mac/WKConnection.mm:
+ * UIProcess/API/mac/WKConnectionInternal.h: Changed Internal category into a class
+ extension.
+
+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h: Ditto.
+
+2013-11-25 Dan Bernstein <m...@apple.com>
+
Fixed the iOS build.
* UIProcess/API/mac/WKBrowsingContextController.mm:
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm (159774 => 159775)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm 2013-11-26 00:21:07 UTC (rev 159774)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm 2013-11-26 00:47:51 UTC (rev 159775)
@@ -102,10 +102,6 @@
WKRetainPtr<WKPageRef> _pageRef;
std::unique_ptr<PageLoadStateObserver> _pageLoadStateObserver;
-
-#if PLATFORM(IOS)
- id <WKBrowsingContextLoadDelegateInternal> _loadDelegateInternal;
-#endif // PLATFORM(IOS)
}
- (void)dealloc
@@ -346,99 +342,6 @@
return WKPageSetPageZoomFactor(_pageRef.get(), pageZoom);
}
-@end
-
-@implementation WKBrowsingContextController (Private)
-
-- (void)setPaginationMode:(WKBrowsingContextPaginationMode)paginationMode
-{
- WKPaginationMode mode;
- switch (paginationMode) {
- case WKPaginationModeUnpaginated:
- mode = kWKPaginationModeUnpaginated;
- break;
- case WKPaginationModeLeftToRight:
- mode = kWKPaginationModeLeftToRight;
- break;
- case WKPaginationModeRightToLeft:
- mode = kWKPaginationModeRightToLeft;
- break;
- case WKPaginationModeTopToBottom:
- mode = kWKPaginationModeTopToBottom;
- break;
- case WKPaginationModeBottomToTop:
- mode = kWKPaginationModeBottomToTop;
- break;
- default:
- return;
- }
-
- WKPageSetPaginationMode(_pageRef.get(), mode);
-}
-
-- (WKBrowsingContextPaginationMode)paginationMode
-{
- switch (WKPageGetPaginationMode(_pageRef.get())) {
- case kWKPaginationModeUnpaginated:
- return WKPaginationModeUnpaginated;
- case kWKPaginationModeLeftToRight:
- return WKPaginationModeLeftToRight;
- case kWKPaginationModeRightToLeft:
- return WKPaginationModeRightToLeft;
- case kWKPaginationModeTopToBottom:
- return WKPaginationModeTopToBottom;
- case kWKPaginationModeBottomToTop:
- return WKPaginationModeBottomToTop;
- }
-
- ASSERT_NOT_REACHED();
- return WKPaginationModeUnpaginated;
-}
-
-- (void)setPaginationBehavesLikeColumns:(BOOL)behavesLikeColumns
-{
- WKPageSetPaginationBehavesLikeColumns(_pageRef.get(), behavesLikeColumns);
-}
-
-- (BOOL)paginationBehavesLikeColumns
-{
- return WKPageGetPaginationBehavesLikeColumns(_pageRef.get());
-}
-
-- (void)setPageLength:(CGFloat)pageLength
-{
- WKPageSetPageLength(_pageRef.get(), pageLength);
-}
-
-- (CGFloat)pageLength
-{
- return WKPageGetPageLength(_pageRef.get());
-}
-
-- (void)setGapBetweenPages:(CGFloat)gapBetweenPages
-{
- WKPageSetGapBetweenPages(_pageRef.get(), gapBetweenPages);
-}
-
-- (CGFloat)gapBetweenPages
-{
- return WKPageGetGapBetweenPages(_pageRef.get());
-}
-
-- (NSUInteger)pageCount
-{
- return WKPageGetPageCount(_pageRef.get());
-}
-
-- (WKBrowsingContextHandle *)handle
-{
- return [[[WKBrowsingContextHandle alloc] _initWithPageID:toImpl(_pageRef.get())->pageID()] autorelease];
-}
-
-@end
-
-@implementation WKBrowsingContextController (Internal)
-
static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
{
if (!WKFrameIsMainFrame(frame))
@@ -651,18 +554,6 @@
WKPageSetPagePolicyClient(pageRef, &policyClient);
}
-#if PLATFORM(IOS)
-- (id <WKBrowsingContextLoadDelegateInternal>)loadDelegateInternal
-{
- return _loadDelegateInternal;
-}
-
-- (void)setLoadDelegateInternal:(id <WKBrowsingContextLoadDelegateInternal>)loadDelegateInternal
-{
- _loadDelegateInternal = loadDelegateInternal;
-}
-#endif // PLATFORM(IOS)
-
/* This should only be called from associate view. */
- (id)_initWithPageRef:(WKPageRef)pageRef
@@ -695,4 +586,93 @@
@end
+@implementation WKBrowsingContextController (Private)
+
+- (void)setPaginationMode:(WKBrowsingContextPaginationMode)paginationMode
+{
+ WKPaginationMode mode;
+ switch (paginationMode) {
+ case WKPaginationModeUnpaginated:
+ mode = kWKPaginationModeUnpaginated;
+ break;
+ case WKPaginationModeLeftToRight:
+ mode = kWKPaginationModeLeftToRight;
+ break;
+ case WKPaginationModeRightToLeft:
+ mode = kWKPaginationModeRightToLeft;
+ break;
+ case WKPaginationModeTopToBottom:
+ mode = kWKPaginationModeTopToBottom;
+ break;
+ case WKPaginationModeBottomToTop:
+ mode = kWKPaginationModeBottomToTop;
+ break;
+ default:
+ return;
+ }
+
+ WKPageSetPaginationMode(_pageRef.get(), mode);
+}
+
+- (WKBrowsingContextPaginationMode)paginationMode
+{
+ switch (WKPageGetPaginationMode(_pageRef.get())) {
+ case kWKPaginationModeUnpaginated:
+ return WKPaginationModeUnpaginated;
+ case kWKPaginationModeLeftToRight:
+ return WKPaginationModeLeftToRight;
+ case kWKPaginationModeRightToLeft:
+ return WKPaginationModeRightToLeft;
+ case kWKPaginationModeTopToBottom:
+ return WKPaginationModeTopToBottom;
+ case kWKPaginationModeBottomToTop:
+ return WKPaginationModeBottomToTop;
+ }
+
+ ASSERT_NOT_REACHED();
+ return WKPaginationModeUnpaginated;
+}
+
+- (void)setPaginationBehavesLikeColumns:(BOOL)behavesLikeColumns
+{
+ WKPageSetPaginationBehavesLikeColumns(_pageRef.get(), behavesLikeColumns);
+}
+
+- (BOOL)paginationBehavesLikeColumns
+{
+ return WKPageGetPaginationBehavesLikeColumns(_pageRef.get());
+}
+
+- (void)setPageLength:(CGFloat)pageLength
+{
+ WKPageSetPageLength(_pageRef.get(), pageLength);
+}
+
+- (CGFloat)pageLength
+{
+ return WKPageGetPageLength(_pageRef.get());
+}
+
+- (void)setGapBetweenPages:(CGFloat)gapBetweenPages
+{
+ WKPageSetGapBetweenPages(_pageRef.get(), gapBetweenPages);
+}
+
+- (CGFloat)gapBetweenPages
+{
+ return WKPageGetGapBetweenPages(_pageRef.get());
+}
+
+- (NSUInteger)pageCount
+{
+ return WKPageGetPageCount(_pageRef.get());
+}
+
+- (WKBrowsingContextHandle *)handle
+{
+ return [[[WKBrowsingContextHandle alloc] _initWithPageID:toImpl(_pageRef.get())->pageID()] autorelease];
+}
+
+@end
+
#endif // WK_API_ENABLED
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerInternal.h (159774 => 159775)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerInternal.h 2013-11-26 00:21:07 UTC (rev 159774)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerInternal.h 2013-11-26 00:47:51 UTC (rev 159775)
@@ -34,7 +34,7 @@
@end
#endif // PLATFORM(IOS)
-@interface WKBrowsingContextController (Internal)
+@interface WKBrowsingContextController ()
#if PLATFORM(IOS)
@property (assign) id <WKBrowsingContextLoadDelegateInternal> loadDelegateInternal;
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.mm (159774 => 159775)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.mm 2013-11-26 00:21:07 UTC (rev 159774)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKConnection.mm 2013-11-26 00:47:51 UTC (rev 159775)
@@ -68,10 +68,6 @@
return _remoteObjectRegistry.get();
}
-@end
-
-@implementation WKConnection (Internal)
-
static void didReceiveMessage(WKConnectionRef, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
{
WKConnection *connection = (WKConnection *)clientInfo;
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKConnectionInternal.h (159774 => 159775)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKConnectionInternal.h 2013-11-26 00:21:07 UTC (rev 159774)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKConnectionInternal.h 2013-11-26 00:47:51 UTC (rev 159775)
@@ -29,7 +29,7 @@
#import <WebKit2/WKBase.h>
-@interface WKConnection (Internal)
+@interface WKConnection ()
- (id)_initWithConnectionRef:(WKConnectionRef)connectionRef;
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm (159774 => 159775)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm 2013-11-26 00:21:07 UTC (rev 159774)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm 2013-11-26 00:47:51 UTC (rev 159775)
@@ -46,7 +46,7 @@
}
@end
-@implementation WKWebProcessPlugInController (Internal)
+@implementation WKWebProcessPlugInController
static void didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
{
@@ -127,10 +127,6 @@
return _bundlePageWrapperCache.get(pageRef).get();
}
-@end
-
-@implementation WKWebProcessPlugInController
-
- (WKConnection *)connection
{
return _connectionWrapper.get();
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h (159774 => 159775)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h 2013-11-26 00:21:07 UTC (rev 159774)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h 2013-11-26 00:47:51 UTC (rev 159775)
@@ -27,7 +27,7 @@
#if WK_API_ENABLED
-@interface WKWebProcessPlugInController (Internal)
+@interface WKWebProcessPlugInController ()
+ (WKWebProcessPlugInController *)_shared;
- (id)_initWithPrincipalClassInstance:(id<WKWebProcessPlugIn>)principalClassInstance bundleRef:(WKBundleRef)bundleRef;