Changeset 163564 in webkit


Ignore:
Timestamp:
Feb 6, 2014 2:40:26 PM (10 years ago)
Author:
andersca@apple.com
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:
Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r163563 r163564  
     12014-02-06  Anders Carlsson  <andersca@apple.com>
     2
     3        Add a remoteObjectRegistry property to WKWebView
     4        https://bugs.webkit.org/show_bug.cgi?id=128331
     5
     6        Reviewed by Tim Horton.
     7
     8        * UIProcess/API/Cocoa/WKWebView.mm:
     9        (-[WKWebView resizeSubviewsWithOldSize:]):
     10        (-[WKWebView _remoteObjectRegistry]):
     11        * UIProcess/API/Cocoa/WKWebViewInternal.h:
     12        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
     13
    1142014-02-06  Anders Carlsson  <andersca@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r163554 r163564  
    3434#import "WKNavigationInternal.h"
    3535#import "WKProcessClass.h"
     36#import "WKRemoteObjectRegistryInternal.h"
    3637#import "WKWebViewConfiguration.h"
    3738#import "WebBackForwardList.h"
     
    5152    RetainPtr<WKWebViewConfiguration> _configuration;
    5253    std::unique_ptr<WebKit::NavigationState> _navigationState;
     54
     55    RetainPtr<WKRemoteObjectRegistry> _remoteObjectRegistry;
    5356
    5457#if PLATFORM(IOS)
     
    112115}
    113116
     117- (void)dealloc
     118{
     119    [_remoteObjectRegistry _invalidate];
     120
     121    [super dealloc];
     122}
     123
    114124- (WKWebViewConfiguration *)configuration
    115125{
     
    309319}
    310320
    311 #pragma mark Private API
     321#pragma mark OS X-specific methods
     322
     323#if PLATFORM(MAC) && !PLATFORM(IOS)
     324
     325- (void)resizeSubviewsWithOldSize:(NSSize)oldSize
     326{
     327    [_wkView setFrame:self.bounds];
     328}
     329
     330#endif
     331
     332@end
     333
     334@implementation WKWebView (WKPrivate)
     335
     336- (WKRemoteObjectRegistry *)_remoteObjectRegistry
     337{
     338    if (!_remoteObjectRegistry) {
     339        _remoteObjectRegistry = adoptNS([[WKRemoteObjectRegistry alloc] _initWithMessageSender:*_page]0;
     340        _page->process().context().addMessageReceiver(Messages::RemoteObjectRegistry::messageReceiverName(), _page->pageID(), [_remoteObjectRegistry remoteObjectRegistry]);
     341    }
     342
     343    return _remoteObjectRegistry.get();
     344}
     345
     346#pragma mark iOS-specific methods
     347
     348#if PLATFORM(IOS)
    312349
    313350- (CGSize)_minimumLayoutSizeOverride
     
    326363#endif
    327364
    328 #pragma mark OS X-specific methods
    329 
    330 #if PLATFORM(MAC) && !PLATFORM(IOS)
    331 
    332 - (void)resizeSubviewsWithOldSize:(NSSize)oldSize
    333 {
    334     [_wkView setFrame:self.bounds];
    335 }
    336 
    337365#endif
    338366
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h

    r163515 r163564  
    2424 */
    2525
    26 #import "WKWebView.h"
     26#import "WKWebViewPrivate.h"
    2727
    2828#if WK_API_ENABLED
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h

    r163514 r163564  
    2828#if WK_API_ENABLED
    2929
     30@class WKRemoteObjectRegistry;
     31
    3032@interface WKWebView (WKPrivate)
     33
     34@property (nonatomic, readonly) WKRemoteObjectRegistry *_remoteObjectRegistry;
    3135
    3236#if TARGET_OS_IPHONE
Note: See TracChangeset for help on using the changeset viewer.