Changeset 164010 in webkit


Ignore:
Timestamp:
Feb 12, 2014 8:43:24 PM (10 years ago)
Author:
andersca@apple.com
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::]):

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r164004 r164010  
     12014-02-12  Anders Carlsson  <andersca@apple.com>
     2
     3        Pass the related page in the WebPageConfiguration struct
     4        https://bugs.webkit.org/show_bug.cgi?id=128714
     5
     6        Reviewed by Darin Adler.
     7
     8        * UIProcess/API/Cocoa/WKWebView.mm:
     9        (-[WKWebView initWithFrame:configuration:]):
     10        * UIProcess/API/ios/WKContentView.h:
     11        * UIProcess/API/ios/WKContentView.mm:
     12        (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::]):
     13
    1142014-02-12  Anders Carlsson  <andersca@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r164004 r164010  
    105105    CGRect bounds = self.bounds;
    106106
     107    WebKit::WebContext& context = *[_configuration processClass]->_context;
     108
     109    WebKit::WebPageConfiguration webPageConfiguration;
     110    webPageConfiguration.preferences = [_configuration preferences]->_preferences.get();
     111    if (WKWebView *relatedWebView = [_configuration _relatedWebView])
     112        webPageConfiguration.relatedPage = relatedWebView->_page.get();
     113
    107114#if PLATFORM(IOS)
    108115    _scrollView = adoptNS([[WKScrollView alloc] initWithFrame:bounds]);
     
    112119    [self addSubview:_scrollView.get()];
    113120
    114     _contentView = adoptNS([[WKContentView alloc] initWithFrame:bounds configuration:_configuration.get()]);
     121    _contentView = adoptNS([[WKContentView alloc] initWithFrame:bounds context:context configuration:std::move(webPageConfiguration)]);
    115122    _page = _contentView->_page;
    116123    [_contentView setDelegate:self];
     
    123130
    124131#if PLATFORM(MAC) && !PLATFORM(IOS)
    125     WebKit::WebPageConfiguration webPageConfiguration;
    126     webPageConfiguration.preferences = [_configuration preferences]->_preferences.get();
    127 
    128     _wkView = [[WKView alloc] initWithFrame:bounds context:*[_configuration.get() processClass]->_context configuration:std::move(webPageConfiguration)];
     132    _wkView = [[WKView alloc] initWithFrame:bounds context:context configuration:std::move(webPageConfiguration)];
    129133    [self addSubview:_wkView.get()];
    130134    _page = WebKit::toImpl([_wkView pageRef]);
  • trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.h

    r163666 r164010  
    3636namespace WebKit {
    3737class RemoteLayerTreeTransaction;
     38class WebContext;
     39struct WebPageConfiguration;
    3840}
    3941
     
    5658@property (readonly) WKPageRef _pageRef;
    5759
    58 - (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration;
     60- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration;
    5961
    6062- (id)initWithFrame:(CGRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef;
  • trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm

    r163836 r164010  
    9696}
    9797
    98 - (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration
     98- (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration
    9999{
    100100    if (!(self = [super initWithFrame:frame]))
     
    105105    _pageClient = std::make_unique<PageClientImpl>(self);
    106106
    107     WebPageConfiguration webPageConfiguration;
    108     webPageConfiguration.preferences = configuration.preferences->_preferences.get();
    109 
    110     _page = configuration.processClass->_context->createWebPage(*_pageClient, std::move(webPageConfiguration));
     107    _page = context.createWebPage(*_pageClient, std::move(webPageConfiguration));
    111108    _page->initializeWebPage();
    112109    _page->setIntrinsicDeviceScaleFactor([UIScreen mainScreen].scale);
Note: See TracChangeset for help on using the changeset viewer.