Summary: | Clean up / modernize PageCache class | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||||||||
Component: | Page Loading | Assignee: | Chris Dumez <cdumez> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Normal | CC: | benjamin, commit-queue, darin, japhet, kling, koivisto, thorton | ||||||||||||||
Priority: | P2 | ||||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||
OS: | Unspecified | ||||||||||||||||
Attachments: |
|
Description
Chris Dumez
2015-01-28 13:39:25 PST
Created attachment 245578 [details]
Patch
Created attachment 245585 [details]
Patch
Created attachment 245587 [details]
Patch
Created attachment 245588 [details]
Patch
Created attachment 245609 [details]
Patch
Comment on attachment 245609 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245609&action=review > Source/WebCore/history/BackForwardController.cpp:75 > - if (!item) > - return; > - > - m_page.goToItem(item, FrameLoadType::IndexedBackForward); > + if (item) > + m_page.goToItem(*item, FrameLoadType::IndexedBackForward); I like the early return style better. > Source/WebCore/history/BackForwardController.cpp:84 > - HistoryItem* item = backItem(); > - if (!item) > - return false; > - > - m_page.goToItem(item, FrameLoadType::Back); > - return true; > + if (HistoryItem* item = backItem()) { > + m_page.goToItem(*item, FrameLoadType::Back); > + return true; > + } > + return false; I like the early return style better. > Source/WebCore/history/BackForwardController.cpp:93 > - HistoryItem* item = forwardItem(); > - if (!item) > - return false; > - > - m_page.goToItem(item, FrameLoadType::Forward); > - return true; > + if (HistoryItem* item = forwardItem()) { > + m_page.goToItem(*item, FrameLoadType::Forward); > + return true; > + } > + return false; I like the early return style better. > Source/WebCore/history/PageCache.cpp:433 > - case PruningReason::ReachedCapacity: > + case PruningReason::ReachedMaxSize: > return DiagnosticLoggingKeys::prunedDueToCapacityReached(); Difference in terminology is a little annoying. Created attachment 245627 [details]
Patch
Comment on attachment 245609 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245609&action=review >> Source/WebCore/history/BackForwardController.cpp:75 >> + m_page.goToItem(*item, FrameLoadType::IndexedBackForward); > > I like the early return style better. Done. >> Source/WebCore/history/BackForwardController.cpp:84 >> + return false; > > I like the early return style better. Done. >> Source/WebCore/history/BackForwardController.cpp:93 >> + return false; > > I like the early return style better. Done. >> Source/WebCore/history/PageCache.cpp:433 >> return DiagnosticLoggingKeys::prunedDueToCapacityReached(); > > Difference in terminology is a little annoying. Done. Comment on attachment 245627 [details] Patch Clearing flags on attachment: 245627 Committed r179347: <http://trac.webkit.org/changeset/179347> All reviewed patches have been landed. Closing bug. iOS build fix in http://trac.webkit.org/changeset/179360 |