Bug 143966

Summary: Modify the WKWebsiteDataStore API to take a NSSet of types instead of a bitmask
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch mitz: review+

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>