Consolidate ArgumentCodersMac and ArgumentCodersCocoa.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 21:18:34 +0000 (21:18 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 21:18:34 +0000 (21:18 +0000)
commitcbdcee737e15d9b06aba648a9cebd32deb15a457
tree814d4cfcdcabe64e4c491e15f8ef9f7456a0200b
parentb290cb73301a700cabc3a5e857366bca620fb8ba
Consolidate ArgumentCodersMac and ArgumentCodersCocoa.
https://bugs.webkit.org/show_bug.cgi?id=195636
rdar://problem/45055697

Reviewed by Ryosuke Niwa.

Source/WebCore:

* editing/DictionaryPopupInfo.h:
(WebCore::DictionaryPopupInfo::encodingRequiresPlatformData const): Added.
* editing/FontAttributes.h:
(WebCore::FontAttributes::encodingRequiresPlatformData const): Added.

Source/WebKit:

Merge the two similar encoders and decoders. This avoids issues where
one encoder could be used and the other decoder, which caused a crash.
It also stops handling NSAttributedString specifically and just uses
the NSSecureCoding path to handle more complex attributes.

Some WebCore encoders code needed to move to platform files, since
ArgumentCodersCocoa.h requires an ObjectiveC++ implementation to work.

* Shared/Cocoa/ArgumentCodersCocoa.h:
(IPC::encode):
(IPC::decode):
(IPC::ArgumentCoder<RetainPtr<T>>::encode):
(IPC::ArgumentCoder<RetainPtr<T>>::decode):
* Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::typeFromObject):
(IPC::isSerializableFont):
(IPC::isSerializableValue):
(IPC::encodeObject):
(IPC::decodeObject):
* Shared/Cocoa/LoadParametersCocoa.mm:
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::DictionaryPopupInfo>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::DictionaryPopupInfo>::decodePlatformData):
(IPC::ArgumentCoder<WebCore::FontAttributes>::encodePlatformData):
(IPC::ArgumentCoder<WebCore::FontAttributes>::decodePlatformData):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DictionaryPopupInfo>::encode):
(IPC::ArgumentCoder<DictionaryPopupInfo>::decode):
(IPC::ArgumentCoder<FontAttributes>::encode):
(IPC::ArgumentCoder<FontAttributes>::decode):
* Shared/WebCoreArgumentCoders.h:
* Shared/mac/ArgumentCodersMac.h: Removed.
* Shared/mac/ArgumentCodersMac.mm: Removed.
* Shared/mac/AttributedString.mm:
(WebKit::AttributedString::encode const):
* Shared/mac/ObjCObjectGraph.mm:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/editing/DictionaryPopupInfo.h
Source/WebCore/editing/FontAttributes.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h
Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm
Source/WebKit/Shared/Cocoa/LoadParametersCocoa.mm
Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.h
Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp
Source/WebKit/Shared/mac/ArgumentCodersMac.h [deleted file]
Source/WebKit/Shared/mac/ArgumentCodersMac.mm [deleted file]
Source/WebKit/Shared/mac/AttributedString.mm
Source/WebKit/Shared/mac/ObjCObjectGraph.mm
Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp
Source/WebKit/SourcesCocoa.txt
Source/WebKit/WebKit.xcodeproj/project.pbxproj