Bug 187546 - Shrink CachedResource and subclasses
Summary: Shrink CachedResource and subclasses
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-10 21:37 PDT by Simon Fraser (smfr)
Modified: 2018-07-14 19:14 PDT (History)
9 users (show)

See Also:


Attachments
Patch (17.66 KB, patch)
2018-07-10 21:40 PDT, Simon Fraser (smfr)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>