Skip to content
Permalink
Browse files
[Cocoa] Make WKBrowsingContextController work with WKObject wrapping
https://bugs.webkit.org/show_bug.cgi?id=125022

Reviewed by Dan Bernstein.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):

* Shared/mac/ObjCObjectGraphCoders.mm:
Add support for WKProcessGroup.

(WebKit::WebContextObjCObjectGraphDecoderImpl::decode):
Replace call to _browsingContextControllerForPageRef: with wrapper.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
Convert from wrapping the C-SPI type to storing the bits of the wrapped object inline.

(-[WKBrowsingContextController dealloc]):
Add explicit destructor call.

(-[WKBrowsingContextController setLoadDelegate:]):
(-[WKBrowsingContextController setPolicyDelegate:]):
Lazily set up the load and policy clients only once a delegate has been set to allow
continued use of the C-SPI clients for WebKitTestRunner.

(-[WKBrowsingContextController _finishInitialization]):
Move remaining work that was done in the initialize (setting up the observer) here,
and have the WebPageProxy call it.

* UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
(WebKit::wrapper):
Add wrapper() helper and declare conformance to the WKObject protocol. Remove no longer used
_initWithPageRef: and _browsingContextControllerForPageRef: helpers.

* UIProcess/API/Cocoa/WKProcessGroup.mm:
(didNavigateWithNavigationData):
(didPerformClientRedirect):
(didPerformServerRedirect):
(didUpdateHistoryTitle):
Switch to using wrapper().

* UIProcess/API/ios/WKContentView.mm:
* UIProcess/API/mac/WKView.mm:
Stop caching the WKBrowsingContextController, as it no long makes sense since it is the same object
as the WebPageProxy.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::platformInitialize):
Inform the wrapper that it is safe to finish initialization.


Canonical link: https://commits.webkit.org/143128@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
weinig committed Nov 30, 2013
1 parent 73aabde commit e767f42bd0a9e7314a96977bde63c09ef5739d4f
@@ -1,3 +1,55 @@
2013-11-29 Sam Weinig <sam@webkit.org>

[Cocoa] Make WKBrowsingContextController work with WKObject wrapping
https://bugs.webkit.org/show_bug.cgi?id=125022

Reviewed by Dan Bernstein.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):

* Shared/mac/ObjCObjectGraphCoders.mm:
Add support for WKProcessGroup.

(WebKit::WebContextObjCObjectGraphDecoderImpl::decode):
Replace call to _browsingContextControllerForPageRef: with wrapper.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
Convert from wrapping the C-SPI type to storing the bits of the wrapped object inline.

(-[WKBrowsingContextController dealloc]):
Add explicit destructor call.

(-[WKBrowsingContextController setLoadDelegate:]):
(-[WKBrowsingContextController setPolicyDelegate:]):
Lazily set up the load and policy clients only once a delegate has been set to allow
continued use of the C-SPI clients for WebKitTestRunner.

(-[WKBrowsingContextController _finishInitialization]):
Move remaining work that was done in the initialize (setting up the observer) here,
and have the WebPageProxy call it.

* UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
(WebKit::wrapper):
Add wrapper() helper and declare conformance to the WKObject protocol. Remove no longer used
_initWithPageRef: and _browsingContextControllerForPageRef: helpers.

* UIProcess/API/Cocoa/WKProcessGroup.mm:
(didNavigateWithNavigationData):
(didPerformClientRedirect):
(didPerformServerRedirect):
(didUpdateHistoryTitle):
Switch to using wrapper().

* UIProcess/API/ios/WKContentView.mm:
* UIProcess/API/mac/WKView.mm:
Stop caching the WKBrowsingContextController, as it no long makes sense since it is the same object
as the WebPageProxy.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::platformInitialize):
Inform the wrapper that it is safe to finish initialization.

2013-11-29 Dan Bernstein <mitz@apple.com>

[Cocoa] Add a way to recover from load errors
@@ -30,14 +30,15 @@

#import "WKBackForwardListInternal.h"
#import "WKBackForwardListItemInternal.h"
#import "WKBrowsingContextControllerInternal.h"
#import "WKBrowsingContextGroupInternal.h"
#import "WKProcessGroupInternal.h"
#import "WKNSArray.h"
#import "WKNSDictionary.h"
#import "WKNSError.h"
#import "WKNSString.h"
#import "WKNSURL.h"
#import "WKNavigationDataInternal.h"
#import "WKProcessGroupInternal.h"

namespace API {

@@ -88,6 +89,10 @@
wrapper = [WKNavigationData alloc];
break;

case Type::Page:
wrapper = [WKBrowsingContextController alloc];
break;

case Type::PageGroup:
wrapper = [WKBrowsingContextGroup alloc];
break;
@@ -32,7 +32,6 @@
// For UIProcess side encoding/decoding
#import "WKAPICast.h"
#import "WKBrowsingContextControllerInternal.h"
#import "WKBrowsingContextControllerPrivate.h"
#import "WebContextUserMessageCoders.h"
#import "WebPageProxy.h"
#import "WebProcessProxy.h"
@@ -343,7 +342,7 @@ static bool decode(CoreIPC::ArgumentDecoder& decoder, WebContextObjCObjectGraphD
if (!webPage)
coder.m_root = [NSNull null];
else
coder.m_root = [WKBrowsingContextController _browsingContextControllerForPageRef:toAPI(webPage)];
coder.m_root = wrapper(*webPage);
break;
}
case WKTypeRefWrapperType: {

0 comments on commit e767f42

Please sign in to comment.