Bug 154750 - WKWebsiteDataStore/WKWebsiteDataRecord needs to provide size information about each type of data
Summary: WKWebsiteDataStore/WKWebsiteDataRecord needs to provide size information abou...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-26 13:57 PST by Anders Carlsson
Modified: 2016-02-26 14:54 PST (History)
1 user (show)

See Also:


Attachments
Patch (61.75 KB, patch)
2016-02-26 14:04 PST, Anders Carlsson
thorton: 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 2016-02-26 13:57:54 PST
WKWebsiteDataStore/WKWebsiteDataRecord needs to provide size information about each type of data
Comment 1 Anders Carlsson 2016-02-26 14:04:47 PST
Created attachment 272367 [details]
Patch
Comment 2 WebKit Commit Bot 2016-02-26 14:05:56 PST
Attachment 272367 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h:63:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Tools/MiniBrowser/mac/WK2BrowserWindowController.m:483:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/NetworkProcess/NetworkProcess.cpp:285:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:153:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:156:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp:121:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:32:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataSizeInternal.h:32:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.h:78:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 9 in 27 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2016-02-26 14:13:14 PST
Comment on attachment 272367 [details]
Patch

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:134
> +    return [[_WKWebsiteDataSize alloc] initWithSize:*size];

Shouldn't it be more clear that this returns a retained thing?
Comment 4 Anders Carlsson 2016-02-26 14:25:59 PST
Committed r197203: <http://trac.webkit.org/changeset/197203>
Comment 5 Sam Weinig 2016-02-26 14:54:25 PST
Comment on attachment 272367 [details]
Patch

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

> Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp:231
> +                    callbackAggregator->m_websiteData.entries.append(WebsiteData::Entry { securityOrigin, WebsiteDataType::IndexedDBDatabases, 0 });

Does this need a FIXME? Shouldn't we be sending a size?

> Source/WebKit2/NetworkProcess/NetworkProcess.cpp:310
> +            auto result = originsAndSizes->add(SecurityOrigin::create(traversalEntry->entry.response().url()), 0);

Should I add a version of HashMap::ensure() that takes two lambdas, one for the success case, one for the failure?

> Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataSize.mm:50
> +- (unsigned long long)sizeOfDataTypes:(NSSet<NSString *> *)dataTypes

This will fail on Yosemite.