Title: [97819] trunk
Revision
97819
Author
[email protected]
Date
2011-10-18 17:40:30 -0700 (Tue, 18 Oct 2011)

Log Message

Source/WebKit2: Move uses of C SPI out of WKView.h and into WKViewPrivate.h
https://bugs.webkit.org/show_bug.cgi?id=70387

Reviewed by Dan Bernstein.

* UIProcess/API/mac/WKViewPrivate.h:
Move declarations here.

* UIProcess/API/mac/WKView.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView _updateRemoteAccessibilityRegistration:]):
(-[WKView initWithFrame:]):
(-[WKView initWithFrame:contextRef:]):
(-[WKView _registerDraggedTypes]):
(-[WKView initWithFrame:contextRef:pageGroupRef:]):
(-[WKView pageRef]):
(-[WKView canChangeFrameLayout:]):
(-[WKView printOperationWithPrintInfo:forFrame:]):
(-[WKView setFrame:andScrollBy:]):
Move definitions to private category.

* UIProcess/API/mac/PDFViewController.mm:
* UIProcess/mac/WKFullScreenWindowController.mm:
* UIProcess/mac/WebInspectorProxyMac.mm:
Update to include WKViewPrivate.h where necessary.

Tools: Move uses of C-SPI out of WKView.h and into WKViewPrivate.h
https://bugs.webkit.org/show_bug.cgi?id=70387

Reviewed by Dan Bernstein.

* MiniBrowser/mac/BrowserWindowController.m:
* TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm:
* TestWebKitAPI/mac/_javascript_TestMac.mm:
* TestWebKitAPI/mac/PlatformWebViewMac.mm:
* TestWebKitAPI/mac/WebKitAgnosticTest.mm:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
Update to include WKViewPrivate.h where necessary.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (97818 => 97819)


--- trunk/Source/WebKit2/ChangeLog	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-19 00:40:30 UTC (rev 97819)
@@ -1,5 +1,33 @@
 2011-10-18  Sam Weinig  <[email protected]>
 
+        Move uses of C SPI out of WKView.h and into WKViewPrivate.h
+        https://bugs.webkit.org/show_bug.cgi?id=70387
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/API/mac/WKViewPrivate.h:
+        Move declarations here.
+
+        * UIProcess/API/mac/WKView.h:
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _updateRemoteAccessibilityRegistration:]):
+        (-[WKView initWithFrame:]):
+        (-[WKView initWithFrame:contextRef:]):
+        (-[WKView _registerDraggedTypes]):
+        (-[WKView initWithFrame:contextRef:pageGroupRef:]):
+        (-[WKView pageRef]):
+        (-[WKView canChangeFrameLayout:]):
+        (-[WKView printOperationWithPrintInfo:forFrame:]):
+        (-[WKView setFrame:andScrollBy:]):
+        Move definitions to private category.
+
+        * UIProcess/API/mac/PDFViewController.mm:
+        * UIProcess/mac/WKFullScreenWindowController.mm:
+        * UIProcess/mac/WebInspectorProxyMac.mm:
+        Update to include WKViewPrivate.h where necessary.
+
+2011-10-18  Sam Weinig  <[email protected]>
+
         Stop leaking internal names in WKView API header
         https://bugs.webkit.org/show_bug.cgi?id=70380
 

Modified: trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm (97818 => 97819)


--- trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PDFViewController.mm	2011-10-19 00:40:30 UTC (rev 97819)
@@ -28,7 +28,7 @@
 
 #import "DataReference.h"
 #import "WKAPICast.h"
-#import "WKView.h"
+#import "WKViewPrivate.h"
 #import "WebData.h"
 #import "WebEventFactory.h"
 #import "WebPageGroup.h"

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.h (97818 => 97819)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.h	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.h	2011-10-19 00:40:30 UTC (rev 97819)
@@ -34,16 +34,6 @@
     unsigned _unused;
 }
 
-- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef;
-- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef;
-
-- (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(WKFrameRef)frameRef;
-- (BOOL)canChangeFrameLayout:(WKFrameRef)frameRef;
-
-- (void)setFrame:(NSRect)rect andScrollBy:(NSSize)offset;
-
-@property(readonly) WKPageRef pageRef;
-
 @property BOOL drawsBackground;
 @property BOOL drawsTransparentBackground;
 

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (97818 => 97819)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-10-19 00:40:30 UTC (rev 97819)
@@ -189,76 +189,6 @@
 
 @implementation WKView
 
-- (id)initWithFrame:(NSRect)frame
-{
-    return [self initWithFrame:frame contextRef:toAPI(WebContext::sharedProcessContext())];
-}
-
-- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef
-{   
-    return [self initWithFrame:frame contextRef:contextRef pageGroupRef:nil];
-}
-
-- (void)_registerDraggedTypes
-{
-    NSMutableSet *types = [[NSMutableSet alloc] initWithArray:PasteboardTypes::forEditing()];
-    [types addObjectsFromArray:PasteboardTypes::forURL()];
-    [self registerForDraggedTypes:[types allObjects]];
-    [types release];
-}
-
-- (void)_updateRemoteAccessibilityRegistration:(BOOL)registerProcess
-{
-    // When the tree is connected/disconnected, the remote accessibility registration
-    // needs to be updated with the pid of the remote process. If the process is going
-    // away, that information is not present in WebProcess
-    pid_t pid = 0;
-    if (registerProcess && _data->_page->process())
-        pid = _data->_page->process()->processIdentifier();
-    else if (!registerProcess) {
-        pid = WKAXRemoteProcessIdentifier(_data->_remoteAccessibilityChild.get());
-        _data->_remoteAccessibilityChild = nil;
-    }
-    if (pid)
-        WKAXRegisterRemoteProcess(registerProcess, pid); 
-}
-
-- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef
-{
-    self = [super initWithFrame:frame];
-    if (!self)
-        return nil;
-
-    [NSApp registerServicesMenuSendTypes:PasteboardTypes::forSelection() returnTypes:PasteboardTypes::forEditing()];
-
-    InitWebCoreSystemInterface();
-    RunLoop::initializeMainRunLoop();
-
-    NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:frame
-                                                                options:(NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect)
-                                                                  owner:self
-                                                               userInfo:nil];
-    [self addTrackingArea:trackingArea];
-    [trackingArea release];
-
-    _data = [[WKViewData alloc] init];
-
-    _data->_pageClient = PageClientImpl::create(self);
-    _data->_page = toImpl(contextRef)->createWebPage(_data->_pageClient.get(), toImpl(pageGroupRef));
-    _data->_page->initializeWebPage();
-#if ENABLE(FULLSCREEN_API)
-    _data->_page->fullScreenManager()->setWebView(self);
-#endif
-    _data->_mouseDownEvent = nil;
-    _data->_ignoringMouseDraggedEvents = NO;
-
-    [self _registerDraggedTypes];
-
-    WebContext::statistics().wkViewCount++;
-
-    return self;
-}
-
 - (void)dealloc
 {
     _data->_page->close();
@@ -273,11 +203,6 @@
     [super dealloc];
 }
 
-- (WKPageRef)pageRef
-{
-    return toAPI(_data->_page.get());
-}
-
 - (void)setDrawsBackground:(BOOL)drawsBackground
 {
     _data->_page->setDrawsBackground(drawsBackground);
@@ -357,14 +282,6 @@
     return YES;
 }
 
-- (void)setFrame:(NSRect)rect andScrollBy:(NSSize)offset
-{
-    ASSERT(NSEqualSizes(_data->_resizeScrollOffset, NSZeroSize));
-
-    _data->_resizeScrollOffset = offset;
-    [self setFrame:rect];
-}
-
 - (void)setFrameSize:(NSSize)size
 {
     [super setFrameSize:size];
@@ -1999,6 +1916,22 @@
     _data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
 }
 
+- (void)_updateRemoteAccessibilityRegistration:(BOOL)registerProcess
+{
+    // When the tree is connected/disconnected, the remote accessibility registration
+    // needs to be updated with the pid of the remote process. If the process is going
+    // away, that information is not present in WebProcess
+    pid_t pid = 0;
+    if (registerProcess && _data->_page->process())
+        pid = _data->_page->process()->processIdentifier();
+    else if (!registerProcess) {
+        pid = WKAXRemoteProcessIdentifier(_data->_remoteAccessibilityChild.get());
+        _data->_remoteAccessibilityChild = nil;
+    }
+    if (pid)
+        WKAXRegisterRemoteProcess(registerProcess, pid); 
+}
+
 - (id)accessibilityFocusedUIElement
 {
     if (_data->_pdfViewController)
@@ -2060,33 +1993,6 @@
     return (NSInteger)self;
 }
 
-
-- (BOOL)canChangeFrameLayout:(WKFrameRef)frameRef
-{
-    // PDF documents are already paginated, so we can't change them to add headers and footers.
-    return !toImpl(frameRef)->isMainFrame() || !_data->_pdfViewController;
-}
-
-- (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(WKFrameRef)frameRef
-{
-    LOG(View, "Creating an NSPrintOperation for frame '%s'", toImpl(frameRef)->url().utf8().data());
-
-    // Only the top frame can currently contain a PDF view.
-    if (_data->_pdfViewController) {
-        if (!toImpl(frameRef)->isMainFrame())
-            return 0;
-        return _data->_pdfViewController->makePrintOperation(printInfo);
-    } else {
-        RetainPtr<WKPrintingView> printingView(AdoptNS, [[WKPrintingView alloc] initWithFrameProxy:toImpl(frameRef) view:self]);
-        // NSPrintOperation takes ownership of the view.
-        NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:printingView.get()];
-        [printOperation setCanSpawnSeparateThread:YES];
-        [printOperation setJobTitle:toImpl(frameRef)->title()];
-        printingView->_printOperation = printOperation;
-        return printOperation;
-    }
-}
-
 - (float)_intrinsicDeviceScaleFactor
 {
     NSWindow *window = [self window];
@@ -2641,6 +2547,99 @@
 
 @implementation WKView (Private)
 
+- (id)initWithFrame:(NSRect)frame
+{
+    return [self initWithFrame:frame contextRef:toAPI(WebContext::sharedProcessContext())];
+}
+
+- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef
+{   
+    return [self initWithFrame:frame contextRef:contextRef pageGroupRef:nil];
+}
+
+- (void)_registerDraggedTypes
+{
+    NSMutableSet *types = [[NSMutableSet alloc] initWithArray:PasteboardTypes::forEditing()];
+    [types addObjectsFromArray:PasteboardTypes::forURL()];
+    [self registerForDraggedTypes:[types allObjects]];
+    [types release];
+}
+
+- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef
+{
+    self = [super initWithFrame:frame];
+    if (!self)
+        return nil;
+
+    [NSApp registerServicesMenuSendTypes:PasteboardTypes::forSelection() returnTypes:PasteboardTypes::forEditing()];
+
+    InitWebCoreSystemInterface();
+    RunLoop::initializeMainRunLoop();
+
+    NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:frame
+                                                                options:(NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow | NSTrackingInVisibleRect)
+                                                                  owner:self
+                                                               userInfo:nil];
+    [self addTrackingArea:trackingArea];
+    [trackingArea release];
+
+    _data = [[WKViewData alloc] init];
+
+    _data->_pageClient = PageClientImpl::create(self);
+    _data->_page = toImpl(contextRef)->createWebPage(_data->_pageClient.get(), toImpl(pageGroupRef));
+    _data->_page->initializeWebPage();
+#if ENABLE(FULLSCREEN_API)
+    _data->_page->fullScreenManager()->setWebView(self);
+#endif
+    _data->_mouseDownEvent = nil;
+    _data->_ignoringMouseDraggedEvents = NO;
+
+    [self _registerDraggedTypes];
+
+    WebContext::statistics().wkViewCount++;
+
+    return self;
+}
+
+- (WKPageRef)pageRef
+{
+    return toAPI(_data->_page.get());
+}
+
+- (BOOL)canChangeFrameLayout:(WKFrameRef)frameRef
+{
+    // PDF documents are already paginated, so we can't change them to add headers and footers.
+    return !toImpl(frameRef)->isMainFrame() || !_data->_pdfViewController;
+}
+
+- (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(WKFrameRef)frameRef
+{
+    LOG(View, "Creating an NSPrintOperation for frame '%s'", toImpl(frameRef)->url().utf8().data());
+
+    // Only the top frame can currently contain a PDF view.
+    if (_data->_pdfViewController) {
+        if (!toImpl(frameRef)->isMainFrame())
+            return 0;
+        return _data->_pdfViewController->makePrintOperation(printInfo);
+    } else {
+        RetainPtr<WKPrintingView> printingView(AdoptNS, [[WKPrintingView alloc] initWithFrameProxy:toImpl(frameRef) view:self]);
+        // NSPrintOperation takes ownership of the view.
+        NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:printingView.get()];
+        [printOperation setCanSpawnSeparateThread:YES];
+        [printOperation setJobTitle:toImpl(frameRef)->title()];
+        printingView->_printOperation = printOperation;
+        return printOperation;
+    }
+}
+
+- (void)setFrame:(NSRect)rect andScrollBy:(NSSize)offset
+{
+    ASSERT(NSEqualSizes(_data->_resizeScrollOffset, NSZeroSize));
+
+    _data->_resizeScrollOffset = offset;
+    [self setFrame:rect];
+}
+
 - (void)disableFrameSizeUpdates
 {
     _data->_frameSizeUpdatesDisabledCount++;

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h (97818 => 97819)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h	2011-10-19 00:40:30 UTC (rev 97819)
@@ -23,8 +23,22 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#import <WebKit2/WKView.h>
+
 @interface WKView (Private)
 
+/* C SPI support. */
+
+@property(readonly) WKPageRef pageRef;
+
+- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef;
+- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef;
+
+- (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(WKFrameRef)frameRef;
+- (BOOL)canChangeFrameLayout:(WKFrameRef)frameRef;
+
+- (void)setFrame:(NSRect)rect andScrollBy:(NSSize)offset;
+
 // Stops updating the size of the page as the WKView frame size updates.
 // This should always be followed by enableFrameSizeUpdates. Calls can be nested.
 - (void)disableFrameSizeUpdates;

Modified: trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm (97818 => 97819)


--- trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm	2011-10-19 00:40:30 UTC (rev 97819)
@@ -32,6 +32,7 @@
 #import "LayerTreeContext.h"
 #import "WKAPICast.h"
 #import "WKViewInternal.h"
+#import "WKViewPrivate.h"
 #import "WebFullScreenManagerProxy.h"
 #import "WebPageProxy.h"
 #import <Carbon/Carbon.h> // For SetSystemUIMode()

Modified: trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm (97818 => 97819)


--- trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Source/WebKit2/UIProcess/mac/WebInspectorProxyMac.mm	2011-10-19 00:40:30 UTC (rev 97819)
@@ -30,7 +30,7 @@
 
 #import "WKAPICast.h"
 #import "WKInspectorMac.h"
-#import "WKView.h"
+#import "WKViewPrivate.h"
 #import "WebPageProxy.h"
 #import "WebProcessProxy.h"
 #import <WebKitSystemInterface.h>

Modified: trunk/Tools/ChangeLog (97818 => 97819)


--- trunk/Tools/ChangeLog	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Tools/ChangeLog	2011-10-19 00:40:30 UTC (rev 97819)
@@ -1,3 +1,18 @@
+2011-10-18  Sam Weinig  <[email protected]>
+
+        Move uses of C-SPI out of WKView.h and into WKViewPrivate.h
+        https://bugs.webkit.org/show_bug.cgi?id=70387
+
+        Reviewed by Dan Bernstein.
+
+        * MiniBrowser/mac/BrowserWindowController.m:
+        * TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm:
+        * TestWebKitAPI/mac/_javascript_TestMac.mm:
+        * TestWebKitAPI/mac/PlatformWebViewMac.mm:
+        * TestWebKitAPI/mac/WebKitAgnosticTest.mm:
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        Update to include WKViewPrivate.h where necessary.
+
 2011-10-18  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Some localizedStrings.js Updates

Modified: trunk/Tools/MiniBrowser/mac/BrowserWindowController.m (97818 => 97819)


--- trunk/Tools/MiniBrowser/mac/BrowserWindowController.m	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Tools/MiniBrowser/mac/BrowserWindowController.m	2011-10-19 00:40:30 UTC (rev 97819)
@@ -28,6 +28,7 @@
 #import <WebKit2/WKPagePrivate.h>
 #import <WebKit2/WKStringCF.h>
 #import <WebKit2/WKURLCF.h>
+#import <WebKit2/WKViewPrivate.h>
 
 @interface BrowserWindowController ()
 - (void)didStartProgress;

Modified: trunk/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm (97818 => 97819)


--- trunk/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm	2011-10-19 00:40:30 UTC (rev 97819)
@@ -29,6 +29,7 @@
 #include "_javascript_Test.h"
 #include "PlatformUtilities.h"
 #include "SyntheticBackingScaleFactorWindow.h"
+#include <WebKit2/WKViewPrivate.h>
 #include <wtf/RetainPtr.h>
 
 namespace TestWebKitAPI {

Modified: trunk/Tools/TestWebKitAPI/mac/_javascript_TestMac.mm (97818 => 97819)


--- trunk/Tools/TestWebKitAPI/mac/_javascript_TestMac.mm	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Tools/TestWebKitAPI/mac/_javascript_TestMac.mm	2011-10-19 00:40:30 UTC (rev 97819)
@@ -27,6 +27,7 @@
 #include "_javascript_Test.h"
 
 #include <WebKit/WebView.h>
+#include <WebKit2/WKViewPrivate.h>
 
 namespace TestWebKitAPI {
 

Modified: trunk/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm (97818 => 97819)


--- trunk/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Tools/TestWebKitAPI/mac/PlatformWebViewMac.mm	2011-10-19 00:40:30 UTC (rev 97819)
@@ -26,6 +26,7 @@
 #import "config.h"
 #import "PlatformWebView.h"
 
+#import <WebKit2/WKViewPrivate.h>
 #import <Carbon/Carbon.h>
 
 namespace TestWebKitAPI {

Modified: trunk/Tools/TestWebKitAPI/mac/WebKitAgnosticTest.mm (97818 => 97819)


--- trunk/Tools/TestWebKitAPI/mac/WebKitAgnosticTest.mm	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Tools/TestWebKitAPI/mac/WebKitAgnosticTest.mm	2011-10-19 00:40:30 UTC (rev 97819)
@@ -27,6 +27,7 @@
 #include "WebKitAgnosticTest.h"
 
 #include <WebKit2/WKURLCF.h>
+#include <WebKit2/WKViewPrivate.h>
 #include <wtf/RetainPtr.h>
 
 @interface FrameLoadDelegate : NSObject {

Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (97818 => 97819)


--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2011-10-19 00:15:30 UTC (rev 97818)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2011-10-19 00:40:30 UTC (rev 97819)
@@ -27,6 +27,7 @@
 #include "PlatformWebView.h"
 
 #import <WebKit2/WKImageCG.h>
+#import <WebKit2/WKViewPrivate.h>
 #import <wtf/RetainPtr.h>
 
 @interface WebKitTestRunnerWindow : NSWindow {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to