Changeset 204014 in webkit


Ignore:
Timestamp:
Aug 1, 2016 11:46:57 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[Fetch API] Pass directly FetchRequest fetch options to ThreadableLoader
https://bugs.webkit.org/show_bug.cgi?id=160407

Patch by Youenn Fablet <youenn@apple.com> on 2016-08-01
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):

Location:
trunk/Source/WebCore
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r204013 r204014  
     12016-08-01  Youenn Fablet  <youenn@apple.com>
     2
     3        [Fetch API] Pass directly FetchRequest fetch options to ThreadableLoader
     4        https://bugs.webkit.org/show_bug.cgi?id=160407
     5
     6        Reviewed by Sam Weinig.
     7
     8        No change of behavior.
     9
     10        Added a ResourceLoaderOptions constructor that takes a FetchOptions as input.
     11        Removed setters and getters of ResourceLoaderOptions as it is a struct.
     12        Updated member fields accordingly.
     13
     14        Updated code accordingly.
     15        Removed explicit option setting if it is the same as the default value.
     16
     17        * Modules/fetch/FetchLoader.cpp:
     18        (WebCore::FetchLoader::start):
     19        * css/CSSFontFaceSrcValue.cpp:
     20        (WebCore::CSSFontFaceSrcValue::cachedFont):
     21        * css/CSSImageSetValue.cpp:
     22        (WebCore::CSSImageSetValue::cachedImageSet):
     23        * css/CSSImageValue.cpp:
     24        (WebCore::CSSImageValue::cachedImage):
     25        * dom/ScriptElement.cpp:
     26        (WebCore::ScriptElement::requestScript):
     27        * fileapi/FileReaderLoader.cpp:
     28        (WebCore::FileReaderLoader::start):
     29        * html/HTMLLinkElement.cpp:
     30        (WebCore::HTMLLinkElement::process):
     31        * inspector/InspectorNetworkAgent.cpp:
     32        (WebCore::InspectorNetworkAgent::loadResource):
     33        * loader/CrossOriginPreflightChecker.cpp:
     34        (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
     35        (WebCore::CrossOriginPreflightChecker::startPreflight):
     36        * loader/DocumentThreadableLoader.cpp:
     37        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
     38        (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
     39        (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
     40        (WebCore::DocumentThreadableLoader::redirectReceived):
     41        (WebCore::DocumentThreadableLoader::didReceiveResponse):
     42        (WebCore::DocumentThreadableLoader::preflightSuccess):
     43        (WebCore::DocumentThreadableLoader::loadRequest):
     44        * loader/ImageLoader.cpp:
     45        (WebCore::ImageLoader::updateFromElement):
     46        * loader/ResourceLoader.cpp:
     47        (WebCore::ResourceLoader::ResourceLoader):
     48        (WebCore::ResourceLoader::init):
     49        (WebCore::ResourceLoader::start):
     50        (WebCore::ResourceLoader::setDefersLoading):
     51        (WebCore::ResourceLoader::setDataBufferingPolicy):
     52        (WebCore::ResourceLoader::addDataOrBuffer):
     53        (WebCore::ResourceLoader::willSendRequestInternal):
     54        (WebCore::ResourceLoader::didReceiveResponse):
     55        (WebCore::ResourceLoader::didReceiveDataOrBuffer):
     56        (WebCore::ResourceLoader::didFinishLoadingOnePart):
     57        (WebCore::ResourceLoader::cleanupForError):
     58        (WebCore::ResourceLoader::shouldUseCredentialStorage):
     59        (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
     60        * loader/ResourceLoader.h:
     61        (WebCore::ResourceLoader::shouldSendResourceLoadCallbacks):
     62        (WebCore::ResourceLoader::setSendCallbackPolicy):
     63        (WebCore::ResourceLoader::shouldSniffContent):
     64        (WebCore::ResourceLoader::shouldIncludeCertificateInfo):
     65        * loader/ResourceLoaderOptions.h:
     66        (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
     67        (WebCore::ResourceLoaderOptions::sendLoadCallbacks): Deleted.
     68        (WebCore::ResourceLoaderOptions::setSendLoadCallbacks): Deleted.
     69        (WebCore::ResourceLoaderOptions::sniffContent): Deleted.
     70        (WebCore::ResourceLoaderOptions::setSniffContent): Deleted.
     71        (WebCore::ResourceLoaderOptions::dataBufferingPolicy): Deleted.
     72        (WebCore::ResourceLoaderOptions::setDataBufferingPolicy): Deleted.
     73        (WebCore::ResourceLoaderOptions::allowCredentials): Deleted.
     74        (WebCore::ResourceLoaderOptions::setAllowCredentials): Deleted.
     75        (WebCore::ResourceLoaderOptions::securityCheck): Deleted.
     76        (WebCore::ResourceLoaderOptions::setSecurityCheck): Deleted.
     77        (WebCore::ResourceLoaderOptions::certificateInfoPolicy): Deleted.
     78        (WebCore::ResourceLoaderOptions::setCertificateInfoPolicy): Deleted.
     79        (WebCore::ResourceLoaderOptions::contentSecurityPolicyImposition): Deleted.
     80        (WebCore::ResourceLoaderOptions::setContentSecurityPolicyImposition): Deleted.
     81        (WebCore::ResourceLoaderOptions::defersLoadingPolicy): Deleted.
     82        (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy): Deleted.
     83        (WebCore::ResourceLoaderOptions::cachingPolicy): Deleted.
     84        (WebCore::ResourceLoaderOptions::setCachingPolicy): Deleted.
     85        * loader/SubresourceLoader.cpp:
     86        (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
     87        * loader/TextTrackLoader.cpp:
     88        (WebCore::TextTrackLoader::load):
     89        * loader/cache/CachedRawResource.cpp:
     90        (WebCore::CachedRawResource::setDataBufferingPolicy):
     91        * loader/cache/CachedResource.cpp:
     92        (WebCore::CachedResource::load):
     93        * loader/cache/CachedResource.h:
     94        (WebCore::CachedResource::shouldSendResourceLoadCallbacks):
     95        (WebCore::CachedResource::dataBufferingPolicy):
     96        (WebCore::CachedResource::allowsCaching):
     97        * loader/cache/CachedResourceLoader.cpp:
     98        (WebCore::CachedResourceLoader::canRequest):
     99        * loader/cache/CachedResourceRequest.cpp:
     100        (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
     101        * loader/cache/CachedResourceRequest.h:
     102        (WebCore::CachedResourceRequest::allowsCaching):
     103        * loader/cache/CachedResourceRequestInitiators.cpp:
     104        (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
     105        * loader/cache/CachedResourceRequestInitiators.h:
     106        * loader/mac/ResourceLoaderMac.mm:
     107        (WebCore::ResourceLoader::willCacheResponse):
     108        (WebCore::ResourceLoader::didReceiveDataArray):
     109        * page/EventSource.cpp:
     110        (WebCore::EventSource::connect):
     111        * style/StylePendingResources.cpp:
     112        (WebCore::Style::loadPendingImage):
     113        (WebCore::Style::loadPendingSVGFilters):
     114        * svg/SVGFEImageElement.cpp:
     115        (WebCore::SVGFEImageElement::requestImageResource):
     116        * svg/SVGFontFaceUriElement.cpp:
     117        (WebCore::SVGFontFaceUriElement::loadFont):
     118        * svg/SVGUseElement.cpp:
     119        (WebCore::SVGUseElement::updateExternalDocument):
     120        * workers/WorkerScriptLoader.cpp:
     121        (WebCore::WorkerScriptLoader::loadSynchronously):
     122        (WebCore::WorkerScriptLoader::loadAsynchronously):
     123        * xml/XMLHttpRequest.cpp:
     124        (WebCore::XMLHttpRequest::createRequest):
     125
    11262016-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>
    2127
  • trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp

    r203971 r204014  
    3333
    3434#include "BlobURL.h"
     35#include "CachedResourceRequestInitiators.h"
    3536#include "FetchBody.h"
    3637#include "FetchLoaderClient.h"
     
    6061
    6162    ThreadableLoaderOptions options;
    62     options.setSendLoadCallbacks(SendCallbacks);
    63     options.setSniffContent(DoNotSniffContent);
    64     options.setDataBufferingPolicy(DoNotBufferData);
     63    options.sendLoadCallbacks = SendCallbacks;
     64    options.dataBufferingPolicy = DoNotBufferData;
    6565    options.preflightPolicy = ConsiderPreflight;
    66     options.setAllowCredentials(AllowStoredCredentials);
     66    options.credentials = FetchOptions::Credentials::Include;
    6767    options.mode = FetchOptions::Mode::SameOrigin;
    6868    options.contentSecurityPolicyEnforcement = ContentSecurityPolicyEnforcement::DoNotEnforce;
     
    7474void FetchLoader::start(ScriptExecutionContext& context, const FetchRequest& request)
    7575{
    76     ThreadableLoaderOptions options;
    77     options.setSendLoadCallbacks(SendCallbacks);
    78     options.setSniffContent(DoNotSniffContent);
    79     options.setDataBufferingPolicy(DoNotBufferData);
    80     options.preflightPolicy = ConsiderPreflight;
    81     options.contentSecurityPolicyEnforcement = ContentSecurityPolicyEnforcement::DoNotEnforce;
    82 
    83     // FIXME: Pass directly all fetch options to loader options.
    84     options.redirect = request.fetchOptions().redirect;
    85     options.mode = request.fetchOptions().mode;
    86     options.credentials = request.fetchOptions().credentials;
     76    ThreadableLoaderOptions options(request.fetchOptions(), ConsiderPreflight, ContentSecurityPolicyEnforcement::DoNotEnforce, String(cachedResourceRequestInitiators().fetch));
     77    options.sendLoadCallbacks = SendCallbacks;
     78    options.dataBufferingPolicy = DoNotBufferData;
    8779
    8880    m_loader = ThreadableLoader::create(&context, this, request.internalRequest(), options);
  • trunk/Source/WebCore/css/CSSFontFaceSrcValue.cpp

    r195452 r204014  
    105105
    106106    ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    107     options.setContentSecurityPolicyImposition(isInitiatingElementInUserAgentShadowTree ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
     107    options.contentSecurityPolicyImposition = isInitiatingElementInUserAgentShadowTree ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
    108108
    109109    CachedResourceRequest request(ResourceRequest(document->completeURL(m_resource)), options);
  • trunk/Source/WebCore/css/CSSImageSetValue.cpp

    r202811 r204014  
    121121        if (options.mode == FetchOptions::Mode::Cors) {
    122122            ASSERT(document->securityOrigin());
    123             updateRequestForAccessControl(request.mutableResourceRequest(), *document->securityOrigin(), options.allowCredentials());
     123            updateRequestForAccessControl(request.mutableResourceRequest(), *document->securityOrigin(), options.allowCredentials);
    124124        }
    125125        if (CachedResourceHandle<CachedImage> cachedImage = loader.requestImage(request)) {
  • trunk/Source/WebCore/css/CSSImageValue.cpp

    r202811 r204014  
    8585        if (options.mode == FetchOptions::Mode::Cors) {
    8686            ASSERT(loader.document()->securityOrigin());
    87             updateRequestForAccessControl(request.mutableResourceRequest(), *loader.document()->securityOrigin(), options.allowCredentials());
     87            updateRequestForAccessControl(request.mutableResourceRequest(), *loader.document()->securityOrigin(), options.allowCredentials);
    8888        }
    8989        if (CachedResourceHandle<CachedImage> cachedImage = loader.requestImage(request)) {
  • trunk/Source/WebCore/dom/ScriptElement.cpp

    r203324 r204014  
    262262        bool hasKnownNonce = m_element.document().contentSecurityPolicy()->allowScriptWithNonce(m_element.attributeWithoutSynchronization(HTMLNames::nonceAttr), m_element.isInUserAgentShadowTree());
    263263        ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    264         options.setContentSecurityPolicyImposition(hasKnownNonce ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
     264        options.contentSecurityPolicyImposition = hasKnownNonce ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
    265265
    266266        CachedResourceRequest request(ResourceRequest(m_element.document().completeURL(sourceUrl)), options);
  • trunk/Source/WebCore/fileapi/FileReaderLoader.cpp

    r203971 r204014  
    8787
    8888    ThreadableLoaderOptions options;
    89     options.setSendLoadCallbacks(SendCallbacks);
    90     options.setSniffContent(DoNotSniffContent);
    91     options.setDataBufferingPolicy(DoNotBufferData);
    92     options.preflightPolicy = ConsiderPreflight;
     89    options.sendLoadCallbacks = SendCallbacks;
     90    options.dataBufferingPolicy = DoNotBufferData;
    9391    options.credentials = FetchOptions::Credentials::Include;
    9492    options.mode = FetchOptions::Mode::SameOrigin;
  • trunk/Source/WebCore/html/HTMLLinkElement.cpp

    r203324 r204014  
    260260        if (document().contentSecurityPolicy()->allowStyleWithNonce(attributeWithoutSynchronization(HTMLNames::nonceAttr))) {
    261261            ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    262             options.setContentSecurityPolicyImposition(ContentSecurityPolicyImposition::SkipPolicyCheck);
     262            options.contentSecurityPolicyImposition = ContentSecurityPolicyImposition::SkipPolicyCheck;
    263263            request.setOptions(options);
    264264        }
  • trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp

    r203971 r204014  
    671671
    672672    ThreadableLoaderOptions options;
    673     options.setSendLoadCallbacks(SendCallbacks); // So we remove this from m_hiddenRequestIdentifiers on completion.
    674     options.setDefersLoadingPolicy(DefersLoadingPolicy::DisallowDefersLoading); // So the request is never deferred.
     673    options.sendLoadCallbacks = SendCallbacks; // So we remove this from m_hiddenRequestIdentifiers on completion.
     674    options.defersLoadingPolicy = DefersLoadingPolicy::DisallowDefersLoading; // So the request is never deferred.
    675675    options.mode = FetchOptions::Mode::NoCors;
    676676    options.credentials = FetchOptions::Credentials::SameOrigin;
  • trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp

    r203943 r204014  
    7070
    7171    String description;
    72     if (!passesAccessControlCheck(response, loader.options().allowCredentials(), loader.securityOrigin(), description)) {
     72    if (!passesAccessControlCheck(response, loader.options().allowCredentials, loader.securityOrigin(), description)) {
    7373        loader.preflightFailure(identifier, ResourceError(errorDomainWebKitInternal, 0, request.url(), description, ResourceError::Type::AccessControl));
    7474        return;
    7575    }
    7676
    77     auto result = std::make_unique<CrossOriginPreflightResultCacheItem>(loader.options().allowCredentials());
     77    auto result = std::make_unique<CrossOriginPreflightResultCacheItem>(loader.options().allowCredentials);
    7878    if (!result->parse(response, description)
    7979        || !result->allowsCrossOriginMethod(request.httpMethod(), description)
     
    101101void CrossOriginPreflightChecker::startPreflight()
    102102{
    103     auto options = m_loader.options();
     103    ResourceLoaderOptions options = static_cast<FetchOptions>(m_loader.options());
    104104    options.credentials = FetchOptions::Credentials::Omit;
    105     options.setSecurityCheck(DoSecurityCheck);
    106     // Don't sniff content or send load callbacks for the preflight request.
    107     options.setSendLoadCallbacks(DoNotSendCallbacks);
    108     options.setSniffContent(DoNotSniffContent);
    109     // Keep buffering the data for the preflight request.
    110     options.setDataBufferingPolicy(BufferData);
    111 
    112105    options.redirect = FetchOptions::Redirect::Manual;
    113106
  • trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp

    r203971 r204014  
    9797    ASSERT_WITH_SECURITY_IMPLICATION(isAllowedByContentSecurityPolicy(request.url()));
    9898
    99     m_options.setAllowCredentials((m_options.credentials == FetchOptions::Credentials::Include || (m_options.credentials == FetchOptions::Credentials::SameOrigin && m_sameOriginRequest)) ? AllowStoredCredentials : DoNotAllowStoredCredentials);
     99    m_options.allowCredentials = (m_options.credentials == FetchOptions::Credentials::Include || (m_options.credentials == FetchOptions::Credentials::SameOrigin && m_sameOriginRequest)) ? AllowStoredCredentials : DoNotAllowStoredCredentials;
    100100
    101101    if (m_sameOriginRequest || m_options.mode == FetchOptions::Mode::NoCors) {
     
    120120    else {
    121121        m_simpleRequest = false;
    122         if (CrossOriginPreflightResultCache::singleton().canSkipPreflight(securityOrigin().toString(), request.url(), m_options.allowCredentials(), request.httpMethod(), request.httpHeaderFields()))
     122        if (CrossOriginPreflightResultCache::singleton().canSkipPreflight(securityOrigin().toString(), request.url(), m_options.allowCredentials, request.httpMethod(), request.httpHeaderFields()))
    123123            preflightSuccess(WTFMove(request));
    124124        else
     
    138138    }
    139139
    140     updateRequestForAccessControl(request, securityOrigin(), m_options.allowCredentials());
     140    updateRequestForAccessControl(request, securityOrigin(), m_options.allowCredentials);
    141141    loadRequest(WTFMove(request), DoSecurityCheck);
    142142}
     
    228228            String accessControlErrorDescription;
    229229            allowRedirect = isValidCrossOriginRedirectionURL(request.url())
    230                             && (m_sameOriginRequest || passesAccessControlCheck(redirectResponse, m_options.allowCredentials(), securityOrigin(), accessControlErrorDescription));
     230                && (m_sameOriginRequest || passesAccessControlCheck(redirectResponse, m_options.allowCredentials, securityOrigin(), accessControlErrorDescription));
    231231        }
    232232
     
    246246
    247247            if (m_options.credentials == FetchOptions::Credentials::SameOrigin)
    248                 m_options.setAllowCredentials(DoNotAllowStoredCredentials);
     248                m_options.allowCredentials = DoNotAllowStoredCredentials;
    249249
    250250            cleanRedirectedRequestForAccessControl(request);
     
    278278    String accessControlErrorDescription;
    279279    if (!m_sameOriginRequest && m_options.mode == FetchOptions::Mode::Cors) {
    280         if (!passesAccessControlCheck(response, m_options.allowCredentials(), securityOrigin(), accessControlErrorDescription)) {
     280        if (!passesAccessControlCheck(response, m_options.allowCredentials, securityOrigin(), accessControlErrorDescription)) {
    281281            m_client->didFail(ResourceError(errorDomainWebKitInternal, 0, response.url(), accessControlErrorDescription, ResourceError::Type::AccessControl));
    282282            return;
     
    335335{
    336336    ResourceRequest actualRequest(WTFMove(request));
    337     updateRequestForAccessControl(actualRequest, securityOrigin(), m_options.allowCredentials());
     337    updateRequestForAccessControl(actualRequest, securityOrigin(), m_options.allowCredentials);
    338338
    339339    m_preflightChecker = Nullopt;
     
    358358    // Any credential should have been removed from the cross-site requests.
    359359    const URL& requestURL = request.url();
    360     m_options.setSecurityCheck(securityCheck);
     360    m_options.securityCheck = securityCheck;
    361361    ASSERT(m_sameOriginRequest || requestURL.user().isEmpty());
    362362    ASSERT(m_sameOriginRequest || requestURL.pass().isEmpty());
     
    372372        if (RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
    373373            newRequest.setInitiator(m_options.initiator);
    374         newRequest.mutableResourceRequest().setAllowCookies(m_options.allowCredentials() == AllowStoredCredentials);
     374        newRequest.mutableResourceRequest().setAllowCookies(m_options.allowCredentials == AllowStoredCredentials);
    375375
    376376        ASSERT(!m_resource);
     
    394394        if (!frameLoader.mixedContentChecker().canRunInsecureContent(m_document.securityOrigin(), requestURL))
    395395            return;
    396         identifier = frameLoader.loadResourceSynchronously(request, m_options.allowCredentials(), m_options.clientCredentialPolicy, error, response, data);
     396        identifier = frameLoader.loadResourceSynchronously(request, m_options.allowCredentials, m_options.clientCredentialPolicy, error, response, data);
    397397    }
    398398
  • trunk/Source/WebCore/loader/ImageLoader.cpp

    r203337 r204014  
    175175    if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) {
    176176        ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    177         options.setContentSecurityPolicyImposition(element().isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
     177        options.contentSecurityPolicyImposition = element().isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
    178178
    179179        CachedResourceRequest request(ResourceRequest(document.completeURL(sourceURI(attr))), options);
  • trunk/Source/WebCore/loader/ResourceLoader.cpp

    r203720 r204014  
    6262    : m_frame(&frame)
    6363    , m_documentLoader(frame.loader().activeDocumentLoader())
    64     , m_defersLoading(options.defersLoadingPolicy() == DefersLoadingPolicy::AllowDefersLoading && frame.page()->defersLoading())
     64    , m_defersLoading(options.defersLoadingPolicy == DefersLoadingPolicy::AllowDefersLoading && frame.page()->defersLoading())
    6565    , m_options(options)
    6666{
     
    126126#endif
    127127   
    128     m_defersLoading = m_options.defersLoadingPolicy() == DefersLoadingPolicy::AllowDefersLoading && m_frame->page()->defersLoading();
    129 
    130     if (m_options.securityCheck() == DoSecurityCheck && !m_frame->document()->securityOrigin()->canDisplay(clientRequest.url())) {
     128    m_defersLoading = m_options.defersLoadingPolicy == DefersLoadingPolicy::AllowDefersLoading && m_frame->page()->defersLoading();
     129
     130    if (m_options.securityCheck == DoSecurityCheck && !m_frame->document()->securityOrigin()->canDisplay(clientRequest.url())) {
    131131        FrameLoader::reportLocalLoadFailed(m_frame.get(), clientRequest.url().string());
    132132        releaseResources();
     
    207207    }
    208208
    209     m_handle = ResourceHandle::create(frameLoader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent() == SniffContent);
     209    m_handle = ResourceHandle::create(frameLoader()->networkingContext(), m_request, this, m_defersLoading, m_options.sniffContent == SniffContent);
    210210}
    211211
    212212void ResourceLoader::setDefersLoading(bool defers)
    213213{
    214     if (m_options.defersLoadingPolicy() == DefersLoadingPolicy::DisallowDefersLoading)
     214    if (m_options.defersLoadingPolicy == DefersLoadingPolicy::DisallowDefersLoading)
    215215        return;
    216216
     
    269269
    270270void ResourceLoader::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
    271 { 
    272     m_options.setDataBufferingPolicy(dataBufferingPolicy);
     271{
     272    m_options.dataBufferingPolicy = dataBufferingPolicy;
    273273
    274274    // Reset any already buffered data
     
    276276        m_resourceData = nullptr;
    277277}
    278    
     278
    279279void ResourceLoader::willSwitchToSubstituteResource()
    280280{
     
    287287void ResourceLoader::addDataOrBuffer(const char* data, unsigned length, SharedBuffer* buffer, DataPayloadType dataPayloadType)
    288288{
    289     if (m_options.dataBufferingPolicy() == DoNotBufferData)
     289    if (m_options.dataBufferingPolicy == DoNotBufferData)
    290290        return;
    291291
     
    351351    }
    352352
    353     if (m_options.sendLoadCallbacks() == SendCallbacks) {
     353    if (m_options.sendLoadCallbacks == SendCallbacks) {
    354354        if (createdResourceIdentifier)
    355355            frameLoader()->notifier().assignIdentifierToInitialRequest(m_identifier, documentLoader(), request);
     
    459459    if (FormData* data = m_request.httpBody())
    460460        data->removeGeneratedFilesIfNeeded();
    461        
    462     if (m_options.sendLoadCallbacks() == SendCallbacks)
     461
     462    if (m_options.sendLoadCallbacks == SendCallbacks)
    463463        frameLoader()->notifier().didReceiveResponse(this, m_response);
    464464}
     
    490490
    491491    addDataOrBuffer(data, length, buffer.get(), dataPayloadType);
    492    
     492
    493493    // FIXME: If we get a resource with more than 2B bytes, this code won't do the right thing.
    494494    // However, with today's computers and networking speeds, this won't happen in practice.
    495495    // Could be an issue with a giant local file.
    496     if (m_options.sendLoadCallbacks() == SendCallbacks && m_frame)
     496    if (m_options.sendLoadCallbacks == SendCallbacks && m_frame)
    497497        frameLoader()->notifier().didReceiveData(this, buffer ? buffer->data() : data, buffer ? buffer->size() : length, static_cast<int>(encodedDataLength));
    498498}
     
    520520        return;
    521521    m_notifiedLoadComplete = true;
    522     if (m_options.sendLoadCallbacks() == SendCallbacks)
     522    if (m_options.sendLoadCallbacks == SendCallbacks)
    523523        frameLoader()->notifier().didFinishLoad(this, finishTime);
    524524}
     
    546546        return;
    547547    m_notifiedLoadComplete = true;
    548     if (m_options.sendLoadCallbacks() == SendCallbacks && m_identifier)
     548    if (m_options.sendLoadCallbacks == SendCallbacks && m_identifier)
    549549        frameLoader()->notifier().didFailToLoad(this, error);
    550550}
     
    679679bool ResourceLoader::shouldUseCredentialStorage()
    680680{
    681     if (m_options.allowCredentials() == DoNotAllowStoredCredentials)
     681    if (m_options.allowCredentials == DoNotAllowStoredCredentials)
    682682        return false;
    683    
     683
    684684    Ref<ResourceLoader> protectedThis(*this);
    685685    return frameLoader()->client().shouldUseCredentialStorage(documentLoader(), identifier());
     
    701701    Ref<ResourceLoader> protectedThis(*this);
    702702
    703     if (m_options.allowCredentials() == AllowStoredCredentials) {
     703    if (m_options.allowCredentials == AllowStoredCredentials) {
    704704        if (isAllowedToAskUserForCredentials()) {
    705705            frameLoader()->notifier().didReceiveAuthenticationChallenge(this, challenge);
  • trunk/Source/WebCore/loader/ResourceLoader.h

    r202410 r204014  
    126126    const URL& url() const { return m_request.url(); }
    127127    ResourceHandle* handle() const { return m_handle.get(); }
    128     bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks() == SendCallbacks; }
    129     void setSendCallbackPolicy(SendCallbackPolicy sendLoadCallbacks) { m_options.setSendLoadCallbacks(sendLoadCallbacks); }
    130     bool shouldSniffContent() const { return m_options.sniffContent() == SniffContent; }
     128    bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks == SendCallbacks; }
     129    void setSendCallbackPolicy(SendCallbackPolicy sendLoadCallbacks) { m_options.sendLoadCallbacks = sendLoadCallbacks; }
     130    bool shouldSniffContent() const { return m_options.sniffContent == SniffContent; }
    131131    WEBCORE_EXPORT bool isAllowedToAskUserForCredentials() const;
    132     bool shouldIncludeCertificateInfo() const { return m_options.certificateInfoPolicy() == IncludeCertificateInfo; }
     132    bool shouldIncludeCertificateInfo() const { return m_options.certificateInfoPolicy == IncludeCertificateInfo; }
    133133
    134134    bool reachedTerminalState() const { return m_reachedTerminalState; }
  • trunk/Source/WebCore/loader/ResourceLoaderOptions.h

    r203720 r204014  
    8282
    8383struct ResourceLoaderOptions : public FetchOptions {
    84     ResourceLoaderOptions()
    85         : m_sendLoadCallbacks(DoNotSendCallbacks)
    86         , m_sniffContent(DoNotSniffContent)
    87         , m_dataBufferingPolicy(BufferData)
    88         , m_allowCredentials(DoNotAllowStoredCredentials)
    89         , m_securityCheck(DoSecurityCheck)
    90         , m_certificateInfoPolicy(DoNotIncludeCertificateInfo)
    91     {
    92     }
     84    ResourceLoaderOptions() { }
     85
     86    ResourceLoaderOptions(const FetchOptions& options) : FetchOptions(options) { }
    9387
    9488    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)
    95         : m_sendLoadCallbacks(sendLoadCallbacks)
    96         , m_sniffContent(sniffContent)
    97         , m_dataBufferingPolicy(dataBufferingPolicy)
    98         , m_allowCredentials(allowCredentials)
    99         , m_securityCheck(securityCheck)
    100         , m_certificateInfoPolicy(certificateInfoPolicy)
    101         , m_contentSecurityPolicyImposition(contentSecurityPolicyImposition)
    102         , m_defersLoadingPolicy(defersLoadingPolicy)
    103         , m_cachingPolicy(cachingPolicy)
     89        : sendLoadCallbacks(sendLoadCallbacks)
     90        , sniffContent(sniffContent)
     91        , dataBufferingPolicy(dataBufferingPolicy)
     92        , allowCredentials(allowCredentials)
     93        , securityCheck(securityCheck)
     94        , certificateInfoPolicy(certificateInfoPolicy)
     95        , contentSecurityPolicyImposition(contentSecurityPolicyImposition)
     96        , defersLoadingPolicy(defersLoadingPolicy)
     97        , cachingPolicy(cachingPolicy)
    10498        , clientCredentialPolicy(credentialPolicy)
    10599    {
     
    108102    }
    109103
    110     SendCallbackPolicy sendLoadCallbacks() const { return static_cast<SendCallbackPolicy>(m_sendLoadCallbacks); }
    111     void setSendLoadCallbacks(SendCallbackPolicy allow) { m_sendLoadCallbacks = allow; }
    112     ContentSniffingPolicy sniffContent() const { return static_cast<ContentSniffingPolicy>(m_sniffContent); }
    113     void setSniffContent(ContentSniffingPolicy policy) { m_sniffContent = policy; }
    114     DataBufferingPolicy dataBufferingPolicy() const { return static_cast<DataBufferingPolicy>(m_dataBufferingPolicy); }
    115     void setDataBufferingPolicy(DataBufferingPolicy policy) { m_dataBufferingPolicy = policy; }
    116     StoredCredentials allowCredentials() const { return static_cast<StoredCredentials>(m_allowCredentials); }
    117     void setAllowCredentials(StoredCredentials allow) { m_allowCredentials = allow; }
    118     SecurityCheckPolicy securityCheck() const { return static_cast<SecurityCheckPolicy>(m_securityCheck); }
    119     void setSecurityCheck(SecurityCheckPolicy check) { m_securityCheck = check; }
    120     CertificateInfoPolicy certificateInfoPolicy() const { return static_cast<CertificateInfoPolicy>(m_certificateInfoPolicy); }
    121     void setCertificateInfoPolicy(CertificateInfoPolicy policy) { m_certificateInfoPolicy = policy; }
    122     ContentSecurityPolicyImposition contentSecurityPolicyImposition() const { return m_contentSecurityPolicyImposition; }
    123     void setContentSecurityPolicyImposition(ContentSecurityPolicyImposition imposition) { m_contentSecurityPolicyImposition = imposition; }
    124     DefersLoadingPolicy defersLoadingPolicy() const { return m_defersLoadingPolicy; }
    125     void setDefersLoadingPolicy(DefersLoadingPolicy defersLoadingPolicy) { m_defersLoadingPolicy = defersLoadingPolicy; }
    126     CachingPolicy cachingPolicy() const { return m_cachingPolicy; }
    127     void setCachingPolicy(CachingPolicy cachingPolicy) { m_cachingPolicy = cachingPolicy; }
    128 
    129     unsigned m_sendLoadCallbacks : 1;
    130     unsigned m_sniffContent : 1;
    131     unsigned m_dataBufferingPolicy : 1;
    132     unsigned m_allowCredentials : 1; // Whether HTTP credentials and cookies are sent with the request.
    133     unsigned m_securityCheck : 1;
    134     unsigned m_certificateInfoPolicy : 1; // Whether the response should include certificate info.
    135     ContentSecurityPolicyImposition m_contentSecurityPolicyImposition { ContentSecurityPolicyImposition::DoPolicyCheck };
    136     DefersLoadingPolicy m_defersLoadingPolicy { DefersLoadingPolicy::AllowDefersLoading };
    137     CachingPolicy m_cachingPolicy { CachingPolicy::AllowCaching };
     104    SendCallbackPolicy sendLoadCallbacks { DoNotSendCallbacks };
     105    ContentSniffingPolicy sniffContent { DoNotSniffContent };
     106    DataBufferingPolicy dataBufferingPolicy { BufferData };
     107    StoredCredentials allowCredentials { DoNotAllowStoredCredentials };
     108    SecurityCheckPolicy securityCheck { DoSecurityCheck };
     109    CertificateInfoPolicy certificateInfoPolicy { DoNotIncludeCertificateInfo };
     110    ContentSecurityPolicyImposition contentSecurityPolicyImposition { ContentSecurityPolicyImposition::DoPolicyCheck };
     111    DefersLoadingPolicy defersLoadingPolicy { DefersLoadingPolicy::AllowDefersLoading };
     112    CachingPolicy cachingPolicy { CachingPolicy::AllowCaching };
    138113
    139114    ClientCredentialPolicy clientCredentialPolicy { ClientCredentialPolicy::CannotAskClientForCredentials };
  • trunk/Source/WebCore/loader/SubresourceLoader.cpp

    r203815 r204014  
    416416    String errorDescription;
    417417    bool responsePassesCORS = m_origin->canRequest(previousRequest.url())
    418         || passesAccessControlCheck(redirectResponse, options().allowCredentials(), *m_origin, errorDescription);
     418        || passesAccessControlCheck(redirectResponse, options().allowCredentials, *m_origin, errorDescription);
    419419    if (!responsePassesCORS || !isValidCrossOriginRedirectionURL(newRequest.url())) {
    420420        if (m_frame && m_frame->document()) {
     
    429429    m_origin = SecurityOrigin::createUnique();
    430430    cleanRedirectedRequestForAccessControl(newRequest);
    431     updateRequestForAccessControl(newRequest, *m_origin, options().allowCredentials());
     431    updateRequestForAccessControl(newRequest, *m_origin, options().allowCredentials);
    432432
    433433    return true;
  • trunk/Source/WebCore/loader/TextTrackLoader.cpp

    r202674 r204014  
    154154
    155155    ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    156     options.setContentSecurityPolicyImposition(isInitiatingElementInUserAgentShadowTree ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
     156    options.contentSecurityPolicyImposition = isInitiatingElementInUserAgentShadowTree ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
    157157
    158158    CachedResourceRequest cueRequest(ResourceRequest(document->completeURL(url)), options);
  • trunk/Source/WebCore/loader/cache/CachedRawResource.cpp

    r200895 r204014  
    221221void CachedRawResource::setDataBufferingPolicy(DataBufferingPolicy dataBufferingPolicy)
    222222{
    223     m_options.setDataBufferingPolicy(dataBufferingPolicy);
     223    m_options.dataBufferingPolicy = dataBufferingPolicy;
    224224}
    225225
  • trunk/Source/WebCore/loader/cache/CachedResource.cpp

    r203815 r204014  
    238238
    239239    FrameLoader& frameLoader = frame.loader();
    240     if (options.securityCheck() == DoSecurityCheck && (frameLoader.state() == FrameStateProvisional || !frameLoader.activeDocumentLoader() || frameLoader.activeDocumentLoader()->isStopping())) {
     240    if (options.securityCheck == DoSecurityCheck && (frameLoader.state() == FrameStateProvisional || !frameLoader.activeDocumentLoader() || frameLoader.activeDocumentLoader()->isStopping())) {
    241241        failBeforeStarting();
    242242        return;
  • trunk/Source/WebCore/loader/cache/CachedResource.h

    r203815 r204014  
    227227    bool loadFailedOrCanceled() const { return !m_error.isNull(); }
    228228
    229     bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks() == SendCallbacks; }
    230     DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBufferingPolicy(); }
    231 
    232     bool allowsCaching() const { return m_options.cachingPolicy() == CachingPolicy::AllowCaching; }
     229    bool shouldSendResourceLoadCallbacks() const { return m_options.sendLoadCallbacks == SendCallbacks; }
     230    DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBufferingPolicy; }
     231
     232    bool allowsCaching() const { return m_options.cachingPolicy == CachingPolicy::AllowCaching; }
    233233
    234234    virtual void destroyDecodedData() { }
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r203720 r204014  
    391391    }
    392392
    393     bool skipContentSecurityPolicyCheck = options.contentSecurityPolicyImposition() == ContentSecurityPolicyImposition::SkipPolicyCheck;
     393    bool skipContentSecurityPolicyCheck = options.contentSecurityPolicyImposition == ContentSecurityPolicyImposition::SkipPolicyCheck;
    394394    ContentSecurityPolicy::RedirectResponseReceived redirectResponseReceived = didReceiveRedirectResponse ? ContentSecurityPolicy::RedirectResponseReceived::Yes : ContentSecurityPolicy::RedirectResponseReceived::No;
    395395
  • trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp

    r203971 r204014  
    101101    m_options.mode = FetchOptions::Mode::Cors;
    102102    m_options.credentials = equalLettersIgnoringASCIICase(mode, "use-credentials") ? FetchOptions::Credentials::Include : FetchOptions::Credentials::SameOrigin;
    103     m_options.setAllowCredentials(equalLettersIgnoringASCIICase(mode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials);
     103    m_options.allowCredentials = equalLettersIgnoringASCIICase(mode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
    104104
    105105    ASSERT(document.securityOrigin());
    106     updateRequestForAccessControl(m_resourceRequest, *document.securityOrigin(), m_options.allowCredentials());
     106    updateRequestForAccessControl(m_resourceRequest, *document.securityOrigin(), m_options.allowCredentials);
    107107}
    108108
  • trunk/Source/WebCore/loader/cache/CachedResourceRequest.h

    r203971 r204014  
    6161    void setInitiator(const AtomicString& name);
    6262    const AtomicString& initiatorName() const;
    63     bool allowsCaching() const { return m_options.cachingPolicy() == CachingPolicy::AllowCaching; }
     63    bool allowsCaching() const { return m_options.cachingPolicy == CachingPolicy::AllowCaching; }
    6464
    6565    void setInitiator(DocumentLoader&);
  • trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.cpp

    r165676 r204014  
    3131CachedResourceRequestInitiators::CachedResourceRequestInitiators()
    3232    : css("css", AtomicString::ConstructFromLiteral)
     33    , fetch("fetch", AtomicString::ConstructFromLiteral)
    3334    , icon("icon", AtomicString::ConstructFromLiteral)
    3435    , xmlhttprequest("xmlhttprequest", AtomicString::ConstructFromLiteral)
  • trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.h

    r183186 r204014  
    3636
    3737    const AtomicString css;
     38    const AtomicString fetch;
    3839    const AtomicString icon;
    3940    const AtomicString xmlhttprequest;
  • trunk/Source/WebCore/loader/cf/ResourceLoaderCFNet.cpp

    r191369 r204014  
    3838bool ResourceLoader::shouldCacheResponse(ResourceHandle*, CFCachedURLResponseRef cachedResponse)
    3939{
    40     if (m_options.sendLoadCallbacks() == DoNotSendCallbacks)
     40    if (m_options.sendLoadCallbacks == DoNotSendCallbacks)
    4141        return false;
    4242
  • trunk/Source/WebCore/loader/mac/ResourceLoaderMac.mm

    r200895 r204014  
    5252NSCachedURLResponse* ResourceLoader::willCacheResponse(ResourceHandle*, NSCachedURLResponse* response)
    5353{
    54     if (m_options.sendLoadCallbacks() == DoNotSendCallbacks)
     54    if (m_options.sendLoadCallbacks == DoNotSendCallbacks)
    5555        return nullptr;
    5656    return frameLoader()->client().willCacheResponse(documentLoader(), identifier(), response);
     
    7272        unsigned dataLen = static_cast<unsigned>(CFDataGetLength(data));
    7373
    74         if (m_options.dataBufferingPolicy() == BufferData) {
     74        if (m_options.dataBufferingPolicy == BufferData) {
    7575            if (!m_resourceData)
    7676                m_resourceData = SharedBuffer::create();
     
    8181        // However, with today's computers and networking speeds, this won't happen in practice.
    8282        // Could be an issue with a giant local file.
    83         if (m_options.sendLoadCallbacks() == SendCallbacks && m_frame)
     83        if (m_options.sendLoadCallbacks == SendCallbacks && m_frame)
    8484            frameLoader()->notifier().didReceiveData(this, reinterpret_cast<const char*>(CFDataGetBytePtr(data)), dataLen, dataLen);
    8585    }
  • trunk/Source/WebCore/page/EventSource.cpp

    r203971 r204014  
    105105
    106106    ThreadableLoaderOptions options;
    107     options.setSendLoadCallbacks(SendCallbacks);
    108     options.setSniffContent(DoNotSniffContent);
     107    options.sendLoadCallbacks = SendCallbacks;
    109108    options.credentials = m_withCredentials ? FetchOptions::Credentials::Include : FetchOptions::Credentials::SameOrigin;
    110109    options.preflightPolicy = PreventPreflight;
    111110    options.mode = FetchOptions::Mode::Cors;
    112     options.setDataBufferingPolicy(DoNotBufferData);
     111    options.dataBufferingPolicy = DoNotBufferData;
    113112    options.contentSecurityPolicyEnforcement = scriptExecutionContext()->shouldBypassMainWorldContentSecurityPolicy() ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceConnectSrcDirective;
    114113
  • trunk/Source/WebCore/style/StylePendingResources.cpp

    r202811 r204014  
    4949    auto& pendingImage = downcast<StylePendingImage>(image);
    5050    ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    51     options.setContentSecurityPolicyImposition(element && element->isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
     51    options.contentSecurityPolicyImposition = element && element->isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
    5252
    5353    // FIXME: Why does shape-outside have different policy than other properties?
    5454    if (loadPolicy == LoadPolicy::ShapeOutside) {
    5555        options.mode = FetchOptions::Mode::Cors;
    56         options.setAllowCredentials(DoNotAllowStoredCredentials);
     56        options.allowCredentials = DoNotAllowStoredCredentials;
    5757    }
    5858
     
    172172
    173173    ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    174     options.setContentSecurityPolicyImposition(element && element->isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
     174    options.contentSecurityPolicyImposition = element && element->isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
    175175
    176176    for (auto& filterOperation : pendingResources.pendingSVGFilters)
  • trunk/Source/WebCore/svg/SVGFEImageElement.cpp

    r195614 r204014  
    8787{
    8888    ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    89     options.setContentSecurityPolicyImposition(isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
     89    options.contentSecurityPolicyImposition = isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
    9090
    9191    CachedResourceRequest request(ResourceRequest(document().completeURL(href())), options);
  • trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp

    r203324 r204014  
    102102    if (!href.isNull()) {
    103103        ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    104         options.setContentSecurityPolicyImposition(isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
     104        options.contentSecurityPolicyImposition = isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
    105105
    106106        CachedResourceLoader& cachedResourceLoader = document().cachedResourceLoader();
  • trunk/Source/WebCore/svg/SVGUseElement.cpp

    r202105 r204014  
    570570    else {
    571571        ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
    572         options.setContentSecurityPolicyImposition(isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck);
     572        options.contentSecurityPolicyImposition = isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck;
    573573
    574574        CachedResourceRequest request { ResourceRequest { externalDocumentURL }, options };
  • trunk/Source/WebCore/workers/WorkerScriptLoader.cpp

    r203971 r204014  
    7171    options.credentials = FetchOptions::Credentials::Include;
    7272    options.mode = mode;
    73     options.setSendLoadCallbacks(SendCallbacks);
     73    options.sendLoadCallbacks = SendCallbacks;
    7474    options.contentSecurityPolicyEnforcement = contentSecurityPolicyEnforcement;
    7575
     
    9494    options.credentials = FetchOptions::Credentials::SameOrigin;
    9595    options.mode = mode;
    96     options.setSendLoadCallbacks(SendCallbacks);
     96    options.sendLoadCallbacks = SendCallbacks;
    9797    options.contentSecurityPolicyEnforcement = contentSecurityPolicyEnforcement;
    9898
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r203971 r204014  
    688688
    689689    ThreadableLoaderOptions options;
    690     options.setSendLoadCallbacks(SendCallbacks);
    691     options.setSniffContent(DoNotSniffContent);
     690    options.sendLoadCallbacks = SendCallbacks;
    692691    options.preflightPolicy = uploadEvents ? ForcePreflight : ConsiderPreflight;
    693692    options.credentials = m_includeCredentials ? FetchOptions::Credentials::Include : FetchOptions::Credentials::SameOrigin;
Note: See TracChangeset for help on using the changeset viewer.