Summary: | Adopt updated NSKeyed[Un]Archiver API when available | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||||||||||||||||
Component: | WebKit Misc. | Assignee: | Brent Fulgham <bfulgham> | ||||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||||
Severity: | Normal | CC: | achristensen, bfulgham, cdumez, commit-queue, dbates, ews-watchlist, japhet, jlewis3, ryanhaddad, simon.fraser, thorton | ||||||||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||||
Bug Depends on: | |||||||||||||||||||||
Bug Blocks: | 178484 | ||||||||||||||||||||
Attachments: |
|
Description
Brent Fulgham
2017-11-28 21:37:11 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. Created attachment 327834 [details]
Patch
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 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. Created attachment 327839 [details]
Patch Part 1 (Landed)
Comment on attachment 327839 [details] Patch Part 1 (Landed) Clearing flags on attachment: 327839 Committed r225264: <https://trac.webkit.org/changeset/225264> All reviewed patches have been landed. Closing bug. Reopening for a second fix needed for another API call that changed. Created attachment 327907 [details]
Patch Part 2
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.
Created attachment 327909 [details]
Patch
Created attachment 327913 [details]
Patch
Created attachment 327914 [details]
Patch
Simon discovered another deprecation error, so revising the patch. Created attachment 327919 [details]
Patch
Created attachment 327921 [details]
Patch
Comment on attachment 327921 [details] Patch Clearing flags on attachment: 327921 Committed r225309: <https://trac.webkit.org/changeset/225309> All reviewed patches have been landed. Closing bug. |