Move WKEditCommandObjC and WKEditorUndoTargetObjC into a separate file
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Dec 2018 05:50:04 +0000 (05:50 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Dec 2018 05:50:04 +0000 (05:50 +0000)
commit48952d758f3cca9446042da4e2eadb22cea531bb
tree951912df45153445ad1d4fb761658f484a023413
parent6a7f8f593e0a17526337053246cca8fdd4239880
Move WKEditCommandObjC and WKEditorUndoTargetObjC into a separate file
https://bugs.webkit.org/show_bug.cgi?id=193049

Reviewed by Sam Weinig.

Pull common code (WKEditCommandObjC and WKEditorUndoTargetObjC) on iOS and macOS out into a separate file. No
change in behavior.

* SourcesCocoa.txt:
* UIProcess/Cocoa/WKEditCommand.h: Added.
* UIProcess/Cocoa/WKEditCommand.mm: Added.

Rename WKEditCommandObjC to WKEditCommand, and WKEditorUndoTargetObjC to WKEditorUndoTarget. The ObjC suffix in
the name seems to diverge from the common naming scheme in other parts of WebKit, where most WK- and _WK-
prefixed names already refer to Objective-C objects. Additionally, mark -[WKEditCommand init] as unavailable.

(-[WKEditCommand initWithWebEditCommandProxy:]):

Make the return type instancetype instead of id, and also make this take a Ref<WebEditCommandProxy>&& instead
of a RefPtr.

(-[WKEditCommand command]):

Make this return a reference to the WebEditCommandProxy, rather than a pointer, since the WebEditCommandProxy
should always be non-null.

(-[WKEditorUndoTarget undoEditing:]):
(-[WKEditorUndoTarget redoEditing:]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::registerEditCommand):

Use WTFMove instead of copying the Ref when creating a WKEditCommand.

(-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
(-[WKEditCommandObjC command]): Deleted.
(-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
(-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::PageClientImpl):
(WebKit::PageClientImpl::registerEditCommand):

Use WTFMove instead of creating a new RefPtr when creating a WKEditCommand.

(-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted.
(-[WKEditCommandObjC command]): Deleted.
(-[WKEditorUndoTargetObjC undoEditing:]): Deleted.
(-[WKEditorUndoTargetObjC redoEditing:]): Deleted.
* UIProcess/mac/PageClientImplMac.h:
* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/SourcesCocoa.txt
Source/WebKit/UIProcess/Cocoa/WKEditCommand.h [new file with mode: 0644]
Source/WebKit/UIProcess/Cocoa/WKEditCommand.mm [new file with mode: 0644]
Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/ios/PageClientImplIOS.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit/UIProcess/mac/PageClientImplMac.h
Source/WebKit/WebKit.xcodeproj/project.pbxproj