Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Content downloaded with fetch() API when Content-Encoding: gzip is se…
…t is not decompressed

https://bugs.webkit.org/show_bug.cgi?id=247421
rdar://101935292

Reviewed by Brent Fulgham.

In 195247@main we adopted CFNetwork SPI to opt-out of content encoding sniffing for XMLHttpRequest.
Content encoding sniffing would cause responses with `Content-Encoding: gzip` and
`Content-Type: application/octet-stream` to be treated as `Content-Type: application/gzip` and
`Content-Encoding: identity` on macOS. The user and developer visible behavior is that the gzipped data
is not decompressed.

This brings that change forward to Fetch requests by setting the ContentEncodingSniffingPolicy flag
in the FetchLoader. As an additional step this also renames the ContentEncodingSniffingPolicy flags to
Default and Disable and replaces raw bools representing those flags with the enum itself.

On iOS the flag has no effect since the default behavior is to opt-out of sniffing.

* LayoutTests/platform/mac-wk1/TestExpectations:
    Skip new worker tests since workers are unsupported in WK1.

* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.js: Added.
(string_appeared_here.forEach.contentType.promise_test.async t):
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.serviceworker-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.serviceworker.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.sharedworker-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.sharedworker.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.worker-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.worker.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/resources/foo.octetstream.gz: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/resources/foo.octetstream.gz.headers: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/resources/foo.text.gz: Added.
* LayoutTests/imported/w3c/web-platform-tests/fetch/content-encoding/resources/foo.text.gz.headers: Added.

* Source/WebCore/Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Source/WebCore/loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start):
* Source/WebCore/loader/ResourceLoader.h:
(WebCore::ResourceLoader::contentEncodingSniffingPolicy const):
(WebCore::ResourceLoader::shouldSniffContentEncoding const): Deleted.
* Source/WebCore/loader/ResourceLoaderOptions.h:
(WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
* Source/WebCore/loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::isolatedCopy const):
* Source/WebCore/platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::BlobResourceHandle):
* Source/WebCore/platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::ResourceHandle):
(WebCore::ResourceHandle::create):
(WebCore::ResourceHandle::contentEncodingSniffingPolicy const):
(WebCore::ResourceHandle::shouldContentEncodingSniff const): Deleted.
* Source/WebCore/platform/network/ResourceHandle.h:
* Source/WebCore/platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* Source/WebCore/platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* Source/WebCore/xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
* Source/WebKit/NetworkProcess/NetworkLoadParameters.h:
* Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp:
(WebKit::ServiceWorkerSoftUpdateLoader::loadFromNetwork):
* Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
* Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource):
* Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
* Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
* Source/WebKitLegacy/WebCoreSupport/PingHandle.h:

Canonical link: https://commits.webkit.org/256755@main
  • Loading branch information
rreno committed Nov 16, 2022
1 parent a8f967c commit ec8ff55
Show file tree
Hide file tree
Showing 35 changed files with 104 additions and 63 deletions.
@@ -0,0 +1,4 @@

PASS fetched gzip data with content type text should be decompressed.
PASS fetched gzip data with content type octetstream should be decompressed.

@@ -0,0 +1 @@
<!-- This file is required for WebKit test infrastructure to run the templated test -->
@@ -0,0 +1,16 @@
// META: global=window,worker

const expectedDecompressedSize = 10500;
[
"text",
"octetstream"
].forEach(contentType => {
promise_test(async t => {
let response = await fetch(`resources/foo.${contentType}.gz`);
assert_true(response.ok);
let arrayBuffer = await response.arrayBuffer()
let u8 = new Uint8Array(arrayBuffer);
assert_equals(u8.length, expectedDecompressedSize);
}, `fetched gzip data with content type ${contentType} should be decompressed.`);
});

@@ -0,0 +1,4 @@

PASS fetched gzip data with content type text should be decompressed.
PASS fetched gzip data with content type octetstream should be decompressed.

@@ -0,0 +1 @@
<!-- This file is required for WebKit test infrastructure to run the templated test -->
@@ -0,0 +1,4 @@

PASS fetched gzip data with content type text should be decompressed.
PASS fetched gzip data with content type octetstream should be decompressed.

@@ -0,0 +1 @@
<!-- This file is required for WebKit test infrastructure to run the templated test -->
@@ -0,0 +1,4 @@

PASS fetched gzip data with content type text should be decompressed.
PASS fetched gzip data with content type octetstream should be decompressed.

@@ -0,0 +1 @@
<!-- This file is required for WebKit test infrastructure to run the templated test -->
Binary file not shown.
@@ -0,0 +1,2 @@
Content-type: application/octet-stream
Content-Encoding: gzip
Binary file not shown.
@@ -0,0 +1,2 @@
Content-type: text/plain
Content-Encoding: gzip
3 changes: 3 additions & 0 deletions LayoutTests/platform/mac-wk1/TestExpectations
Expand Up @@ -722,6 +722,9 @@ imported/w3c/web-platform-tests/IndexedDB/reading-autoincrement-indexes.any.shar
imported/w3c/web-platform-tests/IndexedDB/reading-autoincrement-store-cursors.any.sharedworker.html [ Skip ]
imported/w3c/web-platform-tests/IndexedDB/reading-autoincrement-store.any.sharedworker.html [ Skip ]
imported/w3c/web-platform-tests/IndexedDB/storage-buckets.https.any.sharedworker.html [ Skip ]
imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.serviceworker.html [ Skip ]
imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.sharedworker.html [ Skip ]
imported/w3c/web-platform-tests/fetch/content-encoding/gzip-body.any.worker.html [ Skip ]

# WebKitLegacy doesn't support https-based WPT
webkit.org/b/246719 imported/w3c/web-platform-tests/reporting/generateTestReport-honors-endpoint.https.sub.html [ Failure ]
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/Modules/fetch/FetchLoader.cpp
Expand Up @@ -95,6 +95,7 @@ void FetchLoader::start(ScriptExecutionContext& context, const FetchRequest& req
options.dataBufferingPolicy = DataBufferingPolicy::DoNotBufferData;
options.sameOriginDataURLFlag = SameOriginDataURLFlag::Set;
options.navigationPreloadIdentifier = request.navigationPreloadIdentifier();
options.contentEncodingSniffingPolicy = ContentEncodingSniffingPolicy::Disable;

ResourceRequest fetchRequest = request.resourceRequest();

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/ResourceLoader.cpp
Expand Up @@ -262,7 +262,7 @@ void ResourceLoader::start()

bool isMainFrameNavigation = frame() && frame()->isMainFrame() && options().mode == FetchOptions::Mode::Navigate;

m_handle = ResourceHandle::create(frameLoader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent == ContentSniffingPolicy::SniffContent, m_options.sniffContentEncoding == ContentEncodingSniffingPolicy::Sniff, WTFMove(sourceOrigin), isMainFrameNavigation);
m_handle = ResourceHandle::create(frameLoader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent == ContentSniffingPolicy::SniffContent, m_options.contentEncodingSniffingPolicy, WTFMove(sourceOrigin), isMainFrameNavigation);
}

void ResourceLoader::setDefersLoading(bool defers)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/ResourceLoader.h
Expand Up @@ -130,7 +130,7 @@ class ResourceLoader : public CanMakeWeakPtr<ResourceLoader>, public RefCounted<
bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks == SendCallbackPolicy::SendCallbacks; }
void setSendCallbackPolicy(SendCallbackPolicy sendLoadCallbacks) { m_options.sendLoadCallbacks = sendLoadCallbacks; }
bool shouldSniffContent() const { return m_options.sniffContent == ContentSniffingPolicy::SniffContent; }
bool shouldSniffContentEncoding() const { return m_options.sniffContentEncoding == ContentEncodingSniffingPolicy::Sniff; }
ContentEncodingSniffingPolicy contentEncodingSniffingPolicy() const { return m_options.contentEncodingSniffingPolicy; }
WEBCORE_EXPORT bool isAllowedToAskUserForCredentials() const;
WEBCORE_EXPORT bool shouldIncludeCertificateInfo() const;

Expand Down
12 changes: 5 additions & 7 deletions Source/WebCore/loader/ResourceLoaderOptions.h
Expand Up @@ -126,11 +126,9 @@ enum class ApplicationCacheMode : uint8_t {
};
static constexpr unsigned bitWidthOfApplicationCacheMode = 1;

// FIXME: These options are named poorly. We only implement force disabling content encoding sniffing, not enabling it,
// and even that only on some platforms.
enum class ContentEncodingSniffingPolicy : bool {
Sniff,
DoNotSniff
Default,
Disable
};
static constexpr unsigned bitWidthOfContentEncodingSniffingPolicy = 1;

Expand Down Expand Up @@ -163,7 +161,7 @@ struct ResourceLoaderOptions : public FetchOptions {
: FetchOptions { WTFMove(options) }
, sendLoadCallbacks(SendCallbackPolicy::DoNotSendCallbacks)
, sniffContent(ContentSniffingPolicy::DoNotSniffContent)
, sniffContentEncoding(ContentEncodingSniffingPolicy::Sniff)
, contentEncodingSniffingPolicy(ContentEncodingSniffingPolicy::Default)
, dataBufferingPolicy(DataBufferingPolicy::BufferData)
, storedCredentialsPolicy(StoredCredentialsPolicy::DoNotUse)
, securityCheck(SecurityCheckPolicy::DoSecurityCheck)
Expand All @@ -184,7 +182,7 @@ struct ResourceLoaderOptions : public FetchOptions {
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)
: sendLoadCallbacks(sendLoadCallbacks)
, sniffContent(sniffContent)
, sniffContentEncoding(ContentEncodingSniffingPolicy::Sniff)
, contentEncodingSniffingPolicy(ContentEncodingSniffingPolicy::Default)
, dataBufferingPolicy(dataBufferingPolicy)
, storedCredentialsPolicy(storedCredentialsPolicy)
, securityCheck(securityCheck)
Expand Down Expand Up @@ -218,7 +216,7 @@ struct ResourceLoaderOptions : public FetchOptions {

SendCallbackPolicy sendLoadCallbacks : bitWidthOfSendCallbackPolicy;
ContentSniffingPolicy sniffContent : bitWidthOfContentSniffingPolicy;
ContentEncodingSniffingPolicy sniffContentEncoding : bitWidthOfContentEncodingSniffingPolicy;
ContentEncodingSniffingPolicy contentEncodingSniffingPolicy : bitWidthOfContentEncodingSniffingPolicy;
DataBufferingPolicy dataBufferingPolicy : bitWidthOfDataBufferingPolicy;
StoredCredentialsPolicy storedCredentialsPolicy : bitWidthOfStoredCredentialsPolicy;
SecurityCheckPolicy securityCheck : bitWidthOfSecurityCheckPolicy;
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/loader/ThreadableLoader.cpp
Expand Up @@ -83,6 +83,7 @@ ThreadableLoaderOptions ThreadableLoaderOptions::isolatedCopy() const
// ResourceLoaderOptions
copy.sendLoadCallbacks = this->sendLoadCallbacks;
copy.sniffContent = this->sniffContent;
copy.contentEncodingSniffingPolicy = this->contentEncodingSniffingPolicy;
copy.dataBufferingPolicy = this->dataBufferingPolicy;
copy.storedCredentialsPolicy = this->storedCredentialsPolicy;
copy.securityCheck = this->securityCheck;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/network/BlobResourceHandle.cpp
Expand Up @@ -155,7 +155,7 @@ void BlobResourceHandle::loadResourceSynchronously(BlobData* blobData, const Res
}

BlobResourceHandle::BlobResourceHandle(BlobData* blobData, const ResourceRequest& request, ResourceHandleClient* client, bool async)
: ResourceHandle { nullptr, request, client, false /* defersLoading */, false /* shouldContentSniff */, true /* shouldContentEncodingSniff */, nullptr /* sourceOrigin */, false /* isMainFrameNavigation */ }
: ResourceHandle { nullptr, request, client, false /* defersLoading */, false /* shouldContentSniff */, ContentEncodingSniffingPolicy::Default, nullptr /* sourceOrigin */, false /* isMainFrameNavigation */ }
, m_blobData { blobData }
, m_async { async }
{
Expand Down
12 changes: 6 additions & 6 deletions Source/WebCore/platform/network/ResourceHandle.cpp
Expand Up @@ -77,8 +77,8 @@ void ResourceHandle::registerBuiltinSynchronousLoader(const AtomString& protocol
builtinResourceHandleSynchronousLoaderMap().add(protocol, loader);
}

ResourceHandle::ResourceHandle(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation)
: d(makeUnique<ResourceHandleInternal>(this, context, request, client, defersLoading, shouldContentSniff && shouldContentSniffURL(request.url()), shouldContentEncodingSniff, WTFMove(sourceOrigin), isMainFrameNavigation))
ResourceHandle::ResourceHandle(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, ContentEncodingSniffingPolicy contentEncodingSniffingPolicy, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation)
: d(makeUnique<ResourceHandleInternal>(this, context, request, client, defersLoading, shouldContentSniff && shouldContentSniffURL(request.url()), contentEncodingSniffingPolicy, WTFMove(sourceOrigin), isMainFrameNavigation))
{
if (!request.url().isValid()) {
scheduleFailure(InvalidURLFailure);
Expand All @@ -91,14 +91,14 @@ ResourceHandle::ResourceHandle(NetworkingContext* context, const ResourceRequest
}
}

RefPtr<ResourceHandle> ResourceHandle::create(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation)
RefPtr<ResourceHandle> ResourceHandle::create(NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, ContentEncodingSniffingPolicy contentEncodingSniffingPolicy, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation)
{
if (auto protocol = request.url().protocol().toExistingAtomString(); !protocol.isNull()) {
if (auto constructor = builtinResourceHandleConstructorMap().get(protocol))
return constructor(request, client);
}

auto newHandle = adoptRef(*new ResourceHandle(context, request, client, defersLoading, shouldContentSniff, shouldContentEncodingSniff, WTFMove(sourceOrigin), isMainFrameNavigation));
auto newHandle = adoptRef(*new ResourceHandle(context, request, client, defersLoading, shouldContentSniff, contentEncodingSniffingPolicy, WTFMove(sourceOrigin), isMainFrameNavigation));

if (newHandle->d->m_scheduledFailureType != NoFailure)
return newHandle;
Expand Down Expand Up @@ -270,9 +270,9 @@ bool ResourceHandle::shouldContentSniff() const
return d->m_shouldContentSniff;
}

bool ResourceHandle::shouldContentEncodingSniff() const
ContentEncodingSniffingPolicy ResourceHandle::contentEncodingSniffingPolicy() const
{
return d->m_shouldContentEncodingSniff;
return d->m_contentEncodingSniffingPolicy;
}

bool ResourceHandle::shouldContentSniffURL(const URL& url)
Expand Down
15 changes: 8 additions & 7 deletions Source/WebCore/platform/network/ResourceHandle.h
Expand Up @@ -26,6 +26,7 @@
#pragma once

#include "AuthenticationClient.h"
#include "ResourceLoaderOptions.h"
#include "StoredCredentialsPolicy.h"
#include <wtf/Box.h>
#include <wtf/MonotonicTime.h>
Expand Down Expand Up @@ -95,7 +96,7 @@ class CurlResourceHandleDelegate;

class ResourceHandle : public RefCounted<ResourceHandle>, public AuthenticationClient {
public:
WEBCORE_EXPORT static RefPtr<ResourceHandle> create(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation);
WEBCORE_EXPORT static RefPtr<ResourceHandle> create(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, ContentEncodingSniffingPolicy, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation);
WEBCORE_EXPORT static void loadResourceSynchronously(NetworkingContext*, const ResourceRequest&, StoredCredentialsPolicy, SecurityOrigin*, ResourceError&, ResourceResponse&, Vector<uint8_t>& data);
WEBCORE_EXPORT virtual ~ResourceHandle();

Expand Down Expand Up @@ -150,7 +151,7 @@ class ResourceHandle : public RefCounted<ResourceHandle>, public AuthenticationC
bool shouldContentSniff() const;
static bool shouldContentSniffURL(const URL&);

bool shouldContentEncodingSniff() const;
ContentEncodingSniffingPolicy contentEncodingSniffingPolicy() const;

WEBCORE_EXPORT static void forceContentSniffing();

Expand Down Expand Up @@ -209,7 +210,7 @@ class ResourceHandle : public RefCounted<ResourceHandle>, public AuthenticationC
static void registerBuiltinSynchronousLoader(const AtomString& protocol, BuiltinSynchronousLoader);

protected:
ResourceHandle(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation);
ResourceHandle(NetworkingContext*, const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff, ContentEncodingSniffingPolicy, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation);

private:
enum FailureType {
Expand All @@ -235,19 +236,19 @@ class ResourceHandle : public RefCounted<ResourceHandle>, public AuthenticationC
#endif

#if USE(CFURLCONNECTION)
void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SynchronousLoaderMessageQueue>&&, CFDictionaryRef clientProperties);
void createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, ContentEncodingSniffingPolicy, RefPtr<SynchronousLoaderMessageQueue>&&, CFDictionaryRef clientProperties);
#endif

#if PLATFORM(MAC)
void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, bool shouldContentEncodingSniff, SchedulingBehavior);
void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, ContentEncodingSniffingPolicy, SchedulingBehavior);
#endif

#if PLATFORM(IOS_FAMILY)
void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, bool shouldContentEncodingSniff, SchedulingBehavior, NSDictionary *connectionProperties);
void createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, ContentEncodingSniffingPolicy, SchedulingBehavior, NSDictionary *connectionProperties);
#endif

#if PLATFORM(COCOA)
NSURLRequest *applySniffingPoliciesIfNeeded(NSURLRequest *, bool shouldContentSniff, bool shouldContentEncodingSniff);
NSURLRequest *applySniffingPoliciesIfNeeded(NSURLRequest *, bool shouldContentSniff, ContentEncodingSniffingPolicy);
#endif

#if USE(CURL)
Expand Down
6 changes: 3 additions & 3 deletions Source/WebCore/platform/network/ResourceHandleInternal.h
Expand Up @@ -65,15 +65,15 @@ class ResourceHandleInternal {
WTF_MAKE_NONCOPYABLE(ResourceHandleInternal);
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(ResourceHandleInternal);
public:
ResourceHandleInternal(ResourceHandle* loader, NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, bool shouldContentEncodingSniff, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation)
ResourceHandleInternal(ResourceHandle* loader, NetworkingContext* context, const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool shouldContentSniff, ContentEncodingSniffingPolicy contentEncodingSniffingPolicy, RefPtr<SecurityOrigin>&& sourceOrigin, bool isMainFrameNavigation)
: m_context(context)
, m_client(client)
, m_firstRequest(request)
, m_lastHTTPMethod(request.httpMethod())
, m_partition(request.cachePartition())
, m_defersLoading(defersLoading)
, m_shouldContentSniff(shouldContentSniff)
, m_shouldContentEncodingSniff(shouldContentEncodingSniff)
, m_contentEncodingSniffingPolicy(contentEncodingSniffingPolicy)
#if USE(CFURLCONNECTION)
, m_currentRequest(request)
#endif
Expand Down Expand Up @@ -107,7 +107,7 @@ class ResourceHandleInternal {

bool m_defersLoading;
bool m_shouldContentSniff;
bool m_shouldContentEncodingSniff;
ContentEncodingSniffingPolicy m_contentEncodingSniffingPolicy;
#if USE(CFURLCONNECTION)
RetainPtr<CFURLConnectionRef> m_connection;
ResourceRequest m_currentRequest;
Expand Down

0 comments on commit ec8ff55

Please sign in to comment.