Diff
Modified: trunk/Source/WebCore/ChangeLog (204013 => 204014)
--- trunk/Source/WebCore/ChangeLog 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/ChangeLog 2016-08-02 06:46:57 UTC (rev 204014)
@@ -1,3 +1,128 @@
+2016-08-01 Youenn Fablet <[email protected]>
+
+ [Fetch API] Pass directly FetchRequest fetch options to ThreadableLoader
+ https://bugs.webkit.org/show_bug.cgi?id=160407
+
+ Reviewed by Sam Weinig.
+
+ No change of behavior.
+
+ Added a ResourceLoaderOptions constructor that takes a FetchOptions as input.
+ Removed setters and getters of ResourceLoaderOptions as it is a struct.
+ Updated member fields accordingly.
+
+ Updated code accordingly.
+ Removed explicit option setting if it is the same as the default value.
+
+ * Modules/fetch/FetchLoader.cpp:
+ (WebCore::FetchLoader::start):
+ * css/CSSFontFaceSrcValue.cpp:
+ (WebCore::CSSFontFaceSrcValue::cachedFont):
+ * css/CSSImageSetValue.cpp:
+ (WebCore::CSSImageSetValue::cachedImageSet):
+ * css/CSSImageValue.cpp:
+ (WebCore::CSSImageValue::cachedImage):
+ * dom/ScriptElement.cpp:
+ (WebCore::ScriptElement::requestScript):
+ * fileapi/FileReaderLoader.cpp:
+ (WebCore::FileReaderLoader::start):
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::process):
+ * inspector/InspectorNetworkAgent.cpp:
+ (WebCore::InspectorNetworkAgent::loadResource):
+ * loader/CrossOriginPreflightChecker.cpp:
+ (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
+ (WebCore::CrossOriginPreflightChecker::startPreflight):
+ * loader/DocumentThreadableLoader.cpp:
+ (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
+ (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
+ (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
+ (WebCore::DocumentThreadableLoader::redirectReceived):
+ (WebCore::DocumentThreadableLoader::didReceiveResponse):
+ (WebCore::DocumentThreadableLoader::preflightSuccess):
+ (WebCore::DocumentThreadableLoader::loadRequest):
+ * loader/ImageLoader.cpp:
+ (WebCore::ImageLoader::updateFromElement):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::ResourceLoader):
+ (WebCore::ResourceLoader::init):
+ (WebCore::ResourceLoader::start):
+ (WebCore::ResourceLoader::setDefersLoading):
+ (WebCore::ResourceLoader::setDataBufferingPolicy):
+ (WebCore::ResourceLoader::addDataOrBuffer):
+ (WebCore::ResourceLoader::willSendRequestInternal):
+ (WebCore::ResourceLoader::didReceiveResponse):
+ (WebCore::ResourceLoader::didReceiveDataOrBuffer):
+ (WebCore::ResourceLoader::didFinishLoadingOnePart):
+ (WebCore::ResourceLoader::cleanupForError):
+ (WebCore::ResourceLoader::shouldUseCredentialStorage):
+ (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
+ * loader/ResourceLoader.h:
+ (WebCore::ResourceLoader::shouldSendResourceLoadCallbacks):
+ (WebCore::ResourceLoader::setSendCallbackPolicy):
+ (WebCore::ResourceLoader::shouldSniffContent):
+ (WebCore::ResourceLoader::shouldIncludeCertificateInfo):
+ * loader/ResourceLoaderOptions.h:
+ (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
+ (WebCore::ResourceLoaderOptions::sendLoadCallbacks): Deleted.
+ (WebCore::ResourceLoaderOptions::setSendLoadCallbacks): Deleted.
+ (WebCore::ResourceLoaderOptions::sniffContent): Deleted.
+ (WebCore::ResourceLoaderOptions::setSniffContent): Deleted.
+ (WebCore::ResourceLoaderOptions::dataBufferingPolicy): Deleted.
+ (WebCore::ResourceLoaderOptions::setDataBufferingPolicy): Deleted.
+ (WebCore::ResourceLoaderOptions::allowCredentials): Deleted.
+ (WebCore::ResourceLoaderOptions::setAllowCredentials): Deleted.
+ (WebCore::ResourceLoaderOptions::securityCheck): Deleted.
+ (WebCore::ResourceLoaderOptions::setSecurityCheck): Deleted.
+ (WebCore::ResourceLoaderOptions::certificateInfoPolicy): Deleted.
+ (WebCore::ResourceLoaderOptions::setCertificateInfoPolicy): Deleted.
+ (WebCore::ResourceLoaderOptions::contentSecurityPolicyImposition): Deleted.
+ (WebCore::ResourceLoaderOptions::setContentSecurityPolicyImposition): Deleted.
+ (WebCore::ResourceLoaderOptions::defersLoadingPolicy): Deleted.
+ (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy): Deleted.
+ (WebCore::ResourceLoaderOptions::cachingPolicy): Deleted.
+ (WebCore::ResourceLoaderOptions::setCachingPolicy): Deleted.
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
+ * loader/TextTrackLoader.cpp:
+ (WebCore::TextTrackLoader::load):
+ * loader/cache/CachedRawResource.cpp:
+ (WebCore::CachedRawResource::setDataBufferingPolicy):
+ * loader/cache/CachedResource.cpp:
+ (WebCore::CachedResource::load):
+ * loader/cache/CachedResource.h:
+ (WebCore::CachedResource::shouldSendResourceLoadCallbacks):
+ (WebCore::CachedResource::dataBufferingPolicy):
+ (WebCore::CachedResource::allowsCaching):
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::canRequest):
+ * loader/cache/CachedResourceRequest.cpp:
+ (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
+ * loader/cache/CachedResourceRequest.h:
+ (WebCore::CachedResourceRequest::allowsCaching):
+ * loader/cache/CachedResourceRequestInitiators.cpp:
+ (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
+ * loader/cache/CachedResourceRequestInitiators.h:
+ * loader/mac/ResourceLoaderMac.mm:
+ (WebCore::ResourceLoader::willCacheResponse):
+ (WebCore::ResourceLoader::didReceiveDataArray):
+ * page/EventSource.cpp:
+ (WebCore::EventSource::connect):
+ * style/StylePendingResources.cpp:
+ (WebCore::Style::loadPendingImage):
+ (WebCore::Style::loadPendingSVGFilters):
+ * svg/SVGFEImageElement.cpp:
+ (WebCore::SVGFEImageElement::requestImageResource):
+ * svg/SVGFontFaceUriElement.cpp:
+ (WebCore::SVGFontFaceUriElement::loadFont):
+ * svg/SVGUseElement.cpp:
+ (WebCore::SVGUseElement::updateExternalDocument):
+ * workers/WorkerScriptLoader.cpp:
+ (WebCore::WorkerScriptLoader::loadSynchronously):
+ (WebCore::WorkerScriptLoader::loadAsynchronously):
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::createRequest):
+
2016-08-01 Carlos Garcia Campos <[email protected]>
[GTK] Move the redirected XComposite window to the web process
Modified: trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp (204013 => 204014)
--- trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -32,6 +32,7 @@
#if ENABLE(FETCH_API)
#include "BlobURL.h"
+#include "CachedResourceRequestInitiators.h"
#include "FetchBody.h"
#include "FetchLoaderClient.h"
#include "FetchRequest.h"
@@ -59,11 +60,10 @@
request.setHTTPMethod("GET");
ThreadableLoaderOptions options;
- options.setSendLoadCallbacks(SendCallbacks);
- options.setSniffContent(DoNotSniffContent);
- options.setDataBufferingPolicy(DoNotBufferData);
+ options.sendLoadCallbacks = SendCallbacks;
+ options.dataBufferingPolicy = DoNotBufferData;
options.preflightPolicy = ConsiderPreflight;
- options.setAllowCredentials(AllowStoredCredentials);
+ options.credentials = FetchOptions::Credentials::Include;
options.mode = FetchOptions::Mode::SameOrigin;
options.contentSecurityPolicyEnforcement = ContentSecurityPolicyEnforcement::DoNotEnforce;
@@ -73,18 +73,10 @@
void FetchLoader::start(ScriptExecutionContext& context, const FetchRequest& request)
{
- ThreadableLoaderOptions options;
- options.setSendLoadCallbacks(SendCallbacks);
- options.setSniffContent(DoNotSniffContent);
- options.setDataBufferingPolicy(DoNotBufferData);
- options.preflightPolicy = ConsiderPreflight;
- options.contentSecurityPolicyEnforcement = ContentSecurityPolicyEnforcement::DoNotEnforce;
+ ThreadableLoaderOptions options(request.fetchOptions(), ConsiderPreflight, ContentSecurityPolicyEnforcement::DoNotEnforce, String(cachedResourceRequestInitiators().fetch));
+ options.sendLoadCallbacks = SendCallbacks;
+ options.dataBufferingPolicy = DoNotBufferData;
- // FIXME: Pass directly all fetch options to loader options.
- options.redirect = request.fetchOptions().redirect;
- options.mode = request.fetchOptions().mode;
- options.credentials = request.fetchOptions().credentials;
-
m_loader = ThreadableLoader::create(&context, this, request.internalRequest(), options);
m_isStarted = m_loader;
}
Modified: trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp (204013 => 204014)
--- trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -104,7 +104,7 @@
return m_cachedFont.get();
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(isInitiatingElementInUserAgentShadowTree ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
+ options.contentSecurityPolicyImposition = isInitiatingElementInUserAgentShadowTree ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
CachedResourceRequest request(ResourceRequest(document->completeURL(m_resource)), options);
request.setInitiator(cachedResourceRequestInitiators().css);
Modified: trunk/Source/WebCore/css/CSSImageSetValue.cpp (204013 => 204014)
--- trunk/Source/WebCore/css/CSSImageSetValue.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/css/CSSImageSetValue.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -120,7 +120,7 @@
request.setInitiator(cachedResourceRequestInitiators().css);
if (options.mode == FetchOptions::Mode::Cors) {
ASSERT(document->securityOrigin());
- updateRequestForAccessControl(request.mutableResourceRequest(), *document->securityOrigin(), options.allowCredentials());
+ updateRequestForAccessControl(request.mutableResourceRequest(), *document->securityOrigin(), options.allowCredentials);
}
if (CachedResourceHandle<CachedImage> cachedImage = loader.requestImage(request)) {
detachPendingImage();
Modified: trunk/Source/WebCore/css/CSSImageValue.cpp (204013 => 204014)
--- trunk/Source/WebCore/css/CSSImageValue.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/css/CSSImageValue.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -84,7 +84,7 @@
if (options.mode == FetchOptions::Mode::Cors) {
ASSERT(loader.document()->securityOrigin());
- updateRequestForAccessControl(request.mutableResourceRequest(), *loader.document()->securityOrigin(), options.allowCredentials());
+ updateRequestForAccessControl(request.mutableResourceRequest(), *loader.document()->securityOrigin(), options.allowCredentials);
}
if (CachedResourceHandle<CachedImage> cachedImage = loader.requestImage(request)) {
detachPendingImage();
Modified: trunk/Source/WebCore/dom/ScriptElement.cpp (204013 => 204014)
--- trunk/Source/WebCore/dom/ScriptElement.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/dom/ScriptElement.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -261,7 +261,7 @@
if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) {
bool hasKnownNonce = m_element.document().contentSecurityPolicy()->allowScriptWithNonce(m_element.attributeWithoutSynchronization(HTMLNames::nonceAttr), m_element.isInUserAgentShadowTree());
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(hasKnownNonce ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
+ options.contentSecurityPolicyImposition = hasKnownNonce ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
CachedResourceRequest request(ResourceRequest(m_element.document().completeURL(sourceUrl)), options);
Modified: trunk/Source/WebCore/fileapi/FileReaderLoader.cpp (204013 => 204014)
--- trunk/Source/WebCore/fileapi/FileReaderLoader.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/fileapi/FileReaderLoader.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -86,10 +86,8 @@
request.setHTTPMethod("GET");
ThreadableLoaderOptions options;
- options.setSendLoadCallbacks(SendCallbacks);
- options.setSniffContent(DoNotSniffContent);
- options.setDataBufferingPolicy(DoNotBufferData);
- options.preflightPolicy = ConsiderPreflight;
+ options.sendLoadCallbacks = SendCallbacks;
+ options.dataBufferingPolicy = DoNotBufferData;
options.credentials = FetchOptions::Credentials::Include;
options.mode = FetchOptions::Mode::SameOrigin;
options.contentSecurityPolicyEnforcement = ContentSecurityPolicyEnforcement::DoNotEnforce;
Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (204013 => 204014)
--- trunk/Source/WebCore/html/HTMLLinkElement.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -259,7 +259,7 @@
if (document().contentSecurityPolicy()->allowStyleWithNonce(attributeWithoutSynchronization(HTMLNames::nonceAttr))) {
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(ContentSecurityPolicyImposition::SkipPolicyCheck);
+ options.contentSecurityPolicyImposition = ContentSecurityPolicyImposition::SkipPolicyCheck;
request.setOptions(options);
}
request.setAsPotentiallyCrossOrigin(crossOrigin(), document());
Modified: trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp (204013 => 204014)
--- trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -670,8 +670,8 @@
request.setHiddenFromInspector(true);
ThreadableLoaderOptions options;
- options.setSendLoadCallbacks(SendCallbacks); // So we remove this from m_hiddenRequestIdentifiers on completion.
- options.setDefersLoadingPolicy(DefersLoadingPolicy::DisallowDefersLoading); // So the request is never deferred.
+ options.sendLoadCallbacks = SendCallbacks; // So we remove this from m_hiddenRequestIdentifiers on completion.
+ options.defersLoadingPolicy = DefersLoadingPolicy::DisallowDefersLoading; // So the request is never deferred.
options.mode = FetchOptions::Mode::NoCors;
options.credentials = FetchOptions::Credentials::SameOrigin;
options.contentSecurityPolicyEnforcement = ContentSecurityPolicyEnforcement::DoNotEnforce;
Modified: trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -69,12 +69,12 @@
}
String description;
- if (!passesAccessControlCheck(response, loader.options().allowCredentials(), loader.securityOrigin(), description)) {
+ if (!passesAccessControlCheck(response, loader.options().allowCredentials, loader.securityOrigin(), description)) {
loader.preflightFailure(identifier, ResourceError(errorDomainWebKitInternal, 0, request.url(), description, ResourceError::Type::AccessControl));
return;
}
- auto result = std::make_unique<CrossOriginPreflightResultCacheItem>(loader.options().allowCredentials());
+ auto result = std::make_unique<CrossOriginPreflightResultCacheItem>(loader.options().allowCredentials);
if (!result->parse(response, description)
|| !result->allowsCrossOriginMethod(request.httpMethod(), description)
|| !result->allowsCrossOriginHeaders(request.httpHeaderFields(), description)) {
@@ -100,15 +100,8 @@
void CrossOriginPreflightChecker::startPreflight()
{
- auto options = m_loader.options();
+ ResourceLoaderOptions options = static_cast<FetchOptions>(m_loader.options());
options.credentials = FetchOptions::Credentials::Omit;
- options.setSecurityCheck(DoSecurityCheck);
- // Don't sniff content or send load callbacks for the preflight request.
- options.setSendLoadCallbacks(DoNotSendCallbacks);
- options.setSniffContent(DoNotSniffContent);
- // Keep buffering the data for the preflight request.
- options.setDataBufferingPolicy(BufferData);
-
options.redirect = FetchOptions::Redirect::Manual;
CachedResourceRequest preflightRequest(createAccessControlPreflightRequest(m_request, m_loader.securityOrigin()), options);
Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -96,7 +96,7 @@
ASSERT_WITH_SECURITY_IMPLICATION(isAllowedByContentSecurityPolicy(request.url()));
- m_options.setAllowCredentials((m_options.credentials == FetchOptions::Credentials::Include || (m_options.credentials == FetchOptions::Credentials::SameOrigin && m_sameOriginRequest)) ? AllowStoredCredentials : DoNotAllowStoredCredentials);
+ m_options.allowCredentials = (m_options.credentials == FetchOptions::Credentials::Include || (m_options.credentials == FetchOptions::Credentials::SameOrigin && m_sameOriginRequest)) ? AllowStoredCredentials : DoNotAllowStoredCredentials;
if (m_sameOriginRequest || m_options.mode == FetchOptions::Mode::NoCors) {
loadRequest(WTFMove(request), DoSecurityCheck);
@@ -119,7 +119,7 @@
makeSimpleCrossOriginAccessRequest(WTFMove(request));
else {
m_simpleRequest = false;
- if (CrossOriginPreflightResultCache::singleton().canSkipPreflight(securityOrigin().toString(), request.url(), m_options.allowCredentials(), request.httpMethod(), request.httpHeaderFields()))
+ if (CrossOriginPreflightResultCache::singleton().canSkipPreflight(securityOrigin().toString(), request.url(), m_options.allowCredentials, request.httpMethod(), request.httpHeaderFields()))
preflightSuccess(WTFMove(request));
else
makeCrossOriginAccessRequestWithPreflight(WTFMove(request));
@@ -137,7 +137,7 @@
return;
}
- updateRequestForAccessControl(request, securityOrigin(), m_options.allowCredentials());
+ updateRequestForAccessControl(request, securityOrigin(), m_options.allowCredentials);
loadRequest(WTFMove(request), DoSecurityCheck);
}
@@ -227,7 +227,7 @@
if (m_simpleRequest) {
String accessControlErrorDescription;
allowRedirect = isValidCrossOriginRedirectionURL(request.url())
- && (m_sameOriginRequest || passesAccessControlCheck(redirectResponse, m_options.allowCredentials(), securityOrigin(), accessControlErrorDescription));
+ && (m_sameOriginRequest || passesAccessControlCheck(redirectResponse, m_options.allowCredentials, securityOrigin(), accessControlErrorDescription));
}
if (allowRedirect) {
@@ -245,7 +245,7 @@
m_sameOriginRequest = false;
if (m_options.credentials == FetchOptions::Credentials::SameOrigin)
- m_options.setAllowCredentials(DoNotAllowStoredCredentials);
+ m_options.allowCredentials = DoNotAllowStoredCredentials;
cleanRedirectedRequestForAccessControl(request);
@@ -277,7 +277,7 @@
String accessControlErrorDescription;
if (!m_sameOriginRequest && m_options.mode == FetchOptions::Mode::Cors) {
- if (!passesAccessControlCheck(response, m_options.allowCredentials(), securityOrigin(), accessControlErrorDescription)) {
+ if (!passesAccessControlCheck(response, m_options.allowCredentials, securityOrigin(), accessControlErrorDescription)) {
m_client->didFail(ResourceError(errorDomainWebKitInternal, 0, response.url(), accessControlErrorDescription, ResourceError::Type::AccessControl));
return;
}
@@ -334,7 +334,7 @@
void DocumentThreadableLoader::preflightSuccess(ResourceRequest&& request)
{
ResourceRequest actualRequest(WTFMove(request));
- updateRequestForAccessControl(actualRequest, securityOrigin(), m_options.allowCredentials());
+ updateRequestForAccessControl(actualRequest, securityOrigin(), m_options.allowCredentials);
m_preflightChecker = Nullopt;
@@ -357,7 +357,7 @@
{
// Any credential should have been removed from the cross-site requests.
const URL& requestURL = request.url();
- m_options.setSecurityCheck(securityCheck);
+ m_options.securityCheck = securityCheck;
ASSERT(m_sameOriginRequest || requestURL.user().isEmpty());
ASSERT(m_sameOriginRequest || requestURL.pass().isEmpty());
@@ -371,7 +371,7 @@
CachedResourceRequest newRequest(WTFMove(request), options);
if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
newRequest.setInitiator(m_options.initiator);
- newRequest.mutableResourceRequest().setAllowCookies(m_options.allowCredentials() == AllowStoredCredentials);
+ newRequest.mutableResourceRequest().setAllowCookies(m_options.allowCredentials == AllowStoredCredentials);
ASSERT(!m_resource);
m_resource = m_document.cachedResourceLoader().requestRawResource(newRequest);
@@ -393,7 +393,7 @@
auto& frameLoader = m_document.frame()->loader();
if (!frameLoader.mixedContentChecker().canRunInsecureContent(m_document.securityOrigin(), requestURL))
return;
- identifier = frameLoader.loadResourceSynchronously(request, m_options.allowCredentials(), m_options.clientCredentialPolicy, error, response, data);
+ identifier = frameLoader.loadResourceSynchronously(request, m_options.allowCredentials, m_options.clientCredentialPolicy, error, response, data);
}
if (!error.isNull() && response.httpStatusCode() <= 0) {
Modified: trunk/Source/WebCore/loader/ImageLoader.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/ImageLoader.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/ImageLoader.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -174,7 +174,7 @@
CachedResourceHandle<CachedImage> newImage = nullptr;
if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) {
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(element().isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
+ options.contentSecurityPolicyImposition = element().isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
CachedResourceRequest request(ResourceRequest(document.completeURL(sourceURI(attr))), options);
request.setInitiator(&element());
Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/ResourceLoader.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -61,7 +61,7 @@
ResourceLoader::ResourceLoader(Frame& frame, ResourceLoaderOptions options)
: m_frame(&frame)
, m_documentLoader(frame.loader().activeDocumentLoader())
- , m_defersLoading(options.defersLoadingPolicy() == DefersLoadingPolicy::AllowDefersLoading && frame.page()->defersLoading())
+ , m_defersLoading(options.defersLoadingPolicy == DefersLoadingPolicy::AllowDefersLoading && frame.page()->defersLoading())
, m_options(options)
{
}
@@ -125,9 +125,9 @@
}
#endif
- m_defersLoading = m_options.defersLoadingPolicy() == DefersLoadingPolicy::AllowDefersLoading && m_frame->page()->defersLoading();
+ m_defersLoading = m_options.defersLoadingPolicy == DefersLoadingPolicy::AllowDefersLoading && m_frame->page()->defersLoading();
- if (m_options.securityCheck() == DoSecurityCheck && !m_frame->document()->securityOrigin()->canDisplay(clientRequest.url())) {
+ if (m_options.securityCheck == DoSecurityCheck && !m_frame->document()->securityOrigin()->canDisplay(clientRequest.url())) {
FrameLoader::reportLocalLoadFailed(m_frame.get(), clientRequest.url().string());
releaseResources();
return false;
@@ -206,12 +206,12 @@
return;
}
- m_handle = ResourceHandle::create(frameLoader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent() == SniffContent);
+ m_handle = ResourceHandle::create(frameLoader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent == SniffContent);
}
void ResourceLoader::setDefersLoading(bool defers)
{
- if (m_options.defersLoadingPolicy() == DefersLoadingPolicy::DisallowDefersLoading)
+ if (m_options.defersLoadingPolicy == DefersLoadingPolicy::DisallowDefersLoading)
return;
m_defersLoading = defers;
@@ -268,14 +268,14 @@
}
void ResourceLoader::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
-{
- m_options.setDataBufferingPolicy(dataBufferingPolicy);
+{
+ m_options.dataBufferingPolicy = dataBufferingPolicy;
// Reset any already buffered data
if (dataBufferingPolicy == DoNotBufferData)
m_resourceData = nullptr;
}
-
+
void ResourceLoader::willSwitchToSubstituteResource()
{
ASSERT(!m_documentLoader->isSubstituteLoadPending(this));
@@ -286,7 +286,7 @@
void ResourceLoader::addDataOrBuffer(const char* data, unsigned length, SharedBuffer* buffer, DataPayloadType dataPayloadType)
{
- if (m_options.dataBufferingPolicy() == DoNotBufferData)
+ if (m_options.dataBufferingPolicy == DoNotBufferData)
return;
if (!m_resourceData || dataPayloadType == DataPayloadWholeResource) {
@@ -350,7 +350,7 @@
return;
}
- if (m_options.sendLoadCallbacks() == SendCallbacks) {
+ if (m_options.sendLoadCallbacks == SendCallbacks) {
if (createdResourceIdentifier)
frameLoader()->notifier().assignIdentifierToInitialRequest(m_identifier, documentLoader(), request);
@@ -458,8 +458,8 @@
if (FormData* data = ""
data->removeGeneratedFilesIfNeeded();
-
- if (m_options.sendLoadCallbacks() == SendCallbacks)
+
+ if (m_options.sendLoadCallbacks == SendCallbacks)
frameLoader()->notifier().didReceiveResponse(this, m_response);
}
@@ -489,11 +489,11 @@
Ref<ResourceLoader> protectedThis(*this);
addDataOrBuffer(data, length, buffer.get(), dataPayloadType);
-
+
// FIXME: If we get a resource with more than 2B bytes, this code won't do the right thing.
// However, with today's computers and networking speeds, this won't happen in practice.
// Could be an issue with a giant local file.
- if (m_options.sendLoadCallbacks() == SendCallbacks && m_frame)
+ if (m_options.sendLoadCallbacks == SendCallbacks && m_frame)
frameLoader()->notifier().didReceiveData(this, buffer ? buffer->data() : data, buffer ? buffer->size() : length, static_cast<int>(encodedDataLength));
}
@@ -519,7 +519,7 @@
if (m_notifiedLoadComplete)
return;
m_notifiedLoadComplete = true;
- if (m_options.sendLoadCallbacks() == SendCallbacks)
+ if (m_options.sendLoadCallbacks == SendCallbacks)
frameLoader()->notifier().didFinishLoad(this, finishTime);
}
@@ -545,7 +545,7 @@
if (m_notifiedLoadComplete)
return;
m_notifiedLoadComplete = true;
- if (m_options.sendLoadCallbacks() == SendCallbacks && m_identifier)
+ if (m_options.sendLoadCallbacks == SendCallbacks && m_identifier)
frameLoader()->notifier().didFailToLoad(this, error);
}
@@ -678,9 +678,9 @@
bool ResourceLoader::shouldUseCredentialStorage()
{
- if (m_options.allowCredentials() == DoNotAllowStoredCredentials)
+ if (m_options.allowCredentials == DoNotAllowStoredCredentials)
return false;
-
+
Ref<ResourceLoader> protectedThis(*this);
return frameLoader()->client().shouldUseCredentialStorage(documentLoader(), identifier());
}
@@ -700,7 +700,7 @@
// anything including possibly derefing this; one example of this is Radar 3266216.
Ref<ResourceLoader> protectedThis(*this);
- if (m_options.allowCredentials() == AllowStoredCredentials) {
+ if (m_options.allowCredentials == AllowStoredCredentials) {
if (isAllowedToAskUserForCredentials()) {
frameLoader()->notifier().didReceiveAuthenticationChallenge(this, challenge);
return;
Modified: trunk/Source/WebCore/loader/ResourceLoader.h (204013 => 204014)
--- trunk/Source/WebCore/loader/ResourceLoader.h 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/ResourceLoader.h 2016-08-02 06:46:57 UTC (rev 204014)
@@ -125,11 +125,11 @@
const URL& url() const { return m_request.url(); }
ResourceHandle* handle() const { return m_handle.get(); }
- bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks() == SendCallbacks; }
- void setSendCallbackPolicy(SendCallbackPolicy sendLoadCallbacks) { m_options.setSendLoadCallbacks(sendLoadCallbacks); }
- bool shouldSniffContent() const { return m_options.sniffContent() == SniffContent; }
+ bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks == SendCallbacks; }
+ void setSendCallbackPolicy(SendCallbackPolicy sendLoadCallbacks) { m_options.sendLoadCallbacks = sendLoadCallbacks; }
+ bool shouldSniffContent() const { return m_options.sniffContent == SniffContent; }
WEBCORE_EXPORT bool isAllowedToAskUserForCredentials() const;
- bool shouldIncludeCertificateInfo() const { return m_options.certificateInfoPolicy() == IncludeCertificateInfo; }
+ bool shouldIncludeCertificateInfo() const { return m_options.certificateInfoPolicy == IncludeCertificateInfo; }
bool reachedTerminalState() const { return m_reachedTerminalState; }
Modified: trunk/Source/WebCore/loader/ResourceLoaderOptions.h (204013 => 204014)
--- trunk/Source/WebCore/loader/ResourceLoaderOptions.h 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/ResourceLoaderOptions.h 2016-08-02 06:46:57 UTC (rev 204014)
@@ -81,26 +81,20 @@
};
struct ResourceLoaderOptions : public FetchOptions {
- ResourceLoaderOptions()
- : m_sendLoadCallbacks(DoNotSendCallbacks)
- , m_sniffContent(DoNotSniffContent)
- , m_dataBufferingPolicy(BufferData)
- , m_allowCredentials(DoNotAllowStoredCredentials)
- , m_securityCheck(DoSecurityCheck)
- , m_certificateInfoPolicy(DoNotIncludeCertificateInfo)
- {
- }
+ ResourceLoaderOptions() { }
+ ResourceLoaderOptions(const FetchOptions& options) : FetchOptions(options) { }
+
ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentials allowCredentials, ClientCredentialPolicy credentialPolicy, FetchOptions::Credentials credentials, SecurityCheckPolicy securityCheck, FetchOptions::Mode mode, CertificateInfoPolicy certificateInfoPolicy, ContentSecurityPolicyImposition contentSecurityPolicyImposition, DefersLoadingPolicy defersLoadingPolicy, CachingPolicy cachingPolicy)
- : m_sendLoadCallbacks(sendLoadCallbacks)
- , m_sniffContent(sniffContent)
- , m_dataBufferingPolicy(dataBufferingPolicy)
- , m_allowCredentials(allowCredentials)
- , m_securityCheck(securityCheck)
- , m_certificateInfoPolicy(certificateInfoPolicy)
- , m_contentSecurityPolicyImposition(contentSecurityPolicyImposition)
- , m_defersLoadingPolicy(defersLoadingPolicy)
- , m_cachingPolicy(cachingPolicy)
+ : sendLoadCallbacks(sendLoadCallbacks)
+ , sniffContent(sniffContent)
+ , dataBufferingPolicy(dataBufferingPolicy)
+ , allowCredentials(allowCredentials)
+ , securityCheck(securityCheck)
+ , certificateInfoPolicy(certificateInfoPolicy)
+ , contentSecurityPolicyImposition(contentSecurityPolicyImposition)
+ , defersLoadingPolicy(defersLoadingPolicy)
+ , cachingPolicy(cachingPolicy)
, clientCredentialPolicy(credentialPolicy)
{
this->credentials = credentials;
@@ -107,35 +101,16 @@
this->mode = mode;
}
- SendCallbackPolicy sendLoadCallbacks() const { return static_cast<SendCallbackPolicy>(m_sendLoadCallbacks); }
- void setSendLoadCallbacks(SendCallbackPolicy allow) { m_sendLoadCallbacks = allow; }
- ContentSniffingPolicy sniffContent() const { return static_cast<ContentSniffingPolicy>(m_sniffContent); }
- void setSniffContent(ContentSniffingPolicy policy) { m_sniffContent = policy; }
- DataBufferingPolicy dataBufferingPolicy() const { return static_cast<DataBufferingPolicy>(m_dataBufferingPolicy); }
- void setDataBufferingPolicy(DataBufferingPolicy policy) { m_dataBufferingPolicy = policy; }
- StoredCredentials allowCredentials() const { return static_cast<StoredCredentials>(m_allowCredentials); }
- void setAllowCredentials(StoredCredentials allow) { m_allowCredentials = allow; }
- SecurityCheckPolicy securityCheck() const { return static_cast<SecurityCheckPolicy>(m_securityCheck); }
- void setSecurityCheck(SecurityCheckPolicy check) { m_securityCheck = check; }
- CertificateInfoPolicy certificateInfoPolicy() const { return static_cast<CertificateInfoPolicy>(m_certificateInfoPolicy); }
- void setCertificateInfoPolicy(CertificateInfoPolicy policy) { m_certificateInfoPolicy = policy; }
- ContentSecurityPolicyImposition contentSecurityPolicyImposition() const { return m_contentSecurityPolicyImposition; }
- void setContentSecurityPolicyImposition(ContentSecurityPolicyImposition imposition) { m_contentSecurityPolicyImposition = imposition; }
- DefersLoadingPolicy defersLoadingPolicy() const { return m_defersLoadingPolicy; }
- void setDefersLoadingPolicy(DefersLoadingPolicy defersLoadingPolicy) { m_defersLoadingPolicy = defersLoadingPolicy; }
- CachingPolicy cachingPolicy() const { return m_cachingPolicy; }
- void setCachingPolicy(CachingPolicy cachingPolicy) { m_cachingPolicy = cachingPolicy; }
+ SendCallbackPolicy sendLoadCallbacks { DoNotSendCallbacks };
+ ContentSniffingPolicy sniffContent { DoNotSniffContent };
+ DataBufferingPolicy dataBufferingPolicy { BufferData };
+ StoredCredentials allowCredentials { DoNotAllowStoredCredentials };
+ SecurityCheckPolicy securityCheck { DoSecurityCheck };
+ CertificateInfoPolicy certificateInfoPolicy { DoNotIncludeCertificateInfo };
+ ContentSecurityPolicyImposition contentSecurityPolicyImposition { ContentSecurityPolicyImposition::DoPolicyCheck };
+ DefersLoadingPolicy defersLoadingPolicy { DefersLoadingPolicy::AllowDefersLoading };
+ CachingPolicy cachingPolicy { CachingPolicy::AllowCaching };
- unsigned m_sendLoadCallbacks : 1;
- unsigned m_sniffContent : 1;
- unsigned m_dataBufferingPolicy : 1;
- unsigned m_allowCredentials : 1; // Whether HTTP credentials and cookies are sent with the request.
- unsigned m_securityCheck : 1;
- unsigned m_certificateInfoPolicy : 1; // Whether the response should include certificate info.
- ContentSecurityPolicyImposition m_contentSecurityPolicyImposition { ContentSecurityPolicyImposition::DoPolicyCheck };
- DefersLoadingPolicy m_defersLoadingPolicy { DefersLoadingPolicy::AllowDefersLoading };
- CachingPolicy m_cachingPolicy { CachingPolicy::AllowCaching };
-
ClientCredentialPolicy clientCredentialPolicy { ClientCredentialPolicy::CannotAskClientForCredentials };
};
Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/SubresourceLoader.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -415,7 +415,7 @@
ASSERT(m_origin);
String errorDescription;
bool responsePassesCORS = m_origin->canRequest(previousRequest.url())
- || passesAccessControlCheck(redirectResponse, options().allowCredentials(), *m_origin, errorDescription);
+ || passesAccessControlCheck(redirectResponse, options().allowCredentials, *m_origin, errorDescription);
if (!responsePassesCORS || !isValidCrossOriginRedirectionURL(newRequest.url())) {
if (m_frame && m_frame->document()) {
String errorMessage = "Cross-origin redirection denied by Cross-Origin Resource Sharing policy: " +
@@ -428,7 +428,7 @@
// If the request URL origin is not the same as the original origin, the request origin should be set to a globally unique identifier.
m_origin = SecurityOrigin::createUnique();
cleanRedirectedRequestForAccessControl(newRequest);
- updateRequestForAccessControl(newRequest, *m_origin, options().allowCredentials());
+ updateRequestForAccessControl(newRequest, *m_origin, options().allowCredentials);
return true;
}
Modified: trunk/Source/WebCore/loader/TextTrackLoader.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/TextTrackLoader.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/TextTrackLoader.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -153,7 +153,7 @@
Document* document = downcast<Document>(m_scriptExecutionContext);
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(isInitiatingElementInUserAgentShadowTree ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
+ options.contentSecurityPolicyImposition = isInitiatingElementInUserAgentShadowTree ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
CachedResourceRequest cueRequest(ResourceRequest(document->completeURL(url)), options);
Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/cache/CachedRawResource.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -220,7 +220,7 @@
void CachedRawResource::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
{
- m_options.setDataBufferingPolicy(dataBufferingPolicy);
+ m_options.dataBufferingPolicy = dataBufferingPolicy;
}
static bool shouldIgnoreHeaderForCacheReuse(HTTPHeaderName name)
Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/cache/CachedResource.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -237,7 +237,7 @@
}
FrameLoader& frameLoader = frame.loader();
- if (options.securityCheck() == DoSecurityCheck && (frameLoader.state() == FrameStateProvisional || !frameLoader.activeDocumentLoader() || frameLoader.activeDocumentLoader()->isStopping())) {
+ if (options.securityCheck == DoSecurityCheck && (frameLoader.state() == FrameStateProvisional || !frameLoader.activeDocumentLoader() || frameLoader.activeDocumentLoader()->isStopping())) {
failBeforeStarting();
return;
}
Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (204013 => 204014)
--- trunk/Source/WebCore/loader/cache/CachedResource.h 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h 2016-08-02 06:46:57 UTC (rev 204014)
@@ -226,10 +226,10 @@
bool errorOccurred() const { return m_status == LoadError || m_status == DecodeError; }
bool loadFailedOrCanceled() const { return !m_error.isNull(); }
- bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks() == SendCallbacks; }
- DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBufferingPolicy(); }
+ bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks == SendCallbacks; }
+ DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBufferingPolicy; }
- bool allowsCaching() const { return m_options.cachingPolicy() == CachingPolicy::AllowCaching; }
+ bool allowsCaching() const { return m_options.cachingPolicy == CachingPolicy::AllowCaching; }
virtual void destroyDecodedData() { }
Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -390,7 +390,7 @@
return false;
}
- bool skipContentSecurityPolicyCheck = options.contentSecurityPolicyImposition() == ContentSecurityPolicyImposition::SkipPolicyCheck;
+ bool skipContentSecurityPolicyCheck = options.contentSecurityPolicyImposition == ContentSecurityPolicyImposition::SkipPolicyCheck;
ContentSecurityPolicy::RedirectResponseReceived redirectResponseReceived = didReceiveRedirectResponse ? ContentSecurityPolicy::RedirectResponseReceived::Yes : ContentSecurityPolicy::RedirectResponseReceived::No;
// Some types of resources can be loaded only from the same origin. Other
Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -100,10 +100,10 @@
return;
m_options.mode = FetchOptions::Mode::Cors;
m_options.credentials = equalLettersIgnoringASCIICase(mode, "use-credentials") ? FetchOptions::Credentials::Include : FetchOptions::Credentials::SameOrigin;
- m_options.setAllowCredentials(equalLettersIgnoringASCIICase(mode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials);
+ m_options.allowCredentials = equalLettersIgnoringASCIICase(mode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
ASSERT(document.securityOrigin());
- updateRequestForAccessControl(m_resourceRequest, *document.securityOrigin(), m_options.allowCredentials());
+ updateRequestForAccessControl(m_resourceRequest, *document.securityOrigin(), m_options.allowCredentials);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequest.h (204013 => 204014)
--- trunk/Source/WebCore/loader/cache/CachedResourceRequest.h 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequest.h 2016-08-02 06:46:57 UTC (rev 204014)
@@ -60,7 +60,7 @@
void setInitiator(PassRefPtr<Element>);
void setInitiator(const AtomicString& name);
const AtomicString& initiatorName() const;
- bool allowsCaching() const { return m_options.cachingPolicy() == CachingPolicy::AllowCaching; }
+ bool allowsCaching() const { return m_options.cachingPolicy == CachingPolicy::AllowCaching; }
void setInitiator(DocumentLoader&);
DocumentLoader* initiatingDocumentLoader() const { return m_initiatingDocumentLoader.get(); }
Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -30,6 +30,7 @@
CachedResourceRequestInitiators::CachedResourceRequestInitiators()
: css("css", AtomicString::ConstructFromLiteral)
+ , fetch("fetch", AtomicString::ConstructFromLiteral)
, icon("icon", AtomicString::ConstructFromLiteral)
, xmlhttprequest("xmlhttprequest", AtomicString::ConstructFromLiteral)
{
Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.h (204013 => 204014)
--- trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.h 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.h 2016-08-02 06:46:57 UTC (rev 204014)
@@ -35,6 +35,7 @@
CachedResourceRequestInitiators();
const AtomicString css;
+ const AtomicString fetch;
const AtomicString icon;
const AtomicString xmlhttprequest;
WTF_MAKE_NONCOPYABLE(CachedResourceRequestInitiators); WTF_MAKE_FAST_ALLOCATED;
Modified: trunk/Source/WebCore/loader/cf/ResourceLoaderCFNet.cpp (204013 => 204014)
--- trunk/Source/WebCore/loader/cf/ResourceLoaderCFNet.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/cf/ResourceLoaderCFNet.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -37,7 +37,7 @@
bool ResourceLoader::shouldCacheResponse(ResourceHandle*, CFCachedURLResponseRef cachedResponse)
{
- if (m_options.sendLoadCallbacks() == DoNotSendCallbacks)
+ if (m_options.sendLoadCallbacks == DoNotSendCallbacks)
return false;
CFURLResponseRef response = CFCachedURLResponseGetWrappedResponse(cachedResponse);
Modified: trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm (204013 => 204014)
--- trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm 2016-08-02 06:46:57 UTC (rev 204014)
@@ -51,7 +51,7 @@
NSCachedURLResponse* ResourceLoader::willCacheResponse(ResourceHandle*, NSCachedURLResponse* response)
{
- if (m_options.sendLoadCallbacks() == DoNotSendCallbacks)
+ if (m_options.sendLoadCallbacks == DoNotSendCallbacks)
return nullptr;
return frameLoader()->client().willCacheResponse(documentLoader(), identifier(), response);
}
@@ -71,7 +71,7 @@
CFDataRef data = "" i));
unsigned dataLen = static_cast<unsigned>(CFDataGetLength(data));
- if (m_options.dataBufferingPolicy() == BufferData) {
+ if (m_options.dataBufferingPolicy == BufferData) {
if (!m_resourceData)
m_resourceData = SharedBuffer::create();
m_resourceData->append(data);
@@ -80,7 +80,7 @@
// FIXME: If we get a resource with more than 2B bytes, this code won't do the right thing.
// However, with today's computers and networking speeds, this won't happen in practice.
// Could be an issue with a giant local file.
- if (m_options.sendLoadCallbacks() == SendCallbacks && m_frame)
+ if (m_options.sendLoadCallbacks == SendCallbacks && m_frame)
frameLoader()->notifier().didReceiveData(this, reinterpret_cast<const char*>(CFDataGetBytePtr(data)), dataLen, dataLen);
}
}
Modified: trunk/Source/WebCore/page/EventSource.cpp (204013 => 204014)
--- trunk/Source/WebCore/page/EventSource.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/page/EventSource.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -104,12 +104,11 @@
request.setHTTPHeaderField(HTTPHeaderName::LastEventID, m_lastEventId);
ThreadableLoaderOptions options;
- options.setSendLoadCallbacks(SendCallbacks);
- options.setSniffContent(DoNotSniffContent);
+ options.sendLoadCallbacks = SendCallbacks;
options.credentials = m_withCredentials ? FetchOptions::Credentials::Include : FetchOptions::Credentials::SameOrigin;
options.preflightPolicy = PreventPreflight;
options.mode = FetchOptions::Mode::Cors;
- options.setDataBufferingPolicy(DoNotBufferData);
+ options.dataBufferingPolicy = DoNotBufferData;
options.contentSecurityPolicyEnforcement = scriptExecutionContext()->shouldBypassMainWorldContentSecurityPolicy() ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceConnectSrcDirective;
m_loader = ThreadableLoader::create(scriptExecutionContext(), this, WTFMove(request), options);
Modified: trunk/Source/WebCore/style/StylePendingResources.cpp (204013 => 204014)
--- trunk/Source/WebCore/style/StylePendingResources.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/style/StylePendingResources.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -48,12 +48,12 @@
{
auto& pendingImage = downcast<StylePendingImage>(image);
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(element && element->isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
+ options.contentSecurityPolicyImposition = element && element->isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
// FIXME: Why does shape-outside have different policy than other properties?
if (loadPolicy == LoadPolicy::ShapeOutside) {
options.mode = FetchOptions::Mode::Cors;
- options.setAllowCredentials(DoNotAllowStoredCredentials);
+ options.allowCredentials = DoNotAllowStoredCredentials;
}
if (auto imageValue = pendingImage.cssImageValue())
@@ -171,7 +171,7 @@
return;
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(element && element->isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
+ options.contentSecurityPolicyImposition = element && element->isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
for (auto& filterOperation : pendingResources.pendingSVGFilters)
filterOperation->getOrCreateCachedSVGDocumentReference()->load(document.cachedResourceLoader(), options);
Modified: trunk/Source/WebCore/svg/SVGFEImageElement.cpp (204013 => 204014)
--- trunk/Source/WebCore/svg/SVGFEImageElement.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/svg/SVGFEImageElement.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -86,7 +86,7 @@
void SVGFEImageElement::requestImageResource()
{
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
+ options.contentSecurityPolicyImposition = isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
CachedResourceRequest request(ResourceRequest(document().completeURL(href())), options);
request.setInitiator(this);
Modified: trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp (204013 => 204014)
--- trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -101,7 +101,7 @@
const AtomicString& href = ""
if (!href.isNull()) {
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
+ options.contentSecurityPolicyImposition = isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
CachedResourceLoader& cachedResourceLoader = document().cachedResourceLoader();
CachedResourceRequest request(ResourceRequest(document().completeURL(href)), options);
Modified: trunk/Source/WebCore/svg/SVGUseElement.cpp (204013 => 204014)
--- trunk/Source/WebCore/svg/SVGUseElement.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/svg/SVGUseElement.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -569,7 +569,7 @@
m_externalDocument = nullptr;
else {
ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
- options.setContentSecurityPolicyImposition(isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
+ options.contentSecurityPolicyImposition = isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
CachedResourceRequest request { ResourceRequest { externalDocumentURL }, options };
request.setInitiator(this);
Modified: trunk/Source/WebCore/workers/WorkerScriptLoader.cpp (204013 => 204014)
--- trunk/Source/WebCore/workers/WorkerScriptLoader.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/workers/WorkerScriptLoader.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -70,7 +70,7 @@
ThreadableLoaderOptions options;
options.credentials = FetchOptions::Credentials::Include;
options.mode = mode;
- options.setSendLoadCallbacks(SendCallbacks);
+ options.sendLoadCallbacks = SendCallbacks;
options.contentSecurityPolicyEnforcement = contentSecurityPolicyEnforcement;
WorkerThreadableLoader::loadResourceSynchronously(downcast<WorkerGlobalScope>(scriptExecutionContext), WTFMove(*request), *this, options);
@@ -93,7 +93,7 @@
ThreadableLoaderOptions options;
options.credentials = FetchOptions::Credentials::SameOrigin;
options.mode = mode;
- options.setSendLoadCallbacks(SendCallbacks);
+ options.sendLoadCallbacks = SendCallbacks;
options.contentSecurityPolicyEnforcement = contentSecurityPolicyEnforcement;
// During create, callbacks may happen which remove the last reference to this object.
Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (204013 => 204014)
--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2016-08-02 06:42:18 UTC (rev 204013)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2016-08-02 06:46:57 UTC (rev 204014)
@@ -687,8 +687,7 @@
request.setHTTPHeaderFields(m_requestHeaders);
ThreadableLoaderOptions options;
- options.setSendLoadCallbacks(SendCallbacks);
- options.setSniffContent(DoNotSniffContent);
+ options.sendLoadCallbacks = SendCallbacks;
options.preflightPolicy = uploadEvents ? ForcePreflight : ConsiderPreflight;
options.credentials = m_includeCredentials ? FetchOptions::Credentials::Include : FetchOptions::Credentials::SameOrigin;
options.mode = FetchOptions::Mode::Cors;