Title: [163564] trunk/Source/WebKit2
Revision
163564
Author
[email protected]
Date
2014-02-06 14:40:26 -0800 (Thu, 06 Feb 2014)

Log Message

Add a remoteObjectRegistry property to WKWebView
https://bugs.webkit.org/show_bug.cgi?id=128331

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView resizeSubviewsWithOldSize:]):
(-[WKWebView _remoteObjectRegistry]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (163563 => 163564)


--- trunk/Source/WebKit2/ChangeLog	2014-02-06 22:04:33 UTC (rev 163563)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-06 22:40:26 UTC (rev 163564)
@@ -1,5 +1,18 @@
 2014-02-06  Anders Carlsson  <[email protected]>
 
+        Add a remoteObjectRegistry property to WKWebView
+        https://bugs.webkit.org/show_bug.cgi?id=128331
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView resizeSubviewsWithOldSize:]):
+        (-[WKWebView _remoteObjectRegistry]):
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+
+2014-02-06  Anders Carlsson  <[email protected]>
+
         Add WKNavigationResponse class
         https://bugs.webkit.org/show_bug.cgi?id=128326
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (163563 => 163564)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-02-06 22:04:33 UTC (rev 163563)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-02-06 22:40:26 UTC (rev 163564)
@@ -33,6 +33,7 @@
 #import "WKNavigationDelegate.h"
 #import "WKNavigationInternal.h"
 #import "WKProcessClass.h"
+#import "WKRemoteObjectRegistryInternal.h"
 #import "WKWebViewConfiguration.h"
 #import "WebBackForwardList.h"
 #import "WebPageProxy.h"
@@ -51,6 +52,8 @@
     RetainPtr<WKWebViewConfiguration> _configuration;
     std::unique_ptr<WebKit::NavigationState> _navigationState;
 
+    RetainPtr<WKRemoteObjectRegistry> _remoteObjectRegistry;
+
 #if PLATFORM(IOS)
     RetainPtr<WKScrollView> _scrollView;
     RetainPtr<WKContentView> _contentView;
@@ -111,6 +114,13 @@
     return self;
 }
 
+- (void)dealloc
+{
+    [_remoteObjectRegistry _invalidate];
+
+    [super dealloc];
+}
+
 - (WKWebViewConfiguration *)configuration
 {
     return [[_configuration copy] autorelease];
@@ -308,8 +318,35 @@
     [_scrollView setContentOffset:contentOffset];
 }
 
-#pragma mark Private API
+#pragma mark OS X-specific methods
 
+#if PLATFORM(MAC) && !PLATFORM(IOS)
+
+- (void)resizeSubviewsWithOldSize:(NSSize)oldSize
+{
+    [_wkView setFrame:self.bounds];
+}
+
+#endif
+
+@end
+
+@implementation WKWebView (WKPrivate)
+
+- (WKRemoteObjectRegistry *)_remoteObjectRegistry
+{
+    if (!_remoteObjectRegistry) {
+        _remoteObjectRegistry = adoptNS([[WKRemoteObjectRegistry alloc] _initWithMessageSender:*_page]0;
+        _page->process().context().addMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID(), [_remoteObjectRegistry remoteObjectRegistry]);
+    }
+
+    return _remoteObjectRegistry.get();
+}
+
+#pragma mark iOS-specific methods
+
+#if PLATFORM(IOS)
+
 - (CGSize)_minimumLayoutSizeOverride
 {
     ASSERT(_hasStaticMinimumLayoutSize);
@@ -325,15 +362,6 @@
 
 #endif
 
-#pragma mark OS X-specific methods
-
-#if PLATFORM(MAC) && !PLATFORM(IOS)
-
-- (void)resizeSubviewsWithOldSize:(NSSize)oldSize
-{
-    [_wkView setFrame:self.bounds];
-}
-
 #endif
 
 @end

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (163563 => 163564)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2014-02-06 22:04:33 UTC (rev 163563)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2014-02-06 22:40:26 UTC (rev 163564)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WKWebView.h"
+#import "WKWebViewPrivate.h"
 
 #if WK_API_ENABLED
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (163563 => 163564)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2014-02-06 22:04:33 UTC (rev 163563)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2014-02-06 22:40:26 UTC (rev 163564)
@@ -27,8 +27,12 @@
 
 #if WK_API_ENABLED
 
+@class WKRemoteObjectRegistry;
+
 @interface WKWebView (WKPrivate)
 
+@property (nonatomic, readonly) WKRemoteObjectRegistry *_remoteObjectRegistry;
+
 #if TARGET_OS_IPHONE
 @property (nonatomic, setter=_setMinimumLayoutSizeOverride) CGSize _minimumLayoutSizeOverride;
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to