Changeset 173558 in webkit


Ignore:
Timestamp:
Sep 12, 2014 8:42:11 AM (10 years ago)
Author:
Carlos Garcia Campos
Message:

REGRESSION(r173423): CertificateInfo is never sent to the UI process when using shared secondary process model
https://bugs.webkit.org/show_bug.cgi?id=136669

Reviewed by Antti Koivisto.

Source/WebCore:

Add CertificateInfoPolicy option to ResourceLoaderOptions. It's
set to DoNotIncludeCertificateInfo for all loads except the main
resource load.

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::startLoadingMainResource): Pass
IncludeCertificateInfo to ResourceLoaderOptions.

  • loader/NetscapePlugInStreamLoader.cpp:

(WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
Pass DoNotIncludeCertificateInfo to ResourceLoaderOptions().

  • loader/ResourceLoader.h:

(WebCore::ResourceLoader::shouldIncludeCertificateInfo): Return
true if IncludeCertificateInfo option was given.

  • loader/ResourceLoaderOptions.h:

(WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
(WebCore::ResourceLoaderOptions::certificateInfoPolicy):
(WebCore::ResourceLoaderOptions::setCertificateInfoPolicy):

  • loader/SubresourceLoader.cpp:

(WebCore::SubresourceLoader::didReceiveResponse): If
IncludeCertificateInfo option is present, call
includeCertificateInfo() on the response.

  • loader/cache/CachedResourceLoader.cpp:

(WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Pass
DoNotIncludeCertificateInfo to ResourceLoaderOptions().
(WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto.

  • loader/icon/IconLoader.cpp:

(WebCore::IconLoader::startLoading): Ditto.

  • platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:

(WebCore::WebCoreAVCFResourceLoader::startLoading): Ditto.

  • platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:

(WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.

  • platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:

(CachedResourceStreamingClient::CachedResourceStreamingClient): Ditto.

Source/WebKit2:

  • WebProcess/Network/WebResourceLoadScheduler.cpp:

(WebKit::WebResourceLoadScheduler::scheduleLoad): Use
ResourceLoader::shouldIncludeCertificateInfo() to initialize
needsCertificateInfo parameter.

Tools:

  • Scripts/run-gtk-tests:

(TestRunner): Unskip SSL test.

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r173555 r173558  
     12014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r173423): CertificateInfo is never sent to the UI process when using shared secondary process model
     4        https://bugs.webkit.org/show_bug.cgi?id=136669
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Add CertificateInfoPolicy option to ResourceLoaderOptions. It's
     9        set to DoNotIncludeCertificateInfo for all loads except the main
     10        resource load.
     11
     12        * loader/DocumentLoader.cpp:
     13        (WebCore::DocumentLoader::startLoadingMainResource): Pass
     14        IncludeCertificateInfo to ResourceLoaderOptions.
     15        * loader/NetscapePlugInStreamLoader.cpp:
     16        (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
     17        Pass DoNotIncludeCertificateInfo to ResourceLoaderOptions().
     18        * loader/ResourceLoader.h:
     19        (WebCore::ResourceLoader::shouldIncludeCertificateInfo): Return
     20        true if IncludeCertificateInfo option was given.
     21        * loader/ResourceLoaderOptions.h:
     22        (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
     23        (WebCore::ResourceLoaderOptions::certificateInfoPolicy):
     24        (WebCore::ResourceLoaderOptions::setCertificateInfoPolicy):
     25        * loader/SubresourceLoader.cpp:
     26        (WebCore::SubresourceLoader::didReceiveResponse): If
     27        IncludeCertificateInfo option is present, call
     28        includeCertificateInfo() on the response.
     29        * loader/cache/CachedResourceLoader.cpp:
     30        (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Pass
     31        DoNotIncludeCertificateInfo to ResourceLoaderOptions().
     32        (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto.
     33        * loader/icon/IconLoader.cpp:
     34        (WebCore::IconLoader::startLoading): Ditto.
     35        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
     36        (WebCore::WebCoreAVCFResourceLoader::startLoading): Ditto.
     37        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
     38        (WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.
     39        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
     40        (CachedResourceStreamingClient::CachedResourceStreamingClient): Ditto.
     41
    1422014-09-11  Ryuan Choi  <ryuan.choi@gmail.com>
    243
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r173272 r173558  
    14331433
    14341434    ResourceRequest request(m_request);
    1435     static NeverDestroyed<ResourceLoaderOptions> mainResourceLoadOptions(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType);
     1435    static NeverDestroyed<ResourceLoaderOptions> mainResourceLoadOptions(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType, IncludeCertificateInfo);
    14361436    CachedResourceRequest cachedResourceRequest(request, mainResourceLoadOptions);
    14371437    m_mainResource = m_cachedResourceLoader->requestMainResource(cachedResourceRequest);
  • trunk/Source/WebCore/loader/NetscapePlugInStreamLoader.cpp

    r165676 r173558  
    3838
    3939NetscapePlugInStreamLoader::NetscapePlugInStreamLoader(Frame* frame, NetscapePlugInStreamLoaderClient* client)
    40     : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType))
     40    : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo))
    4141    , m_client(client)
    4242{
  • trunk/Source/WebCore/loader/ResourceLoader.h

    r173516 r173558  
    124124    bool shouldSniffContent() const { return m_options.sniffContent() == SniffContent; }
    125125    WEBCORE_EXPORT bool isAllowedToAskUserForCredentials() const;
     126    bool shouldIncludeCertificateInfo() const { return m_options.certificateInfoPolicy() == IncludeCertificateInfo; }
    126127
    127128    bool reachedTerminalState() const { return m_reachedTerminalState; }
  • trunk/Source/WebCore/loader/ResourceLoaderOptions.h

    r170381 r173558  
    6262};
    6363
     64enum CertificateInfoPolicy {
     65    IncludeCertificateInfo,
     66    DoNotIncludeCertificateInfo
     67};
     68
    6469struct ResourceLoaderOptions {
    6570    ResourceLoaderOptions()
     
    7176        , m_securityCheck(DoSecurityCheck)
    7277        , m_requestOriginPolicy(UseDefaultOriginRestrictionsForType)
     78        , m_certificateInfoPolicy(DoNotIncludeCertificateInfo)
    7379    {
    7480    }
    7581
    76     ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentials allowCredentials, ClientCredentialPolicy credentialPolicy, SecurityCheckPolicy securityCheck, RequestOriginPolicy requestOriginPolicy)
     82    ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentials allowCredentials, ClientCredentialPolicy credentialPolicy, SecurityCheckPolicy securityCheck, RequestOriginPolicy requestOriginPolicy, CertificateInfoPolicy certificateInfoPolicy)
    7783        : m_sendLoadCallbacks(sendLoadCallbacks)
    7884        , m_sniffContent(sniffContent)
     
    8288        , m_securityCheck(securityCheck)
    8389        , m_requestOriginPolicy(requestOriginPolicy)
     90        , m_certificateInfoPolicy(certificateInfoPolicy)
    8491    {
    8592    }
     
    99106    RequestOriginPolicy requestOriginPolicy() const { return static_cast<RequestOriginPolicy>(m_requestOriginPolicy); }
    100107    void setRequestOriginPolicy(RequestOriginPolicy policy) { m_requestOriginPolicy = policy; }
     108    CertificateInfoPolicy certificateInfoPolicy() const { return static_cast<CertificateInfoPolicy>(m_certificateInfoPolicy); }
     109    void setCertificateInfoPolicy(CertificateInfoPolicy policy) { m_certificateInfoPolicy = policy; }
    101110
    102111    unsigned m_sendLoadCallbacks : 1;
     
    107116    unsigned m_securityCheck : 1;
    108117    unsigned m_requestOriginPolicy : 2;
     118    unsigned m_certificateInfoPolicy : 1; // Whether the response should include certificate info.
    109119};
    110120
  • trunk/Source/WebCore/loader/SubresourceLoader.cpp

    r172790 r173558  
    196196    Ref<SubresourceLoader> protect(*this);
    197197
     198    if (shouldIncludeCertificateInfo())
     199        response.includeCertificateInfo();
     200
    198201    if (m_resource->resourceToRevalidate()) {
    199202        if (response.httpStatusCode() == 304) {
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r173173 r173558  
    212212    // FIXME: loadResource calls setOwningCachedResourceLoader() if the resource couldn't be added to cache. Does this function need to call it, too?
    213213
    214     userSheet->load(this, ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType));
     214    userSheet->load(this, ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo));
    215215   
    216216    return userSheet;
     
    975975const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions()
    976976{
    977     static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType);
     977    static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo);
    978978    return options;
    979979}
  • trunk/Source/WebCore/loader/icon/IconLoader.cpp

    r171743 r173558  
    6060        return;
    6161
    62     CachedResourceRequest request(ResourceRequest(m_frame.loader().icon().url()), ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForAnyCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType));
     62    CachedResourceRequest request(ResourceRequest(m_frame.loader().icon().url()), ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForAnyCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo));
    6363
    6464    request.mutableResourceRequest().setPriority(ResourceLoadPriorityLow);
  • trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp

    r170562 r173558  
    7373    URL requestURL = CFURLRequestGetURL(urlRequest.get());
    7474
    75     CachedResourceRequest request(ResourceRequest(requestURL), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType));
     75    CachedResourceRequest request(ResourceRequest(requestURL), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo));
    7676
    7777    request.mutableResourceRequest().setPriority(ResourceLoadPriorityLow);
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm

    r167264 r173558  
    6969    URL requestURL = [[m_avRequest.get() request] URL];
    7070
    71     CachedResourceRequest request(ResourceRequest(requestURL), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType));
     71    CachedResourceRequest request(ResourceRequest(requestURL), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo));
    7272
    7373    request.mutableResourceRequest().setPriority(ResourceLoadPriorityLow);
  • trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp

    r172928 r173558  
    10011001    RequestOriginPolicy corsPolicy = corsMode != MediaPlayerClient::Unspecified ? PotentiallyCrossOriginEnabled : UseDefaultOriginRestrictionsForType;
    10021002    StoredCredentials allowCredentials = corsMode == MediaPlayerClient::UseCredentials ? AllowStoredCredentials : DoNotAllowStoredCredentials;
    1003     ResourceLoaderOptions options(SendCallbacks, DoNotSniffContent, bufferingPolicy, allowCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, corsPolicy);
     1003    ResourceLoaderOptions options(SendCallbacks, DoNotSniffContent, bufferingPolicy, allowCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, corsPolicy, DoNotIncludeCertificateInfo);
    10041004
    10051005    CachedResourceRequest cacheRequest(request, options);
  • trunk/Source/WebKit2/ChangeLog

    r173553 r173558  
     12014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r173423): CertificateInfo is never sent to the UI process when using shared secondary process model
     4        https://bugs.webkit.org/show_bug.cgi?id=136669
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * WebProcess/Network/WebResourceLoadScheduler.cpp:
     9        (WebKit::WebResourceLoadScheduler::scheduleLoad): Use
     10        ResourceLoader::shouldIncludeCertificateInfo() to initialize
     11        needsCertificateInfo parameter.
     12
    1132014-09-11  Ryuan Choi  <ryuan.choi@gmail.com>
    214
  • trunk/Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp

    r173516 r173558  
    174174    loadParameters.isMainResource = resource && resource->type() == CachedResource::MainResource;
    175175    loadParameters.defersLoading = resourceLoader->defersLoading();
    176     loadParameters.needsCertificateInfo = loadParameters.isMainResource;
     176    loadParameters.needsCertificateInfo = resourceLoader->shouldIncludeCertificateInfo();
    177177    loadParameters.maximumBufferingTime = maximumBufferingTime(resource);
    178178
  • trunk/Tools/ChangeLog

    r173557 r173558  
     12014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r173423): CertificateInfo is never sent to the UI process when using shared secondary process model
     4        https://bugs.webkit.org/show_bug.cgi?id=136669
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * Scripts/run-gtk-tests:
     9        (TestRunner): Unskip SSL test.
     10
    1112014-09-12  Eric Carlson  <eric.carlson@apple.com>
    212
  • trunk/Tools/Scripts/run-gtk-tests

    r173435 r173558  
    6868        SkippedTest("WebKit2Gtk/TestWebKitWebView", "/webkit2/WebKitWebView/page-visibility", "Test fails or times out", 131731),
    6969        SkippedTest("WebKit2Gtk/TestCookieManager", "/webkit2/WebKitCookieManager/persistent-storage", "Test is flaky", 134580),
    70         SkippedTest("WebKit2Gtk/TestSSL", "/webkit2/WebKitWebView/ssl", "Assert fails after r173423", 136669),
    7170        SkippedTest("WebKit2/TestWebKit2", "WebKit2.MouseMoveAfterCrash", "Test is flaky", 85066),
    7271        SkippedTest("WebKit2/TestWebKit2", "WebKit2.NewFirstVisuallyNonEmptyLayoutForImages", "Test is flaky", 85066),
Note: See TracChangeset for help on using the changeset viewer.