Bug 187546

Summary: Shrink CachedResource and subclasses
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: New BugsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, commit-queue, dbates, ews-watchlist, japhet, mmaxfield, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Simon Fraser (smfr) 2018-07-10 21:37:12 PDT
Shrink CachedResource and subclasses
Comment 1 Simon Fraser (smfr) 2018-07-10 21:40:41 PDT
Created attachment 344749 [details]
Patch
Comment 2 EWS Watchlist 2018-07-10 21:42:13 PDT
Attachment 344749 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/network/ResourceRequestBase.h:167:  enum members should use InterCaps with an initial capital letter or initial 'k' for C-style enums.  [readability/enum_casing] [4]
Total errors found: 1 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Simon Fraser (smfr) 2018-07-13 20:42:04 PDT
I can haz review?
Comment 4 Daniel Bates 2018-07-14 05:42:40 PDT
Comment on attachment 344749 [details]
Patch

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

> Source/WebCore/loader/cache/CachedResource.h:335
> +    CachedResourceLoader* m_owningCachedResourceLoader { nullptr }; // only non-null for resources that are not in the cache

Please make the comment a proper sentence.

> Source/WebCore/platform/network/NetworkLoadMetrics.h:42
> +enum class NetworkLoadPriority : uint8_t {

I take it the compiler is not smart enough to store these in a uint8_t without the annotation. Is this a bug in clang?

> Source/WebCore/platform/network/ResourceRequestBase.h:86
> +    enum class SameSiteDisposition : uint8_t { Unspecified, SameSite, CrossSite };

Ditto.

> Source/WebCore/platform/network/ResourceRequestBase.h:167
> +    enum class Requester : uint8_t { Unspecified, Main, XHR, Fetch, Media, ImportScripts };

Ditto.
Comment 5 Chris Dumez 2018-07-14 08:21:42 PDT
Comment on attachment 344749 [details]
Patch

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

>> Source/WebCore/platform/network/NetworkLoadMetrics.h:42
>> +enum class NetworkLoadPriority : uint8_t {
> 
> I take it the compiler is not smart enough to store these in a uint8_t without the annotation. Is this a bug in clang?

Not a bug, default underlying type is int as per https://isocpp.org/wiki/faq/cpp11-language-types#enum-class
Comment 6 WebKit Commit Bot 2018-07-14 19:13:47 PDT
Comment on attachment 344749 [details]
Patch

Clearing flags on attachment: 344749

Committed r233839: <https://trac.webkit.org/changeset/233839>
Comment 7 WebKit Commit Bot 2018-07-14 19:13:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-07-14 19:14:20 PDT
<rdar://problem/42208702>