Bug 142215 - Include key to NetworkCacheStorage::Entry
Summary: Include key to NetworkCacheStorage::Entry
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-03 06:28 PST by Antti Koivisto
Modified: 2015-03-03 13:58 PST (History)
2 users (show)

See Also:


Attachments
patch (21.21 KB, patch)
2015-03-03 06:51 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-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.