Bug 174224

Summary: WKWebSiteDataStore.removeDataOfTypes should wait until disk cache files are actually removed before invoking completion handler
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, buildbot, cdumez, cgarcia, commit-queue, sam
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
patch
sam: review+
patch none

Description Antti Koivisto 2017-07-06 15:56:28 PDT
Currently we dispatch the file deletion operations to a background queue and call completion handler without waiting for the I/O to complete.
Comment 1 Antti Koivisto 2017-07-06 15:57:11 PDT
<rdar://problem/33067545>
Comment 2 Antti Koivisto 2017-07-06 16:06:32 PDT
Created attachment 314768 [details]
patch
Comment 3 Build Bot 2017-07-06 16:09:18 PDT
Attachment 314768 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:563:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h:71:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:508:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.h:124:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Antti Koivisto 2017-07-06 16:19:24 PDT
Created attachment 314773 [details]
patch
Comment 5 Build Bot 2017-07-06 16:21:54 PDT
Attachment 314773 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:562:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h:71:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:508:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.h:124:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Sam Weinig 2017-07-06 16:24:40 PDT
Comment on attachment 314773 [details]
patch

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

r=me

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:567
> +    keysToRemove.reserveCapacity(keys.size());

You can call reserveInitialCapacity() here.

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:581
> +            RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)] {

I think you can just pass completionHandler to RunLoop::main().dispatch() (not completely sure the types are the same).
Comment 7 Antti Koivisto 2017-07-06 16:35:11 PDT
Created attachment 314777 [details]
patch
Comment 8 Build Bot 2017-07-06 16:37:50 PDT
Attachment 314777 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:562:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h:71:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:508:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCache.h:124:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 WebKit Commit Bot 2017-07-07 00:22:15 PDT
Comment on attachment 314777 [details]
patch

Clearing flags on attachment: 314777

Committed r219249: <http://trac.webkit.org/changeset/219249>
Comment 10 WebKit Commit Bot 2017-07-07 00:22:17 PDT
All reviewed patches have been landed.  Closing bug.