Bug 180127 - Adopt updated NSKeyed[Un]Archiver API when available
Summary: Adopt updated NSKeyed[Un]Archiver API when available
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks: 178484
  Show dependency treegraph
 
Reported: 2017-11-28 21:37 PST by Brent Fulgham
Modified: 2017-11-29 17:41 PST (History)
11 users (show)

See Also:


Attachments
Patch (49.41 KB, patch)
2017-11-28 22:38 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch Part 1 (Landed) (49.39 KB, patch)
2017-11-28 23:36 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch Part 2 (21.42 KB, patch)
2017-11-29 14:25 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (21.42 KB, patch)
2017-11-29 14:41 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (21.43 KB, patch)
2017-11-29 14:51 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (21.06 KB, patch)
2017-11-29 15:01 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (22.22 KB, patch)
2017-11-29 16:10 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (22.33 KB, patch)
2017-11-29 16:20 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2017-11-28 21:37:11 PST
Update WebKit/WebCore to use updated NSKeyed[Un]Archiver API when available.
Comment 1 Brent Fulgham 2017-11-28 22:07:15 PST
<rdar://problem/35710738>
Comment 2 Brent Fulgham 2017-11-28 22:22:43 PST
Note: This change adopts the new APIs where they match the behavior of existing WebKit code. No attempts are made in this patch to apply NSSecureCoding in places we were not previously.

There should be absolutely no change in behavior with this patch.
Comment 3 Brent Fulgham 2017-11-28 22:38:35 PST
Created attachment 327834 [details]
Patch
Comment 4 Alex Christensen 2017-11-28 23:06:54 PST
Comment on attachment 327834 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=327834&action=review

r=me with comments.  Don't break anything.

> Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:34
> +#if USE(APPLE_INTERNAL_SDK) && USE(SECURE_BY_DEFAULT_ARCHIVER_API)
> +
> +#import <Foundation/NSKeyedArchiver_Private.h>
> +
> +#else

I think this would look nicer if it were arranged like this:

#if USE(SECURE_BY_DEFAULT_ARCHIVER_API)
#if USE(APPLE_INTERNAL_SDK)
#import <Foundation/NSKeyedArchiver_Private.h>
#else
...
#endif
#endif

I would also call SECURE_BY_DEFAULT_ARCHIVER_API SECURE_ARCHIVER_API

> Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:62
> +#include <wtf/RetainPtr.h>

This looks strange in the middle of the file.  The things below this are also not SPI declarations.  Maybe they could go in a different header.

> Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:77
> +inline NSData *_Nullable archivedDataWithRootObject(id _Nonnull object)

Would it make sense to call this insecurelyArchivedDataWithRootObject to mirror securelyArchivedDataWithRootObject and emphasize that it's insecure?

> Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm:49
>      @try {

Could we have this outside of the #if to have mirrored braces?
Comment 5 Brent Fulgham 2017-11-28 23:27:02 PST
Comment on attachment 327834 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=327834&action=review

>> Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:34
>> +#else
> 
> I think this would look nicer if it were arranged like this:
> 
> #if USE(SECURE_BY_DEFAULT_ARCHIVER_API)
> #if USE(APPLE_INTERNAL_SDK)
> #import <Foundation/NSKeyedArchiver_Private.h>
> #else
> ...
> #endif
> #endif
> 
> I would also call SECURE_BY_DEFAULT_ARCHIVER_API SECURE_ARCHIVER_API

Ok!

>> Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:62
>> +#include <wtf/RetainPtr.h>
> 
> This looks strange in the middle of the file.  The things below this are also not SPI declarations.  Maybe they could go in a different header.

I'll move the #include, but I don't think these utility functions need to be moved. They allow us to build on systems with or without access to this SPI without requiring tons of #if/defs all over our codebase.

>> Source/WebCore/PAL/pal/spi/cocoa/NSKeyedArchiverSPI.h:77
>> +inline NSData *_Nullable archivedDataWithRootObject(id _Nonnull object)
> 
> Would it make sense to call this insecurelyArchivedDataWithRootObject to mirror securelyArchivedDataWithRootObject and emphasize that it's insecure?

Sure -- that's a good idea.

>> Source/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm:49
>>      @try {
> 
> Could we have this outside of the #if to have mirrored braces?

No -- there are differences in the implementations inside the #if/else.
Comment 6 Brent Fulgham 2017-11-28 23:36:26 PST
Created attachment 327839 [details]
Patch Part 1 (Landed)
Comment 7 WebKit Commit Bot 2017-11-28 23:52:51 PST
Comment on attachment 327839 [details]
Patch Part 1 (Landed)

Clearing flags on attachment: 327839

Committed r225264: <https://trac.webkit.org/changeset/225264>
Comment 8 WebKit Commit Bot 2017-11-28 23:52:53 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Brent Fulgham 2017-11-29 12:44:56 PST
Reopening for a second fix needed for another API call that changed.
Comment 10 Brent Fulgham 2017-11-29 14:25:07 PST
Created attachment 327907 [details]
Patch Part 2
Comment 11 EWS Watchlist 2017-11-29 14:27:29 PST
Attachment 327907 [details] did not pass style-queue:


ERROR: Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm:86:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 1 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Brent Fulgham 2017-11-29 14:41:48 PST
Created attachment 327909 [details]
Patch
Comment 13 Brent Fulgham 2017-11-29 14:51:26 PST
Created attachment 327913 [details]
Patch
Comment 14 Brent Fulgham 2017-11-29 15:01:30 PST
Created attachment 327914 [details]
Patch
Comment 15 Brent Fulgham 2017-11-29 16:09:20 PST
Simon discovered another deprecation error, so revising the patch.
Comment 16 Brent Fulgham 2017-11-29 16:10:05 PST
Created attachment 327919 [details]
Patch
Comment 17 Brent Fulgham 2017-11-29 16:20:26 PST
Created attachment 327921 [details]
Patch
Comment 18 WebKit Commit Bot 2017-11-29 17:41:00 PST
Comment on attachment 327921 [details]
Patch

Clearing flags on attachment: 327921

Committed r225309: <https://trac.webkit.org/changeset/225309>
Comment 19 WebKit Commit Bot 2017-11-29 17:41:02 PST
All reviewed patches have been landed.  Closing bug.