REGRESSION(r173423): CertificateInfo is never sent to the UI process when using share...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Sep 2014 15:42:11 +0000 (15:42 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Sep 2014 15:42:11 +0000 (15:42 +0000)
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173558 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/NetscapePlugInStreamLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebCore/loader/ResourceLoaderOptions.h
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/icon/IconLoader.cpp
Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp
Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm
Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp
Tools/ChangeLog
Tools/Scripts/run-gtk-tests

index b744640..87aa1f3 100644 (file)
@@ -1,3 +1,44 @@
+2014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        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.
+
+        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.
+
 2014-09-11  Ryuan Choi  <ryuan.choi@gmail.com>
 
         Unreviewed build fix attempt on windows port since r173553.
index 9c2363e..6be2753 100644 (file)
@@ -1432,7 +1432,7 @@ void DocumentLoader::startLoadingMainResource()
 #endif
 
     ResourceRequest request(m_request);
-    static NeverDestroyed<ResourceLoaderOptions> mainResourceLoadOptions(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType);
+    static NeverDestroyed<ResourceLoaderOptions> mainResourceLoadOptions(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType, IncludeCertificateInfo);
     CachedResourceRequest cachedResourceRequest(request, mainResourceLoadOptions);
     m_mainResource = m_cachedResourceLoader->requestMainResource(cachedResourceRequest);
     if (!m_mainResource) {
index 9c6e505..42a3390 100644 (file)
@@ -37,7 +37,7 @@
 namespace WebCore {
 
 NetscapePlugInStreamLoader::NetscapePlugInStreamLoader(Frame* frame, NetscapePlugInStreamLoaderClient* client)
-    : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType))
+    : ResourceLoader(frame, ResourceLoaderOptions(SendCallbacks, SniffContent, DoNotBufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo))
     , m_client(client)
 {
 }
index e37f0c2..8d094c6 100644 (file)
@@ -123,6 +123,7 @@ public:
     void setSendCallbackPolicy(SendCallbackPolicy sendLoadCallbacks) { m_options.setSendLoadCallbacks(sendLoadCallbacks); }
     bool shouldSniffContent() const { return m_options.sniffContent() == SniffContent; }
     WEBCORE_EXPORT bool isAllowedToAskUserForCredentials() const;
+    bool shouldIncludeCertificateInfo() const { return m_options.certificateInfoPolicy() == IncludeCertificateInfo; }
 
     bool reachedTerminalState() const { return m_reachedTerminalState; }
 
index ec4b548..0c4256e 100644 (file)
@@ -61,6 +61,11 @@ enum RequestOriginPolicy {
     PotentiallyCrossOriginEnabled // Indicates "potentially CORS-enabled fetch" in HTML standard.
 };
 
+enum CertificateInfoPolicy {
+    IncludeCertificateInfo,
+    DoNotIncludeCertificateInfo
+};
+
 struct ResourceLoaderOptions {
     ResourceLoaderOptions()
         : m_sendLoadCallbacks(DoNotSendCallbacks)
@@ -70,10 +75,11 @@ struct ResourceLoaderOptions {
         , m_clientCredentialPolicy(DoNotAskClientForAnyCredentials)
         , m_securityCheck(DoSecurityCheck)
         , m_requestOriginPolicy(UseDefaultOriginRestrictionsForType)
+        , m_certificateInfoPolicy(DoNotIncludeCertificateInfo)
     {
     }
 
-    ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentials allowCredentials, ClientCredentialPolicy credentialPolicy, SecurityCheckPolicy securityCheck, RequestOriginPolicy requestOriginPolicy)
+    ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentials allowCredentials, ClientCredentialPolicy credentialPolicy, SecurityCheckPolicy securityCheck, RequestOriginPolicy requestOriginPolicy, CertificateInfoPolicy certificateInfoPolicy)
         : m_sendLoadCallbacks(sendLoadCallbacks)
         , m_sniffContent(sniffContent)
         , m_dataBufferingPolicy(dataBufferingPolicy)
@@ -81,6 +87,7 @@ struct ResourceLoaderOptions {
         , m_clientCredentialPolicy(credentialPolicy)
         , m_securityCheck(securityCheck)
         , m_requestOriginPolicy(requestOriginPolicy)
+        , m_certificateInfoPolicy(certificateInfoPolicy)
     {
     }
 
@@ -98,6 +105,8 @@ struct ResourceLoaderOptions {
     void setSecurityCheck(SecurityCheckPolicy check) { m_securityCheck = check; }
     RequestOriginPolicy requestOriginPolicy() const { return static_cast<RequestOriginPolicy>(m_requestOriginPolicy); }
     void setRequestOriginPolicy(RequestOriginPolicy policy) { m_requestOriginPolicy = policy; }
+    CertificateInfoPolicy certificateInfoPolicy() const { return static_cast<CertificateInfoPolicy>(m_certificateInfoPolicy); }
+    void setCertificateInfoPolicy(CertificateInfoPolicy policy) { m_certificateInfoPolicy = policy; }
 
     unsigned m_sendLoadCallbacks : 1;
     unsigned m_sniffContent : 1;
@@ -106,6 +115,7 @@ struct ResourceLoaderOptions {
     unsigned m_clientCredentialPolicy : 2; // When we should ask the client for credentials (if we allow credentials at all).
     unsigned m_securityCheck : 1;
     unsigned m_requestOriginPolicy : 2;
+    unsigned m_certificateInfoPolicy : 1; // Whether the response should include certificate info.
 };
 
 } // namespace WebCore    
index cbb0561..7d40e63 100644 (file)
@@ -195,6 +195,9 @@ void SubresourceLoader::didReceiveResponse(const ResourceResponse& response)
     // anything including removing the last reference to this object; one example of this is 3266216.
     Ref<SubresourceLoader> protect(*this);
 
+    if (shouldIncludeCertificateInfo())
+        response.includeCertificateInfo();
+
     if (m_resource->resourceToRevalidate()) {
         if (response.httpStatusCode() == 304) {
             // 304 Not modified / Use local copy
index f93b0d3..57573e3 100644 (file)
@@ -211,7 +211,7 @@ CachedResourceHandle<CachedCSSStyleSheet> CachedResourceLoader::requestUserCSSSt
     memoryCache()->add(userSheet.get());
     // FIXME: loadResource calls setOwningCachedResourceLoader() if the resource couldn't be added to cache. Does this function need to call it, too?
 
-    userSheet->load(this, ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType));
+    userSheet->load(this, ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo));
     
     return userSheet;
 }
@@ -974,7 +974,7 @@ void CachedResourceLoader::printPreloadStats()
 
 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions()
 {
-    static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType);
+    static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo);
     return options;
 }
 
index 0bc5583..5402eb0 100644 (file)
@@ -59,7 +59,7 @@ void IconLoader::startLoading()
     if (m_resource || !m_frame.document())
         return;
 
-    CachedResourceRequest request(ResourceRequest(m_frame.loader().icon().url()), ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForAnyCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType));
+    CachedResourceRequest request(ResourceRequest(m_frame.loader().icon().url()), ResourceLoaderOptions(SendCallbacks, SniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForAnyCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo));
 
     request.mutableResourceRequest().setPriority(ResourceLoadPriorityLow);
     request.setInitiator(cachedResourceRequestInitiators().icon);
index 84ea3e9..c5320be 100644 (file)
@@ -72,7 +72,7 @@ void WebCoreAVCFResourceLoader::startLoading()
     RetainPtr<CFURLRequestRef> urlRequest = AVCFAssetResourceLoadingRequestGetURLRequest(m_avRequest.get());
     URL requestURL = CFURLRequestGetURL(urlRequest.get());
 
-    CachedResourceRequest request(ResourceRequest(requestURL), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType));
+    CachedResourceRequest request(ResourceRequest(requestURL), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo));
 
     request.mutableResourceRequest().setPriority(ResourceLoadPriorityLow);
     CachedResourceLoader* loader = m_parent->player()->cachedResourceLoader();
index 783087e..f20e6a0 100644 (file)
@@ -68,7 +68,7 @@ void WebCoreAVFResourceLoader::startLoading()
 
     URL requestURL = [[m_avRequest.get() request] URL];
 
-    CachedResourceRequest request(ResourceRequest(requestURL), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType));
+    CachedResourceRequest request(ResourceRequest(requestURL), ResourceLoaderOptions(SendCallbacks, DoNotSniffContent, BufferData, DoNotAllowStoredCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo));
 
     request.mutableResourceRequest().setPriority(ResourceLoadPriorityLow);
     CachedResourceLoader* loader = m_parent->player()->cachedResourceLoader();
index 87cb203..c731017 100644 (file)
@@ -1000,7 +1000,7 @@ CachedResourceStreamingClient::CachedResourceStreamingClient(WebKitWebSrc* src,
     DataBufferingPolicy bufferingPolicy = request.url().protocolIs("blob") ? BufferData : DoNotBufferData;
     RequestOriginPolicy corsPolicy = corsMode != MediaPlayerClient::Unspecified ? PotentiallyCrossOriginEnabled : UseDefaultOriginRestrictionsForType;
     StoredCredentials allowCredentials = corsMode == MediaPlayerClient::UseCredentials ? AllowStoredCredentials : DoNotAllowStoredCredentials;
-    ResourceLoaderOptions options(SendCallbacks, DoNotSniffContent, bufferingPolicy, allowCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, corsPolicy);
+    ResourceLoaderOptions options(SendCallbacks, DoNotSniffContent, bufferingPolicy, allowCredentials, DoNotAskClientForCrossOriginCredentials, DoSecurityCheck, corsPolicy, DoNotIncludeCertificateInfo);
 
     CachedResourceRequest cacheRequest(request, options);
 
index c3c1a03..9d03e6d 100644 (file)
@@ -1,3 +1,15 @@
+2014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        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.
+
+        * WebProcess/Network/WebResourceLoadScheduler.cpp:
+        (WebKit::WebResourceLoadScheduler::scheduleLoad): Use
+        ResourceLoader::shouldIncludeCertificateInfo() to initialize
+        needsCertificateInfo parameter.
+
 2014-09-11  Ryuan Choi  <ryuan.choi@gmail.com>
 
         [EFL][CoordinatedGraphics] Move CoordinatedGraphicsScene and CoordinatedBackingStore to WebKit2
index 71c8889..1a7f9c1 100644 (file)
@@ -173,7 +173,7 @@ void WebResourceLoadScheduler::scheduleLoad(ResourceLoader* resourceLoader, Cach
     loadParameters.shouldClearReferrerOnHTTPSToHTTPRedirect = shouldClearReferrerOnHTTPSToHTTPRedirect;
     loadParameters.isMainResource = resource && resource->type() == CachedResource::MainResource;
     loadParameters.defersLoading = resourceLoader->defersLoading();
-    loadParameters.needsCertificateInfo = loadParameters.isMainResource;
+    loadParameters.needsCertificateInfo = resourceLoader->shouldIncludeCertificateInfo();
     loadParameters.maximumBufferingTime = maximumBufferingTime(resource);
 
     ASSERT((loadParameters.webPageID && loadParameters.webFrameID) || loadParameters.clientCredentialPolicy == DoNotAskClientForAnyCredentials);
index 6e771db..79e2194 100644 (file)
@@ -1,3 +1,13 @@
+2014-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        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.
+
+        * Scripts/run-gtk-tests:
+        (TestRunner): Unskip SSL test.
+
 2014-09-12  Eric Carlson  <eric.carlson@apple.com>
 
         Strip extraneous AVFoundation and CoreMedia logging
index cb23306..d530f9d 100755 (executable)
@@ -67,7 +67,6 @@ class TestRunner:
         SkippedTest("WebKit2Gtk/TestWebKitWebView", "/webkit2/WebKitWebView/snapshot", "Test fails", 120404),
         SkippedTest("WebKit2Gtk/TestWebKitWebView", "/webkit2/WebKitWebView/page-visibility", "Test fails or times out", 131731),
         SkippedTest("WebKit2Gtk/TestCookieManager", "/webkit2/WebKitCookieManager/persistent-storage", "Test is flaky", 134580),
-        SkippedTest("WebKit2Gtk/TestSSL", "/webkit2/WebKitWebView/ssl", "Assert fails after r173423", 136669),
         SkippedTest("WebKit2/TestWebKit2", "WebKit2.MouseMoveAfterCrash", "Test is flaky", 85066),
         SkippedTest("WebKit2/TestWebKit2", "WebKit2.NewFirstVisuallyNonEmptyLayoutForImages", "Test is flaky", 85066),
         SkippedTest("WebKit2/TestWebKit2", "WebKit2.NewFirstVisuallyNonEmptyLayoutFrames", "Test fails", 85037),