Title: [164010] trunk/Source/WebKit2
Revision
164010
Author
[email protected]
Date
2014-02-12 20:43:24 -0800 (Wed, 12 Feb 2014)

Log Message

Pass the related page in the WebPageConfiguration struct
https://bugs.webkit.org/show_bug.cgi?id=128714

Reviewed by Darin Adler.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/API/ios/WKContentView.h:
* UIProcess/API/ios/WKContentView.mm:
(-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (164009 => 164010)


--- trunk/Source/WebKit2/ChangeLog	2014-02-13 04:24:41 UTC (rev 164009)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-13 04:43:24 UTC (rev 164010)
@@ -1,5 +1,18 @@
 2014-02-12  Anders Carlsson  <[email protected]>
 
+        Pass the related page in the WebPageConfiguration struct
+        https://bugs.webkit.org/show_bug.cgi?id=128714
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView initWithFrame:configuration:]):
+        * UIProcess/API/ios/WKContentView.h:
+        * UIProcess/API/ios/WKContentView.mm:
+        (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::]):
+
+2014-02-12  Anders Carlsson  <[email protected]>
+
         Add relatedWebView property to WKWebViewConfiguration
         https://bugs.webkit.org/show_bug.cgi?id=128707
 

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


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-02-13 04:24:41 UTC (rev 164009)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-02-13 04:43:24 UTC (rev 164010)
@@ -104,6 +104,13 @@
 
     CGRect bounds = self.bounds;
 
+    WebKit::WebContext& context = *[_configuration processClass]->_context;
+
+    WebKit::WebPageConfiguration webPageConfiguration;
+    webPageConfiguration.preferences = [_configuration preferences]->_preferences.get();
+    if (WKWebView *relatedWebView = [_configuration _relatedWebView])
+        webPageConfiguration.relatedPage = relatedWebView->_page.get();
+
 #if PLATFORM(IOS)
     _scrollView = adoptNS([[WKScrollView alloc] initWithFrame:bounds]);
     [_scrollView setInternalDelegate:self];
@@ -111,7 +118,7 @@
 
     [self addSubview:_scrollView.get()];
 
-    _contentView = adoptNS([[WKContentView alloc] initWithFrame:bounds configuration:_configuration.get()]);
+    _contentView = adoptNS([[WKContentView alloc] initWithFrame:bounds context:context configuration:std::move(webPageConfiguration)]);
     _page = _contentView->_page;
     [_contentView setDelegate:self];
     [_contentView layer].anchorPoint = CGPointZero;
@@ -122,10 +129,7 @@
 #endif
 
 #if PLATFORM(MAC) && !PLATFORM(IOS)
-    WebKit::WebPageConfiguration webPageConfiguration;
-    webPageConfiguration.preferences = [_configuration preferences]->_preferences.get();
-
-    _wkView = [[WKView alloc] initWithFrame:bounds context:*[_configuration.get() processClass]->_context configuration:std::move(webPageConfiguration)];
+    _wkView = [[WKView alloc] initWithFrame:bounds context:context configuration:std::move(webPageConfiguration)];
     [self addSubview:_wkView.get()];
     _page = WebKit::toImpl([_wkView pageRef]);
 #endif

Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.h (164009 => 164010)


--- trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.h	2014-02-13 04:24:41 UTC (rev 164009)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.h	2014-02-13 04:43:24 UTC (rev 164010)
@@ -35,6 +35,8 @@
 
 namespace WebKit {
 class RemoteLayerTreeTransaction;
+class WebContext;
+struct WebPageConfiguration;
 }
 
 @protocol WKContentViewDelegate <NSObject>
@@ -55,7 +57,7 @@
 
 @property (readonly) WKPageRef _pageRef;
 
-- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration;
+- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration;
 
 - (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef;
 - (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage;

Modified: trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm (164009 => 164010)


--- trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm	2014-02-13 04:24:41 UTC (rev 164009)
+++ trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm	2014-02-13 04:43:24 UTC (rev 164010)
@@ -95,7 +95,7 @@
     return self;
 }
 
-- (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration
+- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration
 {
     if (!(self = [super initWithFrame:frame]))
         return nil;
@@ -104,10 +104,7 @@
 
     _pageClient = std::make_unique<PageClientImpl>(self);
 
-    WebPageConfiguration webPageConfiguration;
-    webPageConfiguration.preferences = configuration.preferences->_preferences.get();
-
-    _page = configuration.processClass->_context->createWebPage(*_pageClient, std::move(webPageConfiguration));
+    _page = context.createWebPage(*_pageClient, std::move(webPageConfiguration));
     _page->initializeWebPage();
     _page->setIntrinsicDeviceScaleFactor([UIScreen mainScreen].scale);
     _page->setUseFixedLayout(true);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to