Bug 142279 - Factor platform I/O out from NetworkCacheStorage
Summary: Factor platform I/O out from NetworkCacheStorage
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-04 08:21 PST by Antti Koivisto
Modified: 2015-03-04 13:35 PST (History)
6 users (show)

See Also:


Attachments
patch (42.69 KB, patch)
2015-03-04 08:47 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (42.55 KB, patch)
2015-03-04 09:07 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (42.55 KB, patch)
2015-03-04 09:29 PST, Antti Koivisto
cdumez: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews107 for mac-mavericks-wk2 (602.84 KB, application/zip)
2015-03-04 10:28 PST, Build Bot
no flags Details
another (43.26 KB, patch)
2015-03-04 11:50 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2015-03-04 08:21:50 PST
NetworkCacheStorage should be cross-platform and use WebKit types.
Comment 1 Antti Koivisto 2015-03-04 08:47:27 PST
Created attachment 247861 [details]
patch
Comment 2 Antti Koivisto 2015-03-04 09:07:16 PST
Created attachment 247863 [details]
patch
Comment 3 WebKit Commit Bot 2015-03-04 09:10:06 PST
Attachment 247863 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:77:  Extra space after ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:77:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:95:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:43:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:44:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 5 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Antti Koivisto 2015-03-04 09:29:58 PST
Created attachment 247865 [details]
patch
Comment 5 WebKit Commit Bot 2015-03-04 09:32:48 PST
Attachment 247865 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:77:  Extra space after ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:77:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:95:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:43:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:44:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 5 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Chris Dumez 2015-03-04 10:09:45 PST
Comment on attachment 247865 [details]
patch

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

r=me % nits.

> Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp:126
> +        body = NetworkCacheData(reinterpret_cast<const uint8_t*>(responseData->data()), responseData->size());

Doesn't this work?
body = { reinterpret_cast<const uint8_t*>(responseData->data()), responseData->size() };

> Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h:43
> +template<typename T> class DispatchPtr {

Feels like this could be in its own file.

> Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h:97
> +    NetworkCacheData() { }

NetworkCacheData() = default; ?

> Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:49
> +    NetworkCacheIOChannel(int fd);

nit: explicit

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:211
> +    data = NetworkCacheData { headerData };

Do we need to explicitly specific NetworkCacheData ?
Comment 7 Build Bot 2015-03-04 10:28:54 PST
Comment on attachment 247865 [details]
patch

Attachment 247865 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/6540931918462976

Number of test failures exceeded the failure limit.
Comment 8 Build Bot 2015-03-04 10:28:57 PST
Created attachment 247868 [details]
Archive of layout-test-results from ews107 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 9 Antti Koivisto 2015-03-04 11:27:52 PST
> nit: explicit
> 
> > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:211
> > +    data = NetworkCacheData { headerData };
> 
> Do we need to explicitly specific NetworkCacheData ?

explicit prevents it from working. 

I feel we should stop cargo-culling about explicit.
Comment 10 Antti Koivisto 2015-03-04 11:28:49 PST
> I feel we should stop cargo-culling about explicit.

"culting"
Comment 11 Chris Dumez 2015-03-04 11:46:09 PST
(In reply to comment #10)
> > I feel we should stop cargo-culling about explicit.
> 
> "culting"

I discussed this with Andreas, and we sort-of agreed that using explicit is nice if calling the constructor is either lossy or potentially expensive. Otherwise, I don't think explicit matters that much.
Comment 12 Antti Koivisto 2015-03-04 11:50:02 PST
Created attachment 247875 [details]
another
Comment 13 WebKit Commit Bot 2015-03-04 11:52:57 PST
Attachment 247875 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:77:  Extra space after ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:77:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:96:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:43:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h:44:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 5 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 WebKit Commit Bot 2015-03-04 13:35:35 PST
Comment on attachment 247875 [details]
another

Clearing flags on attachment: 247875

Committed r181020: <http://trac.webkit.org/changeset/181020>
Comment 15 WebKit Commit Bot 2015-03-04 13:35:39 PST
All reviewed patches have been landed.  Closing bug.