2011-03-28 Jeff Miller <jeffm@apple.com>
authorjeffm@apple.com <jeffm@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Mar 2011 20:09:21 +0000 (20:09 +0000)
committerjeffm@apple.com <jeffm@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Mar 2011 20:09:21 +0000 (20:09 +0000)
        Reviewed by Adam Roben.

        ResourceError::certificate() should return a PCCERT_CONTEXT
        https://bugs.webkit.org/show_bug.cgi?id=57262

        * platform/network/cf/ResourceError.h: certificate() now returns a PCCERT_CONTEXT.
        * platform/network/cf/ResourceErrorCF.cpp:
        (WebCore::ResourceError::certificate): Added.
2011-03-28  Jeff Miller  <jeffm@apple.com>

        Reviewed by Adam Roben.

        ResourceError::certificate() should return a PCCERT_CONTEXT
        https://bugs.webkit.org/show_bug.cgi?id=57262

        * Shared/win/PlatformCertificateInfo.cpp:
        (WebKit::PlatformCertificateInfo::PlatformCertificateInfo): Don't assert if no PCCERT_CONTEXT is specified.
        * Shared/win/WebCoreArgumentCodersWin.cpp:
        (CoreIPC::encodeResourceError): Removed unneeded code now that ResourceError::certificate() returns a PCCERT_CONTEXT.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/cf/ResourceError.h
Source/WebCore/platform/network/cf/ResourceErrorCF.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/win/PlatformCertificateInfo.cpp
Source/WebKit2/Shared/win/WebCoreArgumentCodersWin.cpp

index 5aa470b..a0694ca 100644 (file)
@@ -1,3 +1,14 @@
+2011-03-28  Jeff Miller  <jeffm@apple.com>
+
+        Reviewed by Adam Roben.
+
+        ResourceError::certificate() should return a PCCERT_CONTEXT
+        https://bugs.webkit.org/show_bug.cgi?id=57262
+
+        * platform/network/cf/ResourceError.h: certificate() now returns a PCCERT_CONTEXT.
+        * platform/network/cf/ResourceErrorCF.cpp:
+        (WebCore::ResourceError::certificate): Added.
+
 2011-03-28  David Hyatt  <hyatt@apple.com>
 
         Reviewed by Simon Fraser and Darin Adler.
index 72bedba..d36903f 100644 (file)
@@ -63,7 +63,7 @@ public:
 #if USE(CFNETWORK)
 #if PLATFORM(WIN)
     ResourceError(const String& domain, int errorCode, const String& failingURL, const String& localizedDescription, CFDataRef certificate);
-    CFDataRef certificate() const { return m_certificate.get(); }
+    PCCERT_CONTEXT certificate() const;
 #endif
     ResourceError(CFStreamError error);
     CFStreamError cfStreamError() const;
index 73ffe01..556ad6e 100644 (file)
@@ -52,6 +52,14 @@ ResourceError::ResourceError(const String& domain, int errorCode, const String&
     , m_certificate(certificate)
 {
 }
+
+PCCERT_CONTEXT ResourceError::certificate() const
+{
+    if (!m_certificate)
+        return 0;
+    
+    return reinterpret_cast<PCCERT_CONTEXT>(CFDataGetBytePtr(m_certificate.get()));
+}
 #endif // PLATFORM(WIN)
 
 const CFStringRef failingURLStringKey = CFSTR("NSErrorFailingURLStringKey");
index ab26327..a8b5429 100644 (file)
@@ -1,5 +1,17 @@
 2011-03-28  Jeff Miller  <jeffm@apple.com>
 
+        Reviewed by Adam Roben.
+
+        ResourceError::certificate() should return a PCCERT_CONTEXT
+        https://bugs.webkit.org/show_bug.cgi?id=57262
+
+        * Shared/win/PlatformCertificateInfo.cpp:
+        (WebKit::PlatformCertificateInfo::PlatformCertificateInfo): Don't assert if no PCCERT_CONTEXT is specified.
+        * Shared/win/WebCoreArgumentCodersWin.cpp:
+        (CoreIPC::encodeResourceError): Removed unneeded code now that ResourceError::certificate() returns a PCCERT_CONTEXT.
+
+2011-03-28  Jeff Miller  <jeffm@apple.com>
+
         Rubber-stamped by Adam Roben.
 
         Remove unused CFErrorRef.
index 9bfd791..0d1ca36 100644 (file)
@@ -75,7 +75,6 @@ PlatformCertificateInfo::PlatformCertificateInfo(const ResourceResponse& respons
 
 PlatformCertificateInfo::PlatformCertificateInfo(PCCERT_CONTEXT certificateContext)
 {
-    ASSERT(certificateContext);
     if (!certificateContext)
         return;
     
index d5946a7..9515bbd 100644 (file)
@@ -123,19 +123,7 @@ void encodeResourceError(ArgumentEncoder* encoder, const WebCore::ResourceError&
     encoder->encode(CoreIPC::In(resourceError.domain(), resourceError.errorCode(), resourceError.failingURL(), resourceError.localizedDescription()));
 
 #if USE(CFNETWORK)
-    CFDataRef certificateData = resourceError.certificate();
-    if (!certificateData) {
-        encoder->encode(WebKit::PlatformCertificateInfo());
-        return;
-    }
-
-    PCCERT_CONTEXT certificate = reinterpret_cast<PCCERT_CONTEXT>(CFDataGetBytePtr(certificateData));
-    if (!certificate) {
-        encoder->encode(WebKit::PlatformCertificateInfo());
-        return;
-    }
-    
-    encoder->encode(WebKit::PlatformCertificateInfo(certificate));
+    encoder->encode(WebKit::PlatformCertificateInfo(resourceError.certificate()));
 #endif
 }