| Summary: | Use std::unique_ptr for CachedResource | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Gyuyoung Kim <gyuyoung.kim> | ||||||
| Component: | WebCore Misc. | Assignee: | Gyuyoung Kim <gyuyoung.kim> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | commit-queue, japhet | ||||||
| Priority: | P2 | ||||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 128007 | ||||||||
| Attachments: |
|
||||||||
|
Description
Gyuyoung Kim
2014-10-15 01:38:47 PDT
Created attachment 239858 [details]
Patch
Comment on attachment 239858 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=239858&action=review OK to do this, but please use make_unique. > Source/WebCore/loader/cache/CachedResource.cpp:517 > + std::unique_ptr<CachedResourceCallback> callback = m_clientsAwaitingCallback.take(client); I’d suggest using auto here instead of writing out the type. > Source/WebCore/loader/cache/CachedResource.h:271 > + static std::unique_ptr<CachedResourceCallback> schedule(CachedResource* resource, CachedResourceClient* client) { return std::unique_ptr<CachedResourceCallback>(new CachedResourceCallback(resource, client)); } This should use make_unique, not an explicit constructor and new. Created attachment 239913 [details]
Patch for landing
(In reply to comment #2) > (From update of attachment 239858 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=239858&action=review > > OK to do this, but please use make_unique. > > > Source/WebCore/loader/cache/CachedResource.cpp:517 > > + std::unique_ptr<CachedResourceCallback> callback = m_clientsAwaitingCallback.take(client); > > I’d suggest using auto here instead of writing out the type. > > > Source/WebCore/loader/cache/CachedResource.h:271 > > + static std::unique_ptr<CachedResourceCallback> schedule(CachedResource* resource, CachedResourceClient* client) { return std::unique_ptr<CachedResourceCallback>(new CachedResourceCallback(resource, client)); } > > This should use make_unique, not an explicit constructor and new. Ok, Fixed. Comment on attachment 239913 [details] Patch for landing Clearing flags on attachment: 239913 Committed r174758: <http://trac.webkit.org/changeset/174758> All reviewed patches have been landed. Closing bug. |