Bug 142215

Summary: Include key to NetworkCacheStorage::Entry
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch none

Description Antti Koivisto 2015-03-03 06:28:43 PST
This simplified code. The key is saved as part of the entry so it makes logical sense too.
Comment 1 Antti Koivisto 2015-03-03 06:51:51 PST
Created attachment 247757 [details]
patch
Comment 2 WebKit Commit Bot 2015-03-03 06:54:03 PST
Attachment 247757 [details] did not pass style-queue:


ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h:153:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:496:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Chris Dumez 2015-03-03 09:39:38 PST
Comment on attachment 247757 [details]
patch

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

r=me with a question.

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:304
> +    return std::unique_ptr<NetworkCacheStorage::Entry>(new NetworkCacheStorage::Entry {

Why are you moving away from std::make_unique<>() in this patch? I personally prefer std::make_unique<>() than explicitly calling new.

> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm:458
> +    m_pendingReadOperationsByPriority[priority].append(new ReadOperation { key, WTF::move(completionHandler) });

ditto here and a couple of other places.
Comment 4 Antti Koivisto 2015-03-03 11:28:18 PST
(In reply to comment #3)
> Why are you moving away from std::make_unique<>() in this patch? I
> personally prefer std::make_unique<>() than explicitly calling new.

It seemed cleaner to do regular initialisation in cases where make_unique doesn't actually make code more compact.
Comment 5 WebKit Commit Bot 2015-03-03 12:13:40 PST
Comment on attachment 247757 [details]
patch

Clearing flags on attachment: 247757

Committed r180949: <http://trac.webkit.org/changeset/180949>
Comment 6 WebKit Commit Bot 2015-03-03 12:13:43 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Andreas Kling 2015-03-03 13:58:04 PST
(In reply to comment #4)
> (In reply to comment #3)
> > Why are you moving away from std::make_unique<>() in this patch? I
> > personally prefer std::make_unique<>() than explicitly calling new.
> 
> It seemed cleaner to do regular initialisation in cases where make_unique
> doesn't actually make code more compact.

Gross. I'd prefer if we didn't introduce more naked news outside of construction helpers.