| Summary: | Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||||
| Component: | Page Loading | Assignee: | Chris Dumez <cdumez> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | commit-queue, koivisto | ||||||||||
| Priority: | P2 | ||||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Bug Depends on: | 141230 | ||||||||||||
| Bug Blocks: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Chris Dumez
2015-02-02 19:55:54 PST
Created attachment 245923 [details]
Patch
Comment on attachment 245923 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245923&action=review > Source/WebCore/platform/network/ResourceLoadPriority.h:44 > +enum CachedResourceLoadPriority { > + CachedResourceLoadPriorityTypeDefault = -1, > + CachedResourceLoadPriorityVeryLow = 0, > + CachedResourceLoadPriorityLow, > + CachedResourceLoadPriorityMedium, > + CachedResourceLoadPriorityHigh, > + CachedResourceLoadPriorityVeryHigh, > +}; > + > enum ResourceLoadPriority { > - // The unresolved priority is here for the convenience of the clients. It should not be passed to the ResourceLoadScheduler. > - ResourceLoadPriorityUnresolved = -1, > - ResourceLoadPriorityVeryLow = 0, > + ResourceLoadPriorityVeryLow, > ResourceLoadPriorityLow, > ResourceLoadPriorityMedium, > ResourceLoadPriorityHigh, It seems pretty unfortunate to have two of these. Could we find other solution, for example by replacing uses of CachedResourceLoadPriority with Optional<ResourceLoadPriority>? Defining CachedResourceLoadPriority here is a (minor) platform violation. Nothing in platform/ shouldn't know about CachedResources. The definition should probably be in CachedResources.h or thereabouts. Created attachment 245964 [details]
Patch
Comment on attachment 245964 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245964&action=review > Source/WebCore/loader/cache/CachedResourceRequest.h:54 > + void setPriority(Optional<ResourceLoadPriority> priority) { m_priority = WTF::move(priority); } I can't find any clients for this. Maybe it is not used and could be removed? > Source/WebCore/platform/network/ResourceRequestBase.h:226 > + unsigned m_allowCookies : 1; > + mutable unsigned m_resourceRequestUpdated : 1; > + mutable unsigned m_platformRequestUpdated : 1; > + mutable unsigned m_resourceRequestBodyUpdated : 1; > + mutable unsigned m_platformRequestBodyUpdated : 1; > + unsigned m_reportUploadProgress : 1; > + unsigned m_reportLoadTiming : 1; > + unsigned m_reportRawHeaders : 1; > + unsigned m_hiddenFromInspector : 1; > + unsigned m_priority : 4; These could probably just be regular fields instead of bitfields. I don't think there is meaningful memory savings here. Created attachment 245978 [details]
Patch
Created attachment 245979 [details]
Patch
Comment on attachment 245979 [details] Patch Clearing flags on attachment: 245979 Committed r179584: <http://trac.webkit.org/changeset/179584> All reviewed patches have been landed. Closing bug. |