Skip to content

Commit

Permalink
Remove or disconnect some unused calls to ObjCObjectGraph::create
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=273879
rdar://127743562

Reviewed by Brady Eidson.

The last use of WKConnection was removed in rdar://127167483.
This PR removes or disconnects the non-WKConnection uses of ObjCObjectGraph,
all of which are unused and have been for over a year.

_loadData SPI with userData is still used by Mail, but they only pass in an
NSData, so they don't need the full power of ObjCObjectGraph.  API::Data will do.

* Source/WebKit/Shared/API/c/mac/WKObjCTypeWrapperRef.h:
* Source/WebKit/Shared/API/c/mac/WKObjCTypeWrapperRef.mm:
(WKObjCTypeWrapperCreate): Deleted.
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/ios/WKContentView.h:
* Source/WebKit/UIProcess/ios/WKContentView.mm:
(-[WKContentView browsingContextController]): Deleted.
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::browsingContextController): Deleted.

Canonical link: https://commits.webkit.org/278564@main
  • Loading branch information
achristensen07 committed May 9, 2024
1 parent d045dbe commit 701919e
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 46 deletions.
1 change: 0 additions & 1 deletion Source/WebKit/Shared/API/c/mac/WKObjCTypeWrapperRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ extern "C" {

WK_EXPORT WKTypeID WKObjCTypeWrapperGetTypeID();

WK_EXPORT WKObjCTypeWrapperRef WKObjCTypeWrapperCreate(id object);
WK_EXPORT id WKObjCTypeWrapperGetObject(WKObjCTypeWrapperRef wrapper);

#ifdef __cplusplus
Expand Down
6 changes: 0 additions & 6 deletions Source/WebKit/Shared/API/c/mac/WKObjCTypeWrapperRef.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ WKTypeID WKObjCTypeWrapperGetTypeID()
return WebKit::toAPI(WebKit::ObjCObjectGraph::APIType);
}

WKObjCTypeWrapperRef WKObjCTypeWrapperCreate(id object)
{
auto objectWrapper = WebKit::ObjCObjectGraph::create(object);
return WebKit::toAPI(&objectWrapper.leakRef());
}

id WKObjCTypeWrapperGetObject(WKObjCTypeWrapperRef wrapperRef)
{
return WebKit::toImpl(wrapperRef)->rootObject();
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2873,7 +2873,7 @@ - (void)_loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL for
- (WKNavigation *)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType characterEncodingName:(NSString *)characterEncodingName baseURL:(NSURL *)baseURL userData:(id)userData
{
THROW_IF_SUSPENDED;
return wrapper(_page->loadData(span(data), MIMEType, characterEncodingName, baseURL.absoluteString, WebKit::ObjCObjectGraph::create(userData).ptr())).autorelease();
return wrapper(_page->loadData(span(data), MIMEType, characterEncodingName, baseURL.absoluteString, [userData isKindOfClass:NSData.class] ? API::Data::createWithoutCopying((NSData *)userData).ptr() : nullptr)).autorelease();
}

- (WKNavigation *)_loadRequest:(NSURLRequest *)request shouldOpenExternalURLs:(BOOL)shouldOpenExternalURLs
Expand Down
7 changes: 0 additions & 7 deletions Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,6 @@ - (BOOL)_isBackground
return [_contentView isBackground];
}

ALLOW_DEPRECATED_DECLARATIONS_BEGIN
- (WKBrowsingContextController *)browsingContextController
{
return [_contentView browsingContextController];
}
ALLOW_DEPRECATED_DECLARATIONS_END

- (BOOL)becomeFirstResponder
{
#if PLATFORM(VISION)
Expand Down
4 changes: 0 additions & 4 deletions Source/WebKit/UIProcess/ios/WKContentView.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ enum class ViewStabilityFlag : uint8_t;
WeakObjCPtr<WKWebView> _webView;
}

ALLOW_DEPRECATED_DECLARATIONS_BEGIN
@property (nonatomic, readonly) WKBrowsingContextController *browsingContextController;
ALLOW_DEPRECATED_DECLARATIONS_END

@property (nonatomic, readonly) WebKit::WebPageProxy* page;
@property (nonatomic, readonly) BOOL isFocusingElement;
@property (nonatomic, getter=isShowingInspectorIndication) BOOL showingInspectorIndication;
Expand Down
13 changes: 0 additions & 13 deletions Source/WebKit/UIProcess/ios/WKContentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ - (void)redo

@implementation WKContentView {
std::unique_ptr<WebKit::PageClientImpl> _pageClient;
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
RetainPtr<WKBrowsingContextController> _browsingContextController;
ALLOW_DEPRECATED_DECLARATIONS_END

RetainPtr<UIView> _rootContentView;
RetainPtr<UIView> _fixedClippingView;
Expand Down Expand Up @@ -541,16 +538,6 @@ - (void)didMoveToWindow
[self cleanUpInteractionPreviewContainers];
}

ALLOW_DEPRECATED_DECLARATIONS_BEGIN
- (WKBrowsingContextController *)browsingContextController
{
if (!_browsingContextController)
_browsingContextController = adoptNS([[WKBrowsingContextController alloc] _initWithPageRef:toAPI(_page.get())]);

return _browsingContextController.get();
}
ALLOW_DEPRECATED_DECLARATIONS_END

- (WKPageRef)_pageRef
{
return toAPI(_page.get());
Expand Down
4 changes: 0 additions & 4 deletions Source/WebKit/UIProcess/mac/WebViewImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,6 @@ class WebViewImpl final : public CanMakeWeakPtr<WebViewImpl>, public CanMakeChec

_WKRemoteObjectRegistry *remoteObjectRegistry();

ALLOW_DEPRECATED_DECLARATIONS_BEGIN
WKBrowsingContextController *browsingContextController();
ALLOW_DEPRECATED_DECLARATIONS_END

#if ENABLE(DRAG_SUPPORT)
void draggedImage(NSImage *, CGPoint endPoint, NSDragOperation);
NSDragOperation draggingEntered(id <NSDraggingInfo>);
Expand Down
10 changes: 0 additions & 10 deletions Source/WebKit/UIProcess/mac/WebViewImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3913,16 +3913,6 @@ static String commandNameForSelector(SEL selector)
return m_remoteObjectRegistry.get();
}

ALLOW_DEPRECATED_DECLARATIONS_BEGIN
WKBrowsingContextController *WebViewImpl::browsingContextController()
{
if (!m_browsingContextController)
m_browsingContextController = adoptNS([[WKBrowsingContextController alloc] _initWithPageRef:toAPI(m_page.ptr())]);

return m_browsingContextController.get();
}
ALLOW_DEPRECATED_DECLARATIONS_END

#if ENABLE(DRAG_SUPPORT)
void WebViewImpl::draggedImage(NSImage *, CGPoint endPoint, NSDragOperation operation)
{
Expand Down

0 comments on commit 701919e

Please sign in to comment.