Changeset 256482 in webkit
- Timestamp:
- Feb 12, 2020 2:51:19 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r256477 r256482 1 2020-02-12 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Shrink CachedResource 4 https://bugs.webkit.org/show_bug.cgi?id=207618 5 6 Reviewed by Mark Lam. 7 8 * wtf/Markable.h: 9 (WTF::Markable::asOptional const): Add helper method to get Optional easily from Markable. 10 * wtf/ObjectIdentifier.h: 11 (WTF::ObjectIdentifier::MarkableTraits::isEmptyValue): 12 (WTF::ObjectIdentifier::MarkableTraits::emptyValue): 13 (WTF::ObjectIdentifier::ObjectIdentifier): Add MarkableTraits for ObjectIdentifier. 14 1 15 2020-02-12 Simon Fraser <simon.fraser@apple.com> 2 16 -
trunk/Source/WTF/wtf/Markable.h
r251959 r256482 143 143 } 144 144 145 Optional<T> asOptional() const 146 { 147 return Optional<T>(*this); 148 } 149 145 150 private: 146 151 T m_value; -
trunk/Source/WTF/wtf/ObjectIdentifier.h
r255127 r256482 97 97 } 98 98 99 struct MarkableTraits { 100 static bool isEmptyValue(ObjectIdentifier identifier) 101 { 102 return !identifier.m_identifier; 103 } 104 105 static constexpr ObjectIdentifier emptyValue() 106 { 107 return ObjectIdentifier(); 108 } 109 }; 110 99 111 private: 100 112 template<typename U> friend ObjectIdentifier<U> makeObjectIdentifier(uint64_t); … … 105 117 static bool isValidIdentifier(uint64_t identifier) { return identifier && identifier != hashTableDeletedValue(); } 106 118 107 explicit ObjectIdentifier(uint64_t identifier)119 explicit constexpr ObjectIdentifier(uint64_t identifier) 108 120 : m_identifier(identifier) 109 121 { -
trunk/Source/WebCore/ChangeLog
r256477 r256482 1 2020-02-12 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Shrink CachedResource 4 https://bugs.webkit.org/show_bug.cgi?id=207618 5 6 Reviewed by Mark Lam. 7 8 This patch shrinks sizeof(CachedResource) by 80 bytes by aggressively using bit-fields and Markable<>. 9 For each enum class, we define `bitsOfXXX` value, which indicates # of bits to represent it. And using 10 this value for bit-field's width. 11 12 No behavior change. 13 14 * loader/FetchOptions.h: 15 (WebCore::FetchOptions::encode const): 16 * loader/ResourceLoaderOptions.h: 17 (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): 18 (WebCore::ResourceLoaderOptions::loadedFromOpaqueSource): 19 * loader/cache/CachedImage.cpp: 20 (WebCore::CachedImage::CachedImage): 21 (WebCore::CachedImage::shouldDeferUpdateImageData const): 22 (WebCore::CachedImage::didUpdateImageData): 23 * loader/cache/CachedImage.h: 24 * loader/cache/CachedResource.cpp: 25 (WebCore::CachedResource::CachedResource): 26 (WebCore::CachedResource::load): 27 (WebCore::CachedResource::finish): 28 * loader/cache/CachedResource.h: 29 (WebCore::CachedResource::setStatus): 30 * page/csp/ContentSecurityPolicyResponseHeaders.h: 31 (WebCore::ContentSecurityPolicyResponseHeaders::MarkableTraits::isEmptyValue): 32 (WebCore::ContentSecurityPolicyResponseHeaders::MarkableTraits::emptyValue): 33 (WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders): 34 * platform/network/NetworkLoadMetrics.h: 35 (WebCore::NetworkLoadMetrics::isolatedCopy const): 36 (WebCore::NetworkLoadMetrics::clearNonTimingData): 37 (WebCore::NetworkLoadMetrics::operator== const): 38 (WebCore::NetworkLoadMetrics::encode const): 39 (WebCore::NetworkLoadMetrics::decode): 40 * platform/network/ResourceLoadPriority.h: 41 * platform/network/ResourceRequestBase.h: 42 (WebCore::ResourceRequestBase::ResourceRequestBase): 43 * platform/network/ResourceResponseBase.h: 44 * platform/network/StoredCredentialsPolicy.h: 45 1 46 2020-02-12 Simon Fraser <simon.fraser@apple.com> 2 47 -
trunk/Source/WebCore/loader/FetchOptions.h
r243163 r256482 31 31 #include "DocumentIdentifier.h" 32 32 #include "ReferrerPolicy.h" 33 #include <wtf/Markable.h> 33 34 #include <wtf/text/WTFString.h> 34 35 … … 59 60 bool keepAlive { false }; 60 61 String integrity; 61 Optional<DocumentIdentifier> clientIdentifier;62 Markable<DocumentIdentifier, DocumentIdentifier::MarkableTraits> clientIdentifier; 62 63 }; 63 64 … … 229 230 { 230 231 encodePersistent(encoder); 231 encoder << clientIdentifier ;232 encoder << clientIdentifier.asOptional(); 232 233 } 233 234 -
trunk/Source/WebCore/loader/ResourceLoaderOptions.h
r251155 r256482 47 47 DoNotSendCallbacks 48 48 }; 49 static constexpr unsigned bitWidthOfSendCallbackPolicy = 1; 49 50 50 51 // FIXME: These options are named poorly. We only implement force disabling content sniffing, not enabling it, … … 54 55 DoNotSniffContent 55 56 }; 57 static constexpr unsigned bitWidthOfContentSniffingPolicy = 1; 56 58 57 59 enum class DataBufferingPolicy : uint8_t { … … 59 61 DoNotBufferData 60 62 }; 63 static constexpr unsigned bitWidthOfDataBufferingPolicy = 1; 61 64 62 65 enum class SecurityCheckPolicy : uint8_t { … … 64 67 DoSecurityCheck 65 68 }; 69 static constexpr unsigned bitWidthOfSecurityCheckPolicy = 1; 66 70 67 71 enum class CertificateInfoPolicy : uint8_t { … … 69 73 DoNotIncludeCertificateInfo 70 74 }; 75 static constexpr unsigned bitWidthOfCertificateInfoPolicy = 1; 71 76 72 77 enum class ContentSecurityPolicyImposition : uint8_t { … … 74 79 DoPolicyCheck 75 80 }; 81 static constexpr unsigned bitWidthOfContentSecurityPolicyImposition = 1; 76 82 77 83 enum class DefersLoadingPolicy : uint8_t { … … 79 85 DisallowDefersLoading 80 86 }; 87 static constexpr unsigned bitWidthOfDefersLoadingPolicy = 1; 81 88 82 89 enum class CachingPolicy : uint8_t { … … 84 91 DisallowCaching 85 92 }; 93 static constexpr unsigned bitWidthOfCachingPolicy = 1; 86 94 87 95 enum class ClientCredentialPolicy : uint8_t { … … 89 97 MayAskClientForCredentials 90 98 }; 99 static constexpr unsigned bitWidthOfClientCredentialPolicy = 1; 91 100 92 101 enum class SameOriginDataURLFlag : uint8_t { … … 94 103 Unset 95 104 }; 105 static constexpr unsigned bitWidthOfSameOriginDataURLFlag = 1; 96 106 97 107 enum class InitiatorContext : uint8_t { … … 99 109 Worker, 100 110 }; 111 static constexpr unsigned bitWidthOfInitiatorContext = 1; 101 112 102 113 enum class ServiceWorkersMode : uint8_t { … … 105 116 Only // An error will happen if service worker is not handling the fetch. Used to bypass preflight safely. 106 117 }; 118 static constexpr unsigned bitWidthOfServiceWorkersMode = 2; 107 119 108 120 enum class ApplicationCacheMode : uint8_t { … … 110 122 Bypass 111 123 }; 124 static constexpr unsigned bitWidthOfApplicationCacheMode = 1; 112 125 113 126 // FIXME: These options are named poorly. We only implement force disabling content encoding sniffing, not enabling it, … … 117 130 DoNotSniff, 118 131 }; 132 static constexpr unsigned bitWidthOfContentEncodingSniffingPolicy = 1; 119 133 120 134 enum class PreflightPolicy : uint8_t { … … 123 137 Prevent 124 138 }; 139 static constexpr unsigned bitWidthOfPreflightPolicy = 2; 125 140 126 141 enum class LoadedFromOpaqueSource : uint8_t { … … 128 143 No 129 144 }; 145 static constexpr unsigned bitWidthOfLoadedFromOpaqueSource = 1; 130 146 131 147 struct ResourceLoaderOptions : public FetchOptions { 132 ResourceLoaderOptions() { } 133 134 ResourceLoaderOptions(FetchOptions options) : FetchOptions { WTFMove(options) } { } 148 ResourceLoaderOptions() 149 : ResourceLoaderOptions(FetchOptions()) 150 { 151 } 152 153 ResourceLoaderOptions(FetchOptions options) 154 : FetchOptions { WTFMove(options) } 155 , sendLoadCallbacks(SendCallbackPolicy::DoNotSendCallbacks) 156 , sniffContent(ContentSniffingPolicy::DoNotSniffContent) 157 , sniffContentEncoding(ContentEncodingSniffingPolicy::Sniff) 158 , dataBufferingPolicy(DataBufferingPolicy::BufferData) 159 , storedCredentialsPolicy(StoredCredentialsPolicy::DoNotUse) 160 , securityCheck(SecurityCheckPolicy::DoSecurityCheck) 161 , certificateInfoPolicy(CertificateInfoPolicy::DoNotIncludeCertificateInfo) 162 , contentSecurityPolicyImposition(ContentSecurityPolicyImposition::DoPolicyCheck) 163 , defersLoadingPolicy(DefersLoadingPolicy::AllowDefersLoading) 164 , cachingPolicy(CachingPolicy::AllowCaching) 165 , sameOriginDataURLFlag(SameOriginDataURLFlag::Unset) 166 , initiatorContext(InitiatorContext::Document) 167 , serviceWorkersMode(ServiceWorkersMode::All) 168 , applicationCacheMode(ApplicationCacheMode::Use) 169 , clientCredentialPolicy(ClientCredentialPolicy::CannotAskClientForCredentials) 170 , preflightPolicy(PreflightPolicy::Consider) 171 , loadedFromOpaqueSource(LoadedFromOpaqueSource::No) 172 { } 135 173 136 174 ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentialsPolicy storedCredentialsPolicy, ClientCredentialPolicy credentialPolicy, FetchOptions::Credentials credentials, SecurityCheckPolicy securityCheck, FetchOptions::Mode mode, CertificateInfoPolicy certificateInfoPolicy, ContentSecurityPolicyImposition contentSecurityPolicyImposition, DefersLoadingPolicy defersLoadingPolicy, CachingPolicy cachingPolicy) 137 175 : sendLoadCallbacks(sendLoadCallbacks) 138 176 , sniffContent(sniffContent) 177 , sniffContentEncoding(ContentEncodingSniffingPolicy::Sniff) 139 178 , dataBufferingPolicy(dataBufferingPolicy) 140 179 , storedCredentialsPolicy(storedCredentialsPolicy) … … 144 183 , defersLoadingPolicy(defersLoadingPolicy) 145 184 , cachingPolicy(cachingPolicy) 185 , sameOriginDataURLFlag(SameOriginDataURLFlag::Unset) 186 , initiatorContext(InitiatorContext::Document) 187 , serviceWorkersMode(ServiceWorkersMode::All) 188 , applicationCacheMode(ApplicationCacheMode::Use) 146 189 , clientCredentialPolicy(credentialPolicy) 190 , preflightPolicy(PreflightPolicy::Consider) 191 , loadedFromOpaqueSource(LoadedFromOpaqueSource::No) 192 147 193 { 148 194 this->credentials = credentials; … … 151 197 152 198 #if ENABLE(SERVICE_WORKER) 153 Optional<ServiceWorkerRegistrationIdentifier> serviceWorkerRegistrationIdentifier;199 Markable<ServiceWorkerRegistrationIdentifier, ServiceWorkerRegistrationIdentifier::MarkableTraits> serviceWorkerRegistrationIdentifier; 154 200 #endif 201 Markable<ContentSecurityPolicyResponseHeaders, ContentSecurityPolicyResponseHeaders::MarkableTraits> cspResponseHeaders; 155 202 OptionSet<HTTPHeadersToKeepFromCleaning> httpHeadersToKeep; 156 Optional<ContentSecurityPolicyResponseHeaders> cspResponseHeaders; 157 unsigned maxRedirectCount { 20 }; 158 159 SendCallbackPolicy sendLoadCallbacks { SendCallbackPolicy::DoNotSendCallbacks }; 160 ContentSniffingPolicy sniffContent { ContentSniffingPolicy::DoNotSniffContent }; 161 ContentEncodingSniffingPolicy sniffContentEncoding { ContentEncodingSniffingPolicy::Sniff }; 162 DataBufferingPolicy dataBufferingPolicy { DataBufferingPolicy::BufferData }; 163 StoredCredentialsPolicy storedCredentialsPolicy { StoredCredentialsPolicy::DoNotUse }; 164 SecurityCheckPolicy securityCheck { SecurityCheckPolicy::DoSecurityCheck }; 165 CertificateInfoPolicy certificateInfoPolicy { CertificateInfoPolicy::DoNotIncludeCertificateInfo }; 166 ContentSecurityPolicyImposition contentSecurityPolicyImposition { ContentSecurityPolicyImposition::DoPolicyCheck }; 167 DefersLoadingPolicy defersLoadingPolicy { DefersLoadingPolicy::AllowDefersLoading }; 168 CachingPolicy cachingPolicy { CachingPolicy::AllowCaching }; 169 SameOriginDataURLFlag sameOriginDataURLFlag { SameOriginDataURLFlag::Unset }; 170 InitiatorContext initiatorContext { InitiatorContext::Document }; 171 ServiceWorkersMode serviceWorkersMode { ServiceWorkersMode::All }; 172 ApplicationCacheMode applicationCacheMode { ApplicationCacheMode::Use }; 173 ClientCredentialPolicy clientCredentialPolicy { ClientCredentialPolicy::CannotAskClientForCredentials }; 174 PreflightPolicy preflightPolicy { PreflightPolicy::Consider }; 175 LoadedFromOpaqueSource loadedFromOpaqueSource { LoadedFromOpaqueSource::No }; 203 uint8_t maxRedirectCount { 20 }; 204 205 SendCallbackPolicy sendLoadCallbacks : bitWidthOfSendCallbackPolicy; 206 ContentSniffingPolicy sniffContent : bitWidthOfContentSniffingPolicy; 207 ContentEncodingSniffingPolicy sniffContentEncoding : bitWidthOfContentEncodingSniffingPolicy; 208 DataBufferingPolicy dataBufferingPolicy : bitWidthOfDataBufferingPolicy; 209 StoredCredentialsPolicy storedCredentialsPolicy : bitWidthOfStoredCredentialsPolicy; 210 SecurityCheckPolicy securityCheck : bitWidthOfSecurityCheckPolicy; 211 CertificateInfoPolicy certificateInfoPolicy : bitWidthOfCertificateInfoPolicy; 212 ContentSecurityPolicyImposition contentSecurityPolicyImposition : bitWidthOfContentSecurityPolicyImposition; 213 DefersLoadingPolicy defersLoadingPolicy : bitWidthOfDefersLoadingPolicy; 214 CachingPolicy cachingPolicy : bitWidthOfCachingPolicy; 215 SameOriginDataURLFlag sameOriginDataURLFlag : bitWidthOfSameOriginDataURLFlag; 216 InitiatorContext initiatorContext : bitWidthOfInitiatorContext; 217 ServiceWorkersMode serviceWorkersMode : bitWidthOfServiceWorkersMode; 218 ApplicationCacheMode applicationCacheMode : bitWidthOfApplicationCacheMode; 219 ClientCredentialPolicy clientCredentialPolicy : bitWidthOfClientCredentialPolicy; 220 PreflightPolicy preflightPolicy : bitWidthOfPreflightPolicy; 221 LoadedFromOpaqueSource loadedFromOpaqueSource : bitWidthOfLoadedFromOpaqueSource; 176 222 }; 177 223 -
trunk/Source/WebCore/loader/cache/CachedImage.cpp
r254229 r256482 58 58 CachedImage::CachedImage(CachedResourceRequest&& request, const PAL::SessionID& sessionID, const CookieJar* cookieJar) 59 59 : CachedResource(WTFMove(request), Type::ImageResource, sessionID, cookieJar) 60 , m_updateImageDataCount(0) 61 , m_isManuallyCached(false) 62 , m_shouldPaintBrokenImage(true) 63 , m_forceUpdateImageDataEnabledForTesting(false) 60 64 { 61 65 setStatus(Unknown); … … 65 69 : CachedResource(URL(), Type::ImageResource, sessionID, cookieJar) 66 70 , m_image(image) 71 , m_updateImageDataCount(0) 72 , m_isManuallyCached(false) 73 , m_shouldPaintBrokenImage(true) 74 , m_forceUpdateImageDataEnabledForTesting(false) 67 75 { 68 76 } … … 71 79 : CachedResource(url, Type::ImageResource, sessionID, cookieJar) 72 80 , m_image(image) 81 , m_updateImageDataCount(0) 73 82 , m_isManuallyCached(true) 83 , m_shouldPaintBrokenImage(true) 84 , m_forceUpdateImageDataEnabledForTesting(false) 74 85 { 75 86 m_resourceRequest.setDomainForCachePartition(domainForCachePartition); … … 494 505 { 495 506 static const double updateImageDataBackoffIntervals[] = { 0, 1, 3, 6, 15 }; 496 unsigned interval = std::min<unsigned>(m_updateImageDataCount, 4);507 unsigned interval = m_updateImageDataCount; 497 508 498 509 // The first time through, the chunk time will be 0 and the image will get an update. … … 516 527 { 517 528 m_lastUpdateImageDataTime = MonotonicTime::now(); 518 ASSERT(m_updateImageDataCount < std::numeric_limits<unsigned>::max()); 519 ++m_updateImageDataCount; 529 unsigned previous = m_updateImageDataCount; 530 if (previous != maxUpdateImageDataCount) 531 m_updateImageDataCount += 1; 520 532 } 521 533 -
trunk/Source/WebCore/loader/cache/CachedImage.h
r254229 r256482 185 185 MonotonicTime m_lastUpdateImageDataTime; 186 186 187 unsigned m_updateImageDataCount { 0 }; 188 bool m_isManuallyCached { false }; 189 bool m_shouldPaintBrokenImage { true }; 190 bool m_forceUpdateImageDataEnabledForTesting { false }; 187 static constexpr unsigned maxUpdateImageDataCount = 4; 188 unsigned m_updateImageDataCount : 3; 189 bool m_isManuallyCached : 1; 190 bool m_shouldPaintBrokenImage : 1; 191 bool m_forceUpdateImageDataEnabledForTesting : 1; 191 192 }; 192 193 -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r253987 r256482 130 130 , m_origin(request.releaseOrigin()) 131 131 , m_initiatorName(request.initiatorName()) 132 , m_type(type) 133 , m_preloadResult(PreloadResult::PreloadNotReferenced) 134 , m_responseTainting(ResourceResponse::Tainting::Basic) 132 135 , m_loadPriority(defaultPriorityForResourceType(type)) 133 , m_type(type) 136 , m_status(Pending) 137 , m_requestedFromNetworkingLayer(false) 138 , m_inCache(false) 139 , m_loading(false) 134 140 , m_isLinkPreload(request.isLinkPreload()) 135 141 , m_hasUnknownEncoding(request.isLinkPreload()) 142 , m_switchingClientsToRevalidatedResource(false) 136 143 , m_ignoreForRequestCount(request.ignoreForRequestCount()) 137 144 { … … 158 165 , m_responseTimestamp(WallTime::now()) 159 166 , m_fragmentIdentifierForRequest(CachedResourceRequest::splitFragmentIdentifierFromRequestURL(m_resourceRequest)) 167 , m_type(type) 168 , m_preloadResult(PreloadResult::PreloadNotReferenced) 169 , m_responseTainting(ResourceResponse::Tainting::Basic) 160 170 , m_status(Cached) 161 , m_type(type) 171 , m_requestedFromNetworkingLayer(false) 172 , m_inCache(false) 173 , m_loading(false) 174 , m_isLinkPreload(false) 175 , m_hasUnknownEncoding(false) 176 , m_switchingClientsToRevalidatedResource(false) 177 , m_ignoreForRequestCount(false) 162 178 { 163 179 ASSERT(m_sessionID.isValid()); … … 313 329 return; 314 330 } 315 m_status = Pending;331 setStatus(Pending); 316 332 }); 317 333 } … … 400 416 { 401 417 if (!errorOccurred()) 402 m_status = Cached;418 setStatus(Cached); 403 419 } 404 420 -
trunk/Source/WebCore/loader/cache/CachedResource.h
r254087 r256482 78 78 Beacon, 79 79 Ping, 80 SVGDocumentResource81 80 #if ENABLE(XSLT) 82 , XSLStyleSheet83 #endif 84 , LinkPrefetch81 XSLStyleSheet, 82 #endif 83 LinkPrefetch, 85 84 #if ENABLE(VIDEO_TRACK) 86 , TextTrackResource85 TextTrackResource, 87 86 #endif 88 87 #if ENABLE(APPLICATION_MANIFEST) 89 , ApplicationManifest 90 #endif 88 ApplicationManifest, 89 #endif 90 SVGDocumentResource, 91 LastType = SVGDocumentResource, 91 92 }; 92 93 enum Status { 93 static constexpr unsigned bitWidthOfType = 5; 94 static_assert(static_cast<unsigned>(Type::LastType) <= ((1U << bitWidthOfType) - 1)); 95 96 enum Status : uint8_t { 94 97 Unknown, // let cache decide what to do with it 95 98 Pending, // only partially loaded … … 98 101 DecodeError 99 102 }; 103 static constexpr unsigned bitWidthOfStatus = 3; 104 static_assert(static_cast<unsigned>(DecodeError) <= ((1ULL << bitWidthOfStatus) - 1)); 100 105 101 106 CachedResource(CachedResourceRequest&&, Type, const PAL::SessionID&, const CookieJar*); … … 143 148 PreloadReferencedWhileComplete 144 149 }; 150 static constexpr unsigned bitWidthOfPreloadResult = 2; 151 145 152 PreloadResult preloadResult() const { return static_cast<PreloadResult>(m_preloadResult); } 146 153 … … 153 160 154 161 Status status() const { return static_cast<Status>(m_status); } 155 void setStatus(Status status) { m_status = status; } 162 void setStatus(Status status) 163 { 164 m_status = status; 165 ASSERT(this->status() == status); 166 } 156 167 157 168 unsigned size() const { return encodedSize() + decodedSize() + overheadSize(); } … … 354 365 AtomString m_initiatorName; 355 366 356 RedirectChainCacheStatus m_redirectChainCacheStatus;357 358 367 unsigned m_encodedSize { 0 }; 359 368 unsigned m_decodedSize { 0 }; … … 362 371 unsigned m_preloadCount { 0 }; 363 372 364 unsigned m_status { Pending }; // Status365 366 PreloadResult m_preloadResult { PreloadResult::PreloadNotReferenced };367 368 ResourceResponse::Tainting m_responseTainting { ResourceResponse::Tainting::Basic };369 Resource LoadPriority m_loadPriority;370 371 Type m_type; // Type 372 373 bool m_requestedFromNetworkingLayer { false };374 bool m_inCache { false };375 bool m_loading { false };376 bool m_isLinkPreload { false };377 bool m_hasUnknownEncoding { false };378 bool m_switchingClientsToRevalidatedResource { false };379 bool m_ignoreForRequestCount { false };373 RedirectChainCacheStatus m_redirectChainCacheStatus; 374 375 Type m_type : bitWidthOfType; 376 377 PreloadResult m_preloadResult : bitWidthOfPreloadResult; 378 ResourceResponse::Tainting m_responseTainting : ResourceResponse::bitWidthOfTainting; 379 ResourceLoadPriority m_loadPriority : bitWidthOfResourceLoadPriority; 380 381 Status m_status : bitWidthOfStatus; 382 bool m_requestedFromNetworkingLayer : 1; 383 bool m_inCache : 1; 384 bool m_loading : 1; 385 bool m_isLinkPreload : 1; 386 bool m_hasUnknownEncoding : 1; 387 bool m_switchingClientsToRevalidatedResource : 1; 388 bool m_ignoreForRequestCount : 1; 380 389 381 390 #if ASSERT_ENABLED -
trunk/Source/WebCore/page/csp/ContentSecurityPolicyResponseHeaders.h
r253206 r256482 51 51 template <class Decoder> static bool decode(Decoder&, ContentSecurityPolicyResponseHeaders&); 52 52 53 enum EmptyTag { Empty }; 54 struct MarkableTraits { 55 static bool isEmptyValue(const ContentSecurityPolicyResponseHeaders& identifier) 56 { 57 return identifier.m_emptyForMarkable; 58 } 59 60 static ContentSecurityPolicyResponseHeaders emptyValue() 61 { 62 return ContentSecurityPolicyResponseHeaders(Empty); 63 } 64 }; 65 53 66 private: 54 67 friend class ContentSecurityPolicy; 68 ContentSecurityPolicyResponseHeaders(EmptyTag) 69 : m_emptyForMarkable(true) 70 { } 55 71 56 72 Vector<std::pair<String, ContentSecurityPolicyHeaderType>> m_headers; 57 73 int m_httpStatusCode { 0 }; 74 bool m_emptyForMarkable { false }; 58 75 }; 59 76 -
trunk/Source/WebCore/platform/network/NetworkLoadMetrics.h
r251862 r256482 71 71 copy.remoteAddress = remoteAddress.isolatedCopy(); 72 72 copy.connectionIdentifier = connectionIdentifier.isolatedCopy(); 73 copy.priority = priority;74 73 copy.tlsProtocol = tlsProtocol.isolatedCopy(); 75 74 copy.tlsCipher = tlsCipher.isolatedCopy(); 75 copy.priority = priority; 76 76 copy.requestHeaders = requestHeaders.isolatedCopy(); 77 77 … … 104 104 remoteAddress = String(); 105 105 connectionIdentifier = String(); 106 priority = NetworkLoadPriority::Unknown;107 106 tlsProtocol = String(); 108 107 tlsCipher = String(); 108 priority = NetworkLoadPriority::Unknown; 109 109 requestHeaders.clear(); 110 110 requestHeaderBytesSent = std::numeric_limits<uint32_t>::max(); … … 129 129 && remoteAddress == other.remoteAddress 130 130 && connectionIdentifier == other.connectionIdentifier 131 && priority == other.priority132 131 && tlsProtocol == other.tlsProtocol 133 132 && tlsCipher == other.tlsCipher 133 && priority == other.priority 134 134 && requestHeaders == other.requestHeaders 135 135 && requestHeaderBytesSent == other.requestHeaderBytesSent … … 167 167 String remoteAddress; 168 168 String connectionIdentifier; 169 NetworkLoadPriority priority;170 169 171 170 String tlsProtocol; … … 173 172 174 173 // Whether or not all of the properties (0 or otherwise) have been set. 174 NetworkLoadPriority priority; 175 175 bool complete { false }; 176 176 … … 203 203 encoder << remoteAddress; 204 204 encoder << connectionIdentifier; 205 encoder << priority;206 205 encoder << tlsProtocol; 207 206 encoder << tlsCipher; 207 encoder << priority; 208 208 encoder << requestHeaders; 209 209 encoder << requestHeaderBytesSent; … … 229 229 && decoder.decode(metrics.remoteAddress) 230 230 && decoder.decode(metrics.connectionIdentifier) 231 && decoder.decode(metrics.priority)232 231 && decoder.decode(metrics.tlsProtocol) 233 232 && decoder.decode(metrics.tlsCipher) 233 && decoder.decode(metrics.priority) 234 234 && decoder.decode(metrics.requestHeaders) 235 235 && decoder.decode(metrics.requestHeaderBytesSent) -
trunk/Source/WebCore/platform/network/ResourceLoadPriority.h
r233668 r256482 38 38 Highest = VeryHigh, 39 39 }; 40 static constexpr unsigned bitWidthOfResourceLoadPriority = 3; 41 static_assert(static_cast<unsigned>(ResourceLoadPriority::Highest) <= ((1U << bitWidthOfResourceLoadPriority) - 1)); 40 42 41 43 static const unsigned resourceLoadPriorityCount { static_cast<unsigned>(ResourceLoadPriority::Highest) + 1 }; -
trunk/Source/WebCore/platform/network/ResourceRequestBase.h
r256166 r256482 198 198 // Used when ResourceRequest is initialized from a platform representation of the request 199 199 ResourceRequestBase() 200 : m_platformRequestUpdated(true) 200 : m_allowCookies(false) 201 , m_resourceRequestUpdated(false) 202 , m_platformRequestUpdated(true) 203 , m_resourceRequestBodyUpdated(false) 201 204 , m_platformRequestBodyUpdated(true) 205 , m_hiddenFromInspector(false) 206 , m_isTopSite(false) 202 207 { 203 208 } … … 210 215 , m_allowCookies(true) 211 216 , m_resourceRequestUpdated(true) 217 , m_platformRequestUpdated(false) 212 218 , m_resourceRequestBodyUpdated(true) 219 , m_platformRequestBodyUpdated(false) 220 , m_hiddenFromInspector(false) 221 , m_isTopSite(false) 213 222 { 214 223 } … … 237 246 Requester m_requester { Requester::Unspecified }; 238 247 Optional<int> m_inspectorInitiatorNodeIdentifier; 239 bool m_allowCookies { false };240 mutable bool m_resourceRequestUpdated { false };241 mutable bool m_platformRequestUpdated { false };242 mutable bool m_resourceRequestBodyUpdated { false };243 mutable bool m_platformRequestBodyUpdated { false };244 bool m_hiddenFromInspector { false };245 bool m_isTopSite { false };248 bool m_allowCookies : 1; 249 mutable bool m_resourceRequestUpdated : 1; 250 mutable bool m_platformRequestUpdated : 1; 251 mutable bool m_resourceRequestBodyUpdated : 1; 252 mutable bool m_platformRequestBodyUpdated : 1; 253 bool m_hiddenFromInspector : 1; 254 bool m_isTopSite : 1; 246 255 #if USE(SYSTEM_PREVIEW) 247 256 Optional<SystemPreviewInfo> m_systemPreviewInfo; -
trunk/Source/WebCore/platform/network/ResourceResponseBase.h
r255846 r256482 49 49 public: 50 50 enum class Type : uint8_t { Basic, Cors, Default, Error, Opaque, Opaqueredirect }; 51 static constexpr unsigned bitWidthOfType = 3; 51 52 enum class Tainting : uint8_t { Basic, Cors, Opaque, Opaqueredirect }; 53 static constexpr unsigned bitWidthOfTainting = 2; 52 54 53 55 static bool isRedirectionStatusCode(int code) { return code == 301 || code == 302 || code == 303 || code == 307 || code == 308; } -
trunk/Source/WebCore/platform/network/StoredCredentialsPolicy.h
r252185 r256482 33 33 EphemeralStateless 34 34 }; 35 static constexpr unsigned bitWidthOfStoredCredentialsPolicy = 2; 35 36 36 37 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.