Changeset 225309 in webkit


Ignore:
Timestamp:
Nov 29, 2017 5:40:56 PM (6 years ago)
Author:
Brent Fulgham
Message:

Part 2: Adopt updated NSKeyed[Un]Archiver API when available
https://bugs.webkit.org/show_bug.cgi?id=180127
<rdar://problem/35710738>

Reviewed by Simon Fraser.

The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer)
to the modern API. Use the original API for macOS builds prior to 10.12.

Source/WebCore/PAL:

  • pal/spi/cocoa/NSKeyedArchiverSPI.h:

(secureArchiver): Added.
(secureArchiverFromMutableData): Deleted.

Source/WebKit:

  • Shared/Cocoa/DataDetectionResult.mm:

(WebKit::DataDetectionResult::encode const):

  • Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:

(IPC::ArgumentCoder<WebCore::Payment>::encode):
(IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
(IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
(IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):

  • Shared/ios/InteractionInformationAtPosition.mm:

(WebKit::InteractionInformationAtPosition::encode const):

  • Shared/mac/WebCoreArgumentCodersMac.mm:

(IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
(IPC::ArgumentCoder<Credential>::encodePlatformData):
(IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
(IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):

  • Shared/mac/WebHitTestResultData.mm:

(WebKit::WebHitTestResultData::platformEncode const):

  • UIProcess/API/Cocoa/WKProcessPool.mm:

(-[WKProcessPool _setObject:forBundleParameter:]):
(-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):

  • UIProcess/Cocoa/WebProcessPoolCocoa.mm:

(WebKit::WebProcessPool::platformInitializeWebProcess):

  • WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:

(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):

Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/PAL/ChangeLog

    r225290 r225309  
     12017-11-29  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Part 2: Adopt updated NSKeyed[Un]Archiver API when available
     4        https://bugs.webkit.org/show_bug.cgi?id=180127
     5        <rdar://problem/35710738>
     6
     7        Reviewed by Simon Fraser.
     8
     9        The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer)
     10        to the modern API. Use the original API for macOS builds prior to 10.12.
     11
     12        * pal/spi/cocoa/NSKeyedArchiverSPI.h:
     13        (secureArchiver): Added.
     14        (secureArchiverFromMutableData): Deleted.
     15
    1162017-11-29  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h

    r225264 r225309  
    105105}
    106106
    107 inline RetainPtr<NSKeyedArchiver> secureArchiverFromMutableData(NSMutableData *_Nonnull mutableData)
     107inline RetainPtr<NSKeyedArchiver> secureArchiver()
    108108{
    109     NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:mutableData];
     109#if USE(SECURE_ARCHIVER_API)
     110    NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initRequiringSecureCoding:YES];
     111#else
     112    NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] init];
    110113    [archiver setRequiresSecureCoding:YES];
     114#endif
    111115    return adoptNS(archiver);
    112116}
  • trunk/Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm

    r225264 r225309  
    7373        return nullptr;
    7474
     75#if USE(SECURE_ARCHIVER_API)
     76    auto archiver = secureArchiver();
     77    [archiver encodeObject:nsResponse forKey:LegacyWebArchiveResourceResponseKey];
     78    return retainPtr((__bridge CFDataRef)archiver.get().encodedData);
     79#else
     80    // Because of <rdar://problem/34063313> we can't use this for encoding in older OS's.
    7581    CFMutableDataRef responseData = CFDataCreateMutable(0, 0);
    76 
    7782    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:(NSMutableData *)responseData]);
    78 #if USE(SECURE_ARCHIVER_API)
    79     // Because of <rdar://problem/34063313> we can't use this for encoding in older OS's.
    80     [archiver setRequiresSecureCoding:YES];
    81 #endif
    8283    [archiver encodeObject:nsResponse forKey:LegacyWebArchiveResourceResponseKey];
    8384    [archiver finishEncoding];
    8485
    8586    return adoptCF(responseData);
     87#endif
    8688}
    8789
  • trunk/Source/WebKit/ChangeLog

    r225298 r225309  
     12017-11-29  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Part 2: Adopt updated NSKeyed[Un]Archiver API when available
     4        https://bugs.webkit.org/show_bug.cgi?id=180127
     5        <rdar://problem/35710738>
     6
     7        Reviewed by Simon Fraser.
     8
     9        The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer)
     10        to the modern API. Use the original API for macOS builds prior to 10.12.
     11
     12        * Shared/Cocoa/DataDetectionResult.mm:
     13        (WebKit::DataDetectionResult::encode const):
     14        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
     15        (IPC::ArgumentCoder<WebCore::Payment>::encode):
     16        (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
     17        (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
     18        (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
     19        * Shared/ios/InteractionInformationAtPosition.mm:
     20        (WebKit::InteractionInformationAtPosition::encode const):
     21        * Shared/mac/WebCoreArgumentCodersMac.mm:
     22        (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
     23        (IPC::ArgumentCoder<Credential>::encodePlatformData):
     24        (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
     25        (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
     26        * Shared/mac/WebHitTestResultData.mm:
     27        (WebKit::WebHitTestResultData::platformEncode const):
     28        * UIProcess/API/Cocoa/WKProcessPool.mm:
     29        (-[WKProcessPool _setObject:forBundleParameter:]):
     30        (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
     31        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
     32        (WebKit::WebProcessPool::platformInitializeWebProcess):
     33        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
     34        (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
     35
    1362017-11-29  Brady Eidson  <beidson@apple.com>
    237
  • trunk/Source/WebKit/Shared/Cocoa/DataDetectionResult.mm

    r225264 r225309  
    4242void DataDetectionResult::encode(IPC::Encoder& encoder) const
    4343{
    44     RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]);
    45     auto archiver = secureArchiverFromMutableData(data.get());
     44#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
     45    auto data = adoptNS([[NSMutableData alloc] init]);
     46    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     47    [archiver setRequiresSecureCoding:YES];
    4648    [archiver encodeObject:results.get() forKey:@"dataDetectorResults"];
    4749    [archiver finishEncoding];
    48    
    49     IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));       
     50
     51    IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
     52#else
     53    auto archiver = secureArchiver();
     54    [archiver encodeObject:results.get() forKey:@"dataDetectorResults"];
     55    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
     56#endif
    5057}
    5158
  • trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm

    r225264 r225309  
    5252void ArgumentCoder<WebCore::Payment>::encode(Encoder& encoder, const WebCore::Payment& payment)
    5353{
     54#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    5455    auto data = adoptNS([[NSMutableData alloc] init]);
    55     auto archiver = secureArchiverFromMutableData(data.get());
     56    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     57
     58    [archiver setRequiresSecureCoding:YES];
     59#else
     60    auto archiver = secureArchiver();
     61#endif
    5662
    5763    [archiver encodeObject:payment.pkPayment() forKey:NSKeyedArchiveRootObjectKey];
    5864    [archiver finishEncoding];
     65
     66#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
     67    auto data = archiver.get().encodedData;
     68#endif
    5969
    6070    encoder << DataReference(static_cast<const uint8_t*>([data bytes]), [data length]);
     
    104114void ArgumentCoder<WebCore::PaymentContact>::encode(Encoder& encoder, const WebCore::PaymentContact& paymentContact)
    105115{
     116#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    106117    auto data = adoptNS([[NSMutableData alloc] init]);
    107     auto archiver = secureArchiverFromMutableData(data.get());
     118    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     119
     120    [archiver setRequiresSecureCoding:YES];
     121#else
     122    auto archiver = secureArchiver();
     123#endif
    108124
    109125    [archiver encodeObject:paymentContact.pkContact() forKey:NSKeyedArchiveRootObjectKey];
    110126    [archiver finishEncoding];
     127
     128#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
     129    auto data = archiver.get().encodedData;
     130#endif
    111131
    112132    encoder << DataReference(static_cast<const uint8_t*>([data bytes]), [data length]);
     
    162182void ArgumentCoder<WebCore::PaymentMerchantSession>::encode(Encoder& encoder, const WebCore::PaymentMerchantSession& paymentMerchantSession)
    163183{
     184#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    164185    auto data = adoptNS([[NSMutableData alloc] init]);
    165     auto archiver = secureArchiverFromMutableData(data.get());
     186    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     187
     188    [archiver setRequiresSecureCoding:YES];
     189#else
     190    auto archiver = secureArchiver();
     191#endif
    166192
    167193    [archiver encodeObject:paymentMerchantSession.pkPaymentMerchantSession() forKey:NSKeyedArchiveRootObjectKey];
    168194    [archiver finishEncoding];
     195
     196#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
     197    auto data = archiver.get().encodedData;
     198#endif
    169199
    170200    encoder << DataReference(static_cast<const uint8_t*>([data bytes]), [data length]);
     
    193223void ArgumentCoder<WebCore::PaymentMethod>::encode(Encoder& encoder, const WebCore::PaymentMethod& paymentMethod)
    194224{
     225#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    195226    auto data = adoptNS([[NSMutableData alloc] init]);
    196     auto archiver = secureArchiverFromMutableData(data.get());
     227    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     228
     229    [archiver setRequiresSecureCoding:YES];
     230#else
     231    auto archiver = secureArchiver();
     232#endif
    197233
    198234    [archiver encodeObject:paymentMethod.pkPaymentMethod() forKey:NSKeyedArchiveRootObjectKey];
    199235    [archiver finishEncoding];
     236
     237#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
     238    auto data = archiver.get().encodedData;
     239#endif
    200240
    201241    encoder << DataReference(static_cast<const uint8_t*>([data bytes]), [data length]);
  • trunk/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm

    r225264 r225309  
    7474    if (isDataDetectorLink) {
    7575        encoder << dataDetectorIdentifier;
     76#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    7677        RetainPtr<NSMutableData> data = adoptNS([[NSMutableData alloc] init]);
    7778        auto archiver = secureArchiverFromMutableData(data.get());
     
    7980        [archiver finishEncoding];
    8081       
    81         IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));       
     82        IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
     83#else
     84        auto archiver = secureArchiver();
     85        [archiver encodeObject:dataDetectorResults.get() forKey:@"dataDetectorResults"];
     86
     87        IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
     88#endif
    8289    }
    8390#endif
  • trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm

    r225264 r225309  
    430430void ArgumentCoder<ProtectionSpace>::encodePlatformData(Encoder& encoder, const ProtectionSpace& space)
    431431{
     432#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    432433    auto data = adoptNS([[NSMutableData alloc] init]);
    433     auto archiver = secureArchiverFromMutableData(data.get());
     434    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     435    [archiver setRequiresSecureCoding:YES];
    434436    [archiver encodeObject:space.nsSpace() forKey:@"protectionSpace"];
    435437    [archiver finishEncoding];
    436438    IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
     439#else
     440    auto archiver = secureArchiver();
     441    [archiver encodeObject:space.nsSpace() forKey:@"protectionSpace"];
     442    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
     443#endif
    437444}
    438445
     
    475482
    476483    encoder << false;
     484
     485#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    477486    auto data = adoptNS([[NSMutableData alloc] init]);
    478     auto archiver = secureArchiverFromMutableData(data.get());
     487    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     488    [archiver setRequiresSecureCoding:YES];
    479489    [archiver encodeObject:nsCredential forKey:@"credential"];
    480490    [archiver finishEncoding];
    481491    IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
     492#else
     493    auto archiver = secureArchiver();
     494    [archiver encodeObject:nsCredential forKey:@"credential"];
     495    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
     496#endif
    482497}
    483498
     
    576591void ArgumentCoder<ContentFilterUnblockHandler>::encode(Encoder& encoder, const ContentFilterUnblockHandler& contentFilterUnblockHandler)
    577592{
     593#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    578594    auto data = adoptNS([[NSMutableData alloc] init]);
    579     auto archiver = secureArchiverFromMutableData(data.get());
     595    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     596    [archiver setRequiresSecureCoding:YES];
    580597    contentFilterUnblockHandler.encode(archiver.get());
    581598    [archiver finishEncoding];
    582599    IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
     600#else
     601    auto archiver = secureArchiver();
     602    contentFilterUnblockHandler.encode(archiver.get());
     603    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
     604#endif
    583605}
    584606
     
    608630void ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData(Encoder& encoder, const MediaPlaybackTargetContext& target)
    609631{
     632#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    610633    auto data = adoptNS([[NSMutableData alloc] init]);
    611     auto archiver = secureArchiverFromMutableData(data.get());
     634    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     635    [archiver setRequiresSecureCoding:YES];
    612636
    613637    if ([getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
     
    616640    [archiver finishEncoding];
    617641    IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
    618 
     642#else
     643    auto archiver = secureArchiver();
     644
     645    if ([getAVOutputContextClass() conformsToProtocol:@protocol(NSSecureCoding)])
     646        [archiver encodeObject:target.avOutputContext() forKey:deviceContextKey()];
     647
     648    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
     649#endif
    619650}
    620651
  • trunk/Source/WebKit/Shared/mac/WebHitTestResultData.mm

    r225264 r225309  
    4646        return;
    4747
     48#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    4849    auto data = adoptNS([[NSMutableData alloc] init]);
    49     auto archiver = secureArchiverFromMutableData(data.get());
     50    auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     51    [archiver setRequiresSecureCoding:YES];
    5052    [archiver encodeObject:detectedDataActionContext.get() forKey:@"actionContext"];
    5153    [archiver finishEncoding];
    5254
    5355    IPC::encode(encoder, reinterpret_cast<CFDataRef>(data.get()));
     56#else
     57    auto archiver = secureArchiver();
     58    [archiver encodeObject:detectedDataActionContext.get() forKey:@"actionContext"];
     59
     60    IPC::encode(encoder, reinterpret_cast<CFDataRef>(archiver.get().encodedData));
     61#endif
    5462
    5563    encoder << detectedDataBoundingBox;
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm

    r225264 r225309  
    214214    auto copy = adoptNS([(NSObject *)object copy]);
    215215
     216#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    216217    auto data = adoptNS([[NSMutableData alloc] init]);
    217     auto keyedArchiver = secureArchiverFromMutableData(data.get());
     218    auto keyedArchiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     219    [keyedArchiver setRequiresSecureCoding:YES];
     220#else
     221    auto keyedArchiver = secureArchiver();
     222#endif
    218223
    219224    @try {
     
    229234        [_processPool->ensureBundleParameters() removeObjectForKey:parameter];
    230235
     236#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
     237    auto data = keyedArchiver.get().encodedData;
     238#endif
     239
    231240    _processPool->sendToAllProcesses(Messages::WebProcess::SetInjectedBundleParameter(parameter, IPC::DataReference(static_cast<const uint8_t*>([data bytes]), [data length])));
    232241}
     
    236245    auto copy = adoptNS([[NSDictionary alloc] initWithDictionary:dictionary copyItems:YES]);
    237246
     247#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    238248    auto data = adoptNS([[NSMutableData alloc] init]);
    239     auto keyedArchiver = secureArchiverFromMutableData(data.get());
     249    auto keyedArchiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     250    [keyedArchiver setRequiresSecureCoding:YES];
     251#else
     252    auto keyedArchiver = secureArchiver();
     253#endif
    240254
    241255    @try {
     
    247261
    248262    [_processPool->ensureBundleParameters() setValuesForKeysWithDictionary:copy.get()];
     263
     264#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
     265    auto data = keyedArchiver.get().encodedData;
     266#endif
    249267
    250268    _processPool->sendToAllProcesses(Messages::WebProcess::SetInjectedBundleParameters(IPC::DataReference(static_cast<const uint8_t*>([data bytes]), [data length])));
  • trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm

    r225264 r225309  
    216216
    217217    if (m_bundleParameters) {
     218#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    218219        auto data = adoptNS([[NSMutableData alloc] init]);
    219         auto keyedArchiver = secureArchiverFromMutableData(data.get());
     220        auto keyedArchiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     221
     222        [keyedArchiver setRequiresSecureCoding:YES];
     223#else
     224        auto keyedArchiver = secureArchiver();
     225#endif
    220226
    221227        @try {
     
    225231            LOG_ERROR("Failed to encode bundle parameters: %@", exception);
    226232        }
     233
     234#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
     235        auto data = retainPtr(keyedArchiver.get().encodedData);
     236#endif
    227237
    228238        parameters.bundleParameterData = API::Data::createWithoutCopying((const unsigned char*)[data bytes], [data length], [] (unsigned char*, const void* data) {
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm

    r225264 r225309  
    485485                return;
    486486
     487#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
    487488            auto data = adoptNS([[NSMutableData alloc] init]);
    488             auto archiver = secureArchiverFromMutableData(data.get());
     489            auto archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
     490            [archiver setRequiresSecureCoding:YES];
     491#else
     492            auto archiver = secureArchiver();
     493#endif
    489494            @try {
    490495                [archiver encodeObject:userObject forKey:@"userObject"];
     
    494499            }
    495500            [archiver finishEncoding];
     501
     502#if (!PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
     503            auto data = retainPtr(archiver.get().encodedData);
     504#endif
    496505
    497506            userData = API::Data::createWithoutCopying(WTFMove(data));
Note: See TracChangeset for help on using the changeset viewer.