Bug 143966 - Modify the WKWebsiteDataStore API to take a NSSet of types instead of a bitmask
Summary: Modify the WKWebsiteDataStore API to take a NSSet of types instead of a bitmask
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-20 14:27 PDT by Anders Carlsson
Modified: 2015-04-20 14:49 PDT (History)
1 user (show)

See Also:


Attachments
Patch (18.43 KB, patch)
2015-04-20 14:27 PDT, Anders Carlsson
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2015-04-20 14:27:07 PDT
Modify the WKWebsiteDataStore API to take a NSSet of types instead of a bitmask
Comment 1 Anders Carlsson 2015-04-20 14:27:43 PDT
Created attachment 251189 [details]
Patch
Comment 2 WebKit Commit Bot 2015-04-20 14:29:14 PDT
Attachment 251189 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:33:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:32:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h:32:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 3 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 mitz 2015-04-20 14:40:18 PDT
Comment on attachment 251189 [details]
Patch

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.h:47
> +@property (nonatomic, readonly) NSSet *dataTypes;

Should also have the copy attribute.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:60
> +    return [NSSet setWithObjects:WKWebsiteDataTypeDiskCache, WKWebsiteDataTypeMemoryCache, WKWebsiteDataTypeOfflineWebApplicationCache, WKWebsiteDataTypeCookies, WKWebsiteDataTypeLocalStorage, WKWebsiteDataTypeWebSQLDatabases, nil];

Iā€™d allocate this once and keep it in a static variable.

> Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h:34
> +typedef NS_OPTIONS(NSUInteger, WKWebsiteDataTypes) {
> +    WKWebsiteDataTypeAll = NSUIntegerMax,
> +} WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);

Why is this defined twice?
Comment 4 Anders Carlsson 2015-04-20 14:49:06 PDT
Committed r183028: <http://trac.webkit.org/changeset/183028>