<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[171801] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/171801">171801</a></dd>
<dt>Author</dt> <dd>mitz@apple.com</dd>
<dt>Date</dt> <dd>2014-07-30 11:56:13 -0700 (Wed, 30 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>
Source/WebCore: Made Credential hold onto an NSURLCredential when needed.
Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327

Reviewed by Alexey Proskuryakov.

No change in functionality.

* WebCore.exp.in: Updated.

* platform/network/Credential.h: Removed definition of CERTIFICATE_CREDENTIALS_SUPPORTED,
which is not used anymore.

* platform/network/CredentialBase.h:
(WebCore::CredentialBase::encodingRequiresPlatformData): Added a base implementation that
returns false.

* platform/network/cf/AuthenticationCF.cpp:
Changed to use the Credential constructor that takes an CFURLCredential, and the new
cfCredential member function. Made the createCF and core functions Windows-only and
therefore removed the CERTIFICATE_CREDENTIALS_SUPPORTED code from them.
* platform/network/cf/AuthenticationCF.h:

* platform/network/cf/CredentialStorageCFNet.cpp:
(WebCore::CredentialStorage::getFromPersistentStorage): Changed to construct a Credential
from a CFURLCredential.
(WebCore::CredentialStorage::saveToPersistentStorage): Changed to use the new cfCredential
member function.

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto to both.
(WebCore::ResourceHandle::receivedCredential): Ditto.

* platform/network/cocoa/CredentialCocoa.h:
Replaced the m_identity, m_certificates and m_type member variables with an m_nsCredential
one holding onto an NSURLCredential. Declared constructors from and getters for
NSURLCredential and CFURLCredentialRef.
(WebCore::Credential::encodingRequiresPlatformData): Override that checks the
NSURLCredential if necessary.

* platform/network/cocoa/CredentialCocoa.mm:
(WebCore::toNSURLCredentialPersistence): New helper function.
(WebCore::toCredentialPersistence): Ditto.
(WebCore::Credential::Credential): Defined constructors to create or take an
NSURLCredential.
(WebCore::Credential::cfCredential): Added.
(WebCore::Credential::nsCredential): Added. Returns nil for the empty credential.
(WebCore::Credential::isEmpty): Changed to check m_nsCredential.
(WebCore::Credential::platformCompare): Changed to compare m_nsCredential if needed.
(WebCore::Credential::encodingRequiresPlatformData): Returns true if the credential is not
a user and a password.

* platform/network/mac/AuthenticationMac.h: Removed mac and core functions for Credential.
* platform/network/mac/AuthenticationMac.mm:
(-[WebCoreAuthenticationClientAsChallengeSender useCredential:forAuthenticationChallenge:]):
Changed to use Credential constructor that takes an NSURLCredential.
(WebCore::AuthenticationChallenge::AuthenticationChallenge): Ditto. Also use the
nsCredential getter.

* platform/network/mac/CredentialStorageMac.mm:
(WebCore::CredentialStorage::getFromPersistentStorage): Use new Credential constructor.

* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto. Also use the
nsCredential getter.
(WebCore::ResourceHandle::receivedCredential): Ditto.

Source/WebKit/mac: Updated for changes to the WebCore::Credential API.
Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327

Reviewed by Alexey Proskuryakov.

* Misc/WebDownload.mm:
(-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]): Use new nsCredential
getter.
* Plugins/WebBaseNetscapePluginView.mm:
(WebKit::getAuthenticationInfo): Ditto.

Source/WebKit2: Updated for changes to the WebCore::Credential API.
Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327

Reviewed by Alexey Proskuryakov.

* Shared/Downloads/mac/DownloadMac.mm:
(WebKit::Download::receivedCredential):Use new Credential::nsCredential getter.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;Credential&gt;::encode):  If encoding the credential requires encoding the
platform data, do that.
(IPC::ArgumentCoder&lt;Credential&gt;::decode): If platform data was encoded, decode it.
* Shared/WebCoreArgumentCoders.h:

* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder&lt;Credential&gt;::encodePlatformData): Archive the NSURLCredential.
(IPC::ArgumentCoder&lt;Credential&gt;::decodePlatformData): Unarchive it.

* UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
(-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]): Use
Credential constructor that takes an NSURLCredential.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkCredentialh">trunk/Source/WebCore/platform/network/Credential.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkCredentialBaseh">trunk/Source/WebCore/platform/network/CredentialBase.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfAuthenticationCFcpp">trunk/Source/WebCore/platform/network/cf/AuthenticationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfAuthenticationCFh">trunk/Source/WebCore/platform/network/cf/AuthenticationCF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfCredentialStorageCFNetcpp">trunk/Source/WebCore/platform/network/cf/CredentialStorageCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceHandleCFNetcpp">trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcocoaCredentialCocoah">trunk/Source/WebCore/platform/network/cocoa/CredentialCocoa.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcocoaCredentialCocoamm">trunk/Source/WebCore/platform/network/cocoa/CredentialCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacAuthenticationMach">trunk/Source/WebCore/platform/network/mac/AuthenticationMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacAuthenticationMacmm">trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacCredentialStorageMacmm">trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm">trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebDownloadmm">trunk/Source/WebKit/mac/Misc/WebDownload.mm</a></li>
<li><a href="#trunkSourceWebKitmacPluginsWebBaseNetscapePluginViewmm">trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedDownloadsmacDownloadMacmm">trunk/Source/WebKit2/Shared/Downloads/mac/DownloadMac.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCodersh">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2SharedmacWebCoreArgumentCodersMacmm">trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedsoupWebCoreArgumentCodersSoupcpp">trunk/Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKNSURLAuthenticationChallengemm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaNavigationStatemm">trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/ChangeLog        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -1,3 +1,71 @@
</span><ins>+2014-07-30  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        Made Credential hold onto an NSURLCredential when needed.
+        Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327
+
+        Reviewed by Alexey Proskuryakov.
+
+        No change in functionality.
+
+        * WebCore.exp.in: Updated.
+
+        * platform/network/Credential.h: Removed definition of CERTIFICATE_CREDENTIALS_SUPPORTED,
+        which is not used anymore.
+
+        * platform/network/CredentialBase.h:
+        (WebCore::CredentialBase::encodingRequiresPlatformData): Added a base implementation that
+        returns false.
+
+        * platform/network/cf/AuthenticationCF.cpp:
+        Changed to use the Credential constructor that takes an CFURLCredential, and the new
+        cfCredential member function. Made the createCF and core functions Windows-only and
+        therefore removed the CERTIFICATE_CREDENTIALS_SUPPORTED code from them.
+        * platform/network/cf/AuthenticationCF.h:
+
+        * platform/network/cf/CredentialStorageCFNet.cpp:
+        (WebCore::CredentialStorage::getFromPersistentStorage): Changed to construct a Credential
+        from a CFURLCredential.
+        (WebCore::CredentialStorage::saveToPersistentStorage): Changed to use the new cfCredential
+        member function.
+
+        * platform/network/cf/ResourceHandleCFNet.cpp:
+        (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto to both.
+        (WebCore::ResourceHandle::receivedCredential): Ditto.
+
+        * platform/network/cocoa/CredentialCocoa.h:
+        Replaced the m_identity, m_certificates and m_type member variables with an m_nsCredential
+        one holding onto an NSURLCredential. Declared constructors from and getters for
+        NSURLCredential and CFURLCredentialRef.
+        (WebCore::Credential::encodingRequiresPlatformData): Override that checks the
+        NSURLCredential if necessary.
+
+        * platform/network/cocoa/CredentialCocoa.mm:
+        (WebCore::toNSURLCredentialPersistence): New helper function.
+        (WebCore::toCredentialPersistence): Ditto.
+        (WebCore::Credential::Credential): Defined constructors to create or take an
+        NSURLCredential.
+        (WebCore::Credential::cfCredential): Added.
+        (WebCore::Credential::nsCredential): Added. Returns nil for the empty credential.
+        (WebCore::Credential::isEmpty): Changed to check m_nsCredential.
+        (WebCore::Credential::platformCompare): Changed to compare m_nsCredential if needed.
+        (WebCore::Credential::encodingRequiresPlatformData): Returns true if the credential is not
+        a user and a password.
+
+        * platform/network/mac/AuthenticationMac.h: Removed mac and core functions for Credential.
+        * platform/network/mac/AuthenticationMac.mm:
+        (-[WebCoreAuthenticationClientAsChallengeSender useCredential:forAuthenticationChallenge:]):
+        Changed to use Credential constructor that takes an NSURLCredential.
+        (WebCore::AuthenticationChallenge::AuthenticationChallenge): Ditto. Also use the
+        nsCredential getter.
+
+        * platform/network/mac/CredentialStorageMac.mm:
+        (WebCore::CredentialStorage::getFromPersistentStorage): Use new Credential constructor.
+
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto. Also use the
+        nsCredential getter.
+        (WebCore::ResourceHandle::receivedCredential): Ditto.
+
</ins><span class="cx"> 2014-07-30  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Build depends on OpenGL ES
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -71,6 +71,8 @@
</span><span class="cx"> __ZN7WebCore10ClientRectC1ERKNS_7IntRectE
</span><span class="cx"> __ZN7WebCore10ClientRectC1ERKNS_9FloatRectE
</span><span class="cx"> __ZN7WebCore10ClientRectC1Ev
</span><ins>+__ZN7WebCore10Credential28encodingRequiresPlatformDataEP15NSURLCredential
+__ZN7WebCore10CredentialC1EP15NSURLCredential
</ins><span class="cx"> __ZN7WebCore10FloatPointC1ERK7CGPoint
</span><span class="cx"> __ZN7WebCore10FloatPointC1ERKNS_8IntPointE
</span><span class="cx"> __ZN7WebCore10FontGlyphs15releaseFontDataEv
</span><span class="lines">@@ -1072,7 +1074,6 @@
</span><span class="cx"> __ZN7WebCore3URLC1EP5NSURL
</span><span class="cx"> __ZN7WebCore3URLC1EPK7__CFURL
</span><span class="cx"> __ZN7WebCore3URLC1ERKS0_RKN3WTF6StringE
</span><del>-__ZN7WebCore3macERKNS_10CredentialE
</del><span class="cx"> __ZN7WebCore3macERKNS_23AuthenticationChallengeE
</span><span class="cx"> __ZN7WebCore40restrictMinimumScaleFactorToViewportSizeERNS_18ViewportAttributesENS_7IntSizeEf
</span><span class="cx"> __ZN7WebCore42URLByTruncatingOneCharacterBeforeComponentEP5NSURL18CFURLComponentType
</span><span class="lines">@@ -1149,7 +1150,6 @@
</span><span class="cx"> __ZN7WebCore4Path14addRoundedRectERKNS_9FloatRectERKNS_9FloatSizeENS0_19RoundedRectStrategyE
</span><span class="cx"> __ZN7WebCore4PathC1Ev
</span><span class="cx"> __ZN7WebCore4PathD1Ev
</span><del>-__ZN7WebCore4coreEP15NSURLCredential
</del><span class="cx"> __ZN7WebCore4coreEP28NSURLAuthenticationChallenge
</span><span class="cx"> __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS0_7ProfileE
</span><span class="cx"> __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ClientRectE
</span><span class="lines">@@ -1536,10 +1536,8 @@
</span><span class="cx"> __ZN7WebCore9unionRectERKN3WTF6VectorINS_9FloatRectELm0ENS0_15CrashOnOverflowEEE
</span><span class="cx"> __ZNK3JSC8Bindings10RootObject12globalObjectEv
</span><span class="cx"> __ZNK3WTF6String14createCFStringEv
</span><del>-__ZNK7WebCore10Credential12certificatesEv
-__ZNK7WebCore10Credential4typeEv
</del><ins>+__ZNK7WebCore10Credential12nsCredentialEv
</ins><span class="cx"> __ZNK7WebCore10Credential7isEmptyEv
</span><del>-__ZNK7WebCore10Credential8identityEv
</del><span class="cx"> __ZNK7WebCore10FloatPointcv7CGPointEv
</span><span class="cx"> __ZNK7WebCore10FontGlyphs17realizeFontDataAtERKNS_15FontDescriptionEj
</span><span class="cx"> __ZNK7WebCore10LayoutRect8containsERKS0_
</span><span class="lines">@@ -2221,7 +2219,6 @@
</span><span class="cx"> .objc_class_name_WebFontCache
</span><span class="cx"> .objc_class_name_WebWindowFadeAnimation
</span><span class="cx"> .objc_class_name_WebWindowScaleAnimation
</span><del>-__ZN7WebCore10CredentialC1EP20OpaqueSecIdentityRefPK9__CFArrayNS_21CredentialPersistenceE
</del><span class="cx"> __ZN7WebCore10FloatPointC1ERK8_NSPoint
</span><span class="cx"> __ZN7WebCore10handCursorEv
</span><span class="cx"> __ZN7WebCore11CachedImage5imageEv
</span><span class="lines">@@ -2527,7 +2524,6 @@
</span><span class="cx"> _WebUIApplicationDidBecomeActiveNotification
</span><span class="cx"> _WebUIApplicationWillEnterForegroundNotification
</span><span class="cx"> _WebUIApplicationWillResignActiveNotification
</span><del>-__ZN7WebCore10CredentialC1EP13__SecIdentityPK9__CFArrayNS_21CredentialPersistenceE
</del><span class="cx"> __ZN7WebCore10RenderView35resumePausedImageAnimationsIfNeededEv
</span><span class="cx"> __ZN7WebCore10ScrollView15setScrollOffsetERKNS_8IntPointE
</span><span class="cx"> __ZN7WebCore10ScrollView21setExposedContentRectERKNS_9FloatRectE
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkCredentialh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/Credential.h (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/Credential.h        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/Credential.h        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -32,9 +32,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CredentialBase.h&quot;
</span><span class="cx"> 
</span><del>-// FIXME: Remove this macro once it is not used in WebKit.
-#define CERTIFICATE_CREDENTIALS_SUPPORTED 0
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Credential : public CredentialBase {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkCredentialBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/CredentialBase.h (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/CredentialBase.h        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/CredentialBase.h        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -47,7 +47,9 @@
</span><span class="cx">     const String&amp; password() const;
</span><span class="cx">     bool hasPassword() const;
</span><span class="cx">     CredentialPersistence persistence() const;
</span><del>-    
</del><ins>+
+    bool encodingRequiresPlatformData() const { return false; }
+
</ins><span class="cx">     static bool compare(const Credential&amp;, const Credential&amp;);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfAuthenticationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/AuthenticationCF.cpp (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/AuthenticationCF.cpp        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/cf/AuthenticationCF.cpp        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -55,10 +55,11 @@
</span><span class="cx">                                                  AuthenticationClient* authenticationClient)
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     : AuthenticationChallengeBase(ProtectionSpace(CFURLAuthChallengeGetProtectionSpace(cfChallenge)),
</span><ins>+                                  Credential(CFURLAuthChallengeGetProposedCredential(cfChallenge)),
</ins><span class="cx"> #else
</span><span class="cx">     : AuthenticationChallengeBase(core(CFURLAuthChallengeGetProtectionSpace(cfChallenge)),
</span><del>-#endif
</del><span class="cx">                                   core(CFURLAuthChallengeGetProposedCredential(cfChallenge)),
</span><ins>+#endif
</ins><span class="cx">                                   CFURLAuthChallengeGetPreviousFailureCount(cfChallenge),
</span><span class="cx">                                   (CFURLResponseRef)CFURLAuthChallengeGetFailureResponse(cfChallenge),
</span><span class="cx">                                   CFURLAuthChallengeGetError(cfChallenge))
</span><span class="lines">@@ -92,22 +93,22 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Why not cache CFURLAuthChallengeRef in m_cfChallenge? Foundation counterpart does that.
</span><span class="cx"> 
</span><del>-    CFURLCredentialRef credential = createCF(coreChallenge.proposedCredential());
-    
</del><span class="cx"> #if PLATFORM(COCOA)
</span><del>-    CFURLAuthChallengeRef result = CFURLAuthChallengeCreate(0, coreChallenge.protectionSpace().cfSpace(), credential,
</del><ins>+    CFURLAuthChallengeRef result = CFURLAuthChallengeCreate(0, coreChallenge.protectionSpace().cfSpace(), coreChallenge.proposedCredential().cfCredential(),
</ins><span class="cx"> #else
</span><ins>+    RetainPtr&lt;CFURLCredentialRef&gt; credential = adoptCF(createCF(coreChallenge.proposedCredential()));
</ins><span class="cx">     RetainPtr&lt;CFURLProtectionSpaceRef&gt; protectionSpace = adoptCF(createCF(coreChallenge.protectionSpace()));
</span><span class="cx"> 
</span><del>-    CFURLAuthChallengeRef result = CFURLAuthChallengeCreate(0, protectionSpace.get(), credential,
</del><ins>+    CFURLAuthChallengeRef result = CFURLAuthChallengeCreate(0, protectionSpace.get(), credential.get(),
</ins><span class="cx"> #endif
</span><span class="cx">                                         coreChallenge.previousFailureCount(),
</span><span class="cx">                                         coreChallenge.failureResponse().cfURLResponse(),
</span><span class="cx">                                         coreChallenge.error());
</span><del>-    CFRelease(credential);
</del><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(WIN)
+
</ins><span class="cx"> CFURLCredentialRef createCF(const Credential&amp; coreCredential)
</span><span class="cx"> {
</span><span class="cx">     CFURLCredentialPersistence persistence = kCFURLCredentialPersistenceNone;
</span><span class="lines">@@ -124,15 +125,9 @@
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-#if CERTIFICATE_CREDENTIALS_SUPPORTED
-    if (coreCredential.type() == CredentialTypeClientCertificate)
-        return CFURLCredentialCreateWithIdentityAndCertificateArray(kCFAllocatorDefault, coreCredential.identity(), coreCredential.certificates(), persistence);
-#endif
-
</del><span class="cx">     return CFURLCredentialCreate(0, coreCredential.user().createCFString().get(), coreCredential.password().createCFString().get(), 0, persistence);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(WIN)
</del><span class="cx"> CFURLProtectionSpaceRef createCF(const ProtectionSpace&amp; coreSpace)
</span><span class="cx"> {
</span><span class="cx">     CFURLProtectionSpaceServerType serverType = kCFURLProtectionSpaceServerHTTP;
</span><span class="lines">@@ -199,7 +194,6 @@
</span><span class="cx"> 
</span><span class="cx">     return CFURLProtectionSpaceCreate(0, coreSpace.host().createCFString().get(), coreSpace.port(), serverType, coreSpace.realm().createCFString().get(), scheme);
</span><span class="cx"> }
</span><del>-#endif // PLATFORM(WIN)
</del><span class="cx"> 
</span><span class="cx"> Credential core(CFURLCredentialRef cfCredential)
</span><span class="cx"> {
</span><span class="lines">@@ -220,17 +214,10 @@
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if CERTIFICATE_CREDENTIALS_SUPPORTED
-    SecIdentityRef identity = CFURLCredentialGetCertificateIdentity(cfCredential);
-    if (identity)
-        return Credential(identity, CFURLCredentialGetCertificateArray(cfCredential), persistence);
-#endif
-
</del><span class="cx">     RetainPtr&lt;CFStringRef&gt; password = adoptCF(CFURLCredentialCopyPassword(cfCredential));
</span><span class="cx">     return Credential(CFURLCredentialGetUsername(cfCredential), password.get(), persistence);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(WIN)
</del><span class="cx"> ProtectionSpace core(CFURLProtectionSpaceRef cfSpace)
</span><span class="cx"> {
</span><span class="cx">     ProtectionSpaceServerType serverType = ProtectionSpaceServerHTTP;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfAuthenticationCFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/AuthenticationCF.h (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/AuthenticationCF.h        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/cf/AuthenticationCF.h        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -40,16 +40,16 @@
</span><span class="cx"> class ProtectionSpace;
</span><span class="cx"> 
</span><span class="cx"> CFURLAuthChallengeRef createCF(const AuthenticationChallenge&amp;);
</span><ins>+#if PLATFORM(WIN)
</ins><span class="cx"> CFURLCredentialRef createCF(const Credential&amp;);
</span><del>-#if PLATFORM(WIN)
</del><span class="cx"> CFURLProtectionSpaceRef createCF(const ProtectionSpace&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> AuthenticationChallenge core(CFURLAuthChallengeRef);
</span><span class="cx"> #endif
</span><ins>+#if PLATFORM(WIN)
</ins><span class="cx"> Credential core(CFURLCredentialRef);
</span><del>-#if PLATFORM(WIN)
</del><span class="cx"> ProtectionSpace core(CFURLProtectionSpaceRef);
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfCredentialStorageCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/CredentialStorageCFNet.cpp (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/CredentialStorageCFNet.cpp        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/cf/CredentialStorageCFNet.cpp        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -49,11 +49,12 @@
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     RetainPtr&lt;CFURLCredentialRef&gt; credentialCF = adoptCF(wkCopyCredentialFromCFPersistentStorage(protectionSpace.cfSpace()));
</span><ins>+    return Credential(credentialCF.get());
</ins><span class="cx"> #else
</span><span class="cx">     RetainPtr&lt;CFURLProtectionSpaceRef&gt; protectionSpaceCF = adoptCF(createCF(protectionSpace));
</span><span class="cx">     RetainPtr&lt;CFURLCredentialRef&gt; credentialCF = adoptCF(wkCopyCredentialFromCFPersistentStorage(protectionSpaceCF.get()));
</span><del>-#endif
</del><span class="cx">     return core(credentialCF.get());
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -63,12 +64,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (credential.persistence() == CredentialPersistenceNone) {
</span><span class="cx">         Credential sessionCredential(credential, CredentialPersistenceForSession);
</span><del>-        RetainPtr&lt;CFURLCredentialRef&gt; sessionCredentialCF = adoptCF(createCF(sessionCredential));
-        CFURLCredentialStorageSetDefaultCredentialForProtectionSpace(storageCF.get(), sessionCredentialCF.get(), protectionSpace.cfSpace());
-    } else {
-        RetainPtr&lt;CFURLCredentialRef&gt; credentialCF = adoptCF(createCF(credential));
-        CFURLCredentialStorageSetDefaultCredentialForProtectionSpace(storageCF.get(), credentialCF.get(), protectionSpace.cfSpace());
-    }
</del><ins>+        CFURLCredentialStorageSetDefaultCredentialForProtectionSpace(storageCF.get(), sessionCredential.cfCredential(), protectionSpace.cfSpace());
+    } else
+        CFURLCredentialStorageSetDefaultCredentialForProtectionSpace(storageCF.get(), credential.cfCredential(), protectionSpace.cfSpace());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceHandleCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -342,14 +342,19 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (!d-&gt;m_user.isNull() &amp;&amp; !d-&gt;m_pass.isNull()) {
</span><del>-        RetainPtr&lt;CFURLCredentialRef&gt; credential = adoptCF(CFURLCredentialCreate(kCFAllocatorDefault, d-&gt;m_user.createCFString().get(), d-&gt;m_pass.createCFString().get(), 0, kCFURLCredentialPersistenceNone));
</del><ins>+        RetainPtr&lt;CFURLCredentialRef&gt; cfCredential = adoptCF(CFURLCredentialCreate(kCFAllocatorDefault, d-&gt;m_user.createCFString().get(), d-&gt;m_pass.createCFString().get(), 0, kCFURLCredentialPersistenceNone));
+#if PLATFORM(COCOA)
+        Credential credential = Credential(cfCredential.get());
+#else
+        Credential credential = core(cfCredential.get());
+#endif
</ins><span class="cx">         
</span><span class="cx">         URL urlToStore;
</span><span class="cx">         if (challenge.failureResponse().httpStatusCode() == 401)
</span><span class="cx">             urlToStore = challenge.failureResponse().url();
</span><del>-        CredentialStorage::set(core(credential.get()), challenge.protectionSpace(), urlToStore);
</del><ins>+        CredentialStorage::set(credential, challenge.protectionSpace(), urlToStore);
</ins><span class="cx">         
</span><del>-        CFURLConnectionUseCredential(d-&gt;m_connection.get(), credential.get(), challenge.cfURLAuthChallengeRef());
</del><ins>+        CFURLConnectionUseCredential(d-&gt;m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
</ins><span class="cx">         d-&gt;m_user = String();
</span><span class="cx">         d-&gt;m_pass = String();
</span><span class="cx">         // FIXME: Per the specification, the user shouldn't be asked for credentials if there were incorrect ones provided explicitly.
</span><span class="lines">@@ -372,8 +377,12 @@
</span><span class="cx">                     // Store the credential back, possibly adding it as a default for this directory.
</span><span class="cx">                     CredentialStorage::set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</span><span class="cx">                 }
</span><ins>+#if PLATFORM(COCOA)
+                CFURLConnectionUseCredential(d-&gt;m_connection.get(), credential.cfCredential(), challenge.cfURLAuthChallengeRef());
+#else
</ins><span class="cx">                 RetainPtr&lt;CFURLCredentialRef&gt; cfCredential = adoptCF(createCF(credential));
</span><span class="cx">                 CFURLConnectionUseCredential(d-&gt;m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
</span><ins>+#endif
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -416,17 +425,25 @@
</span><span class="cx">         // Manage per-session credentials internally, because once NSURLCredentialPersistencePerSession is used, there is no way
</span><span class="cx">         // to ignore it for a particular request (short of removing it altogether).
</span><span class="cx">         Credential webCredential(credential.user(), credential.password(), CredentialPersistenceNone);
</span><del>-        RetainPtr&lt;CFURLCredentialRef&gt; cfCredential = adoptCF(createCF(webCredential));
-        
</del><ins>+
</ins><span class="cx">         URL urlToStore;
</span><span class="cx">         if (challenge.failureResponse().httpStatusCode() == 401)
</span><span class="cx">             urlToStore = challenge.failureResponse().url();      
</span><span class="cx">         CredentialStorage::set(webCredential, challenge.protectionSpace(), urlToStore);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(COCOA)
+        CFURLConnectionUseCredential(d-&gt;m_connection.get(), webCredential.cfCredential(), challenge.cfURLAuthChallengeRef());
+#else
+        RetainPtr&lt;CFURLCredentialRef&gt; cfCredential = adoptCF(createCF(webCredential));
</ins><span class="cx">         CFURLConnectionUseCredential(d-&gt;m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
</span><ins>+#endif
</ins><span class="cx">     } else {
</span><ins>+#if PLATFORM(COCOA)
+        CFURLConnectionUseCredential(d-&gt;m_connection.get(), credential.cfCredential(), challenge.cfURLAuthChallengeRef());
+#else
</ins><span class="cx">         RetainPtr&lt;CFURLCredentialRef&gt; cfCredential = adoptCF(createCF(credential));
</span><span class="cx">         CFURLConnectionUseCredential(d-&gt;m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef());
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     clearAuthentication();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcocoaCredentialCocoah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cocoa/CredentialCocoa.h (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cocoa/CredentialCocoa.h        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/cocoa/CredentialCocoa.h        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -30,50 +30,48 @@
</span><span class="cx"> #include &lt;Security/SecBase.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><del>-// FIXME: Remove this macro once it is not used in WebKit.
-#define CERTIFICATE_CREDENTIALS_SUPPORTED 1
</del><ins>+#if USE(CFNETWORK)
+typedef const struct _CFURLCredential* CFURLCredentialRef;
+#endif
</ins><span class="cx"> 
</span><ins>+OBJC_CLASS NSURLCredential;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-enum CredentialType {
-    CredentialTypePassword,
-    CredentialTypeClientCertificate
-};
-
</del><span class="cx"> class Credential : public CredentialBase {
</span><span class="cx"> public:
</span><span class="cx">     Credential()
</span><span class="cx">         : CredentialBase()
</span><del>-        , m_type(CredentialTypePassword)
</del><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Credential(const String&amp; user, const String&amp; password, CredentialPersistence persistence)
</span><span class="cx">         : CredentialBase(user, password, persistence)
</span><del>-        , m_type(CredentialTypePassword)
</del><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Credential(const Credential&amp; original, CredentialPersistence persistence)
-        : CredentialBase(original, persistence)
-        , m_type(original.m_type)
-    {
-    }
</del><ins>+    Credential(const Credential&amp;, CredentialPersistence);
</ins><span class="cx"> 
</span><del>-    Credential(SecIdentityRef, CFArrayRef certificates, CredentialPersistence);
</del><ins>+#if USE(CFNETWORK)
+    explicit Credential(CFURLCredentialRef);
+#endif
+    explicit Credential(NSURLCredential *);
</ins><span class="cx"> 
</span><span class="cx">     bool isEmpty() const;
</span><span class="cx"> 
</span><del>-    SecIdentityRef identity() const;
-    CFArrayRef certificates() const;
-    CredentialType type() const;
</del><ins>+    bool encodingRequiresPlatformData() const { return m_nsCredential &amp;&amp; encodingRequiresPlatformData(m_nsCredential.get()); }
</ins><span class="cx"> 
</span><ins>+#if USE(CFNETWORK)
+    CFURLCredentialRef cfCredential() const;
+#endif
+    NSURLCredential *nsCredential() const;
+
</ins><span class="cx">     static bool platformCompare(const Credential&amp;, const Credential&amp;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    RetainPtr&lt;SecIdentityRef&gt; m_identity;
-    RetainPtr&lt;CFArrayRef&gt; m_certificates;
-    CredentialType m_type;
</del><ins>+    static bool encodingRequiresPlatformData(NSURLCredential *);
+
+    mutable RetainPtr&lt;NSURLCredential&gt; m_nsCredential;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcocoaCredentialCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cocoa/CredentialCocoa.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cocoa/CredentialCocoa.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/cocoa/CredentialCocoa.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -26,51 +26,118 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;CredentialCocoa.h&quot;
</span><span class="cx"> 
</span><ins>+#if USE(CFNETWORK)
+@interface NSURLCredential (WebDetails)
+- (id)_initWithCFURLCredential:(CFURLCredentialRef)credential;
+- (CFURLCredentialRef) _CFURLCredential;
+@end
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Credential::Credential(SecIdentityRef identity, CFArrayRef certificates, CredentialPersistence persistence)
-    : CredentialBase(emptyString(), emptyString(), persistence)
-    , m_identity(identity)
-    , m_certificates(certificates)
-    , m_type(CredentialTypeClientCertificate)
</del><ins>+static NSURLCredentialPersistence toNSURLCredentialPersistence(CredentialPersistence persistence)
</ins><span class="cx"> {
</span><ins>+    switch (persistence) {
+    case CredentialPersistenceNone:
+        return NSURLCredentialPersistenceNone;
+    case CredentialPersistenceForSession:
+        return NSURLCredentialPersistenceForSession;
+    case CredentialPersistencePermanent:
+        return NSURLCredentialPersistencePermanent;
+    }
+
+    ASSERT_NOT_REACHED();
+    return NSURLCredentialPersistenceNone;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Credential::isEmpty() const
</del><ins>+static CredentialPersistence toCredentialPersistence(NSURLCredentialPersistence persistence)
</ins><span class="cx"> {
</span><del>-    if (m_type == CredentialTypeClientCertificate &amp;&amp; (m_identity || m_certificates))
-        return false;
</del><ins>+    switch (persistence) {
+    case NSURLCredentialPersistenceNone:
+        return CredentialPersistenceNone;
+    case NSURLCredentialPersistenceForSession:
+        return CredentialPersistenceForSession;
+    case NSURLCredentialPersistencePermanent:
+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
+    case NSURLCredentialPersistenceSynchronizable:
+#endif
+        return CredentialPersistencePermanent;
+    }
</ins><span class="cx"> 
</span><del>-    return CredentialBase::isEmpty();
</del><ins>+    ASSERT_NOT_REACHED();
+    return CredentialPersistenceNone;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-SecIdentityRef Credential::identity() const
</del><ins>+Credential::Credential(const Credential&amp; original, CredentialPersistence persistence)
+    : CredentialBase(original, persistence)
</ins><span class="cx"> {
</span><del>-    return m_identity.get();
</del><ins>+    NSURLCredential *originalNSURLCredential = original.m_nsCredential.get();
+    if (!originalNSURLCredential)
+        return;
+
+    if (NSString *user = originalNSURLCredential.user)
+        m_nsCredential = adoptNS([[NSURLCredential alloc] initWithUser:user password:originalNSURLCredential.password persistence:toNSURLCredentialPersistence(persistence)]);
+    else if (SecIdentityRef identity = originalNSURLCredential.identity)
+        m_nsCredential = adoptNS([[NSURLCredential alloc] initWithIdentity:identity certificates:originalNSURLCredential.certificates persistence:toNSURLCredentialPersistence(persistence)]);
+    else {
+        // It is not possible to set the persistence of server trust credentials.
+        ASSERT_NOT_REACHED();
+        m_nsCredential = originalNSURLCredential;
+    }
</ins><span class="cx"> }
</span><del>-    
-CFArrayRef Credential::certificates() const
</del><ins>+
+#if USE(CFNETWORK)
+Credential::Credential(CFURLCredentialRef credential)
+    : Credential(adoptNS([[NSURLCredential alloc] _initWithCFURLCredential:credential]).get())
</ins><span class="cx"> {
</span><del>-    return m_certificates.get();
</del><span class="cx"> }
</span><del>-    
-CredentialType Credential::type() const
</del><ins>+#endif
+
+Credential::Credential(NSURLCredential *credential)
+    : CredentialBase(credential.user, credential.password, toCredentialPersistence(credential.persistence))
+    , m_nsCredential(credential)
</ins><span class="cx"> {
</span><del>-    return m_type;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Credential::platformCompare(const Credential&amp; a, const Credential&amp; b)
</del><ins>+#if USE(CFNETWORK)
+CFURLCredentialRef Credential::cfCredential() const
</ins><span class="cx"> {
</span><del>-    if (a.type() != CredentialTypeClientCertificate || b.type() != CredentialTypeClientCertificate)
-        return a.type() == b.type();
</del><ins>+    return [nsCredential() _CFURLCredential];
+}
+#endif
</ins><span class="cx"> 
</span><del>-    // FIXME: Is pointer comparison of the identity and certificates properties sufficient?
-    if (a.identity() != b.identity())
</del><ins>+NSURLCredential *Credential::nsCredential() const
+{
+    if (m_nsCredential)
+        return m_nsCredential.get();
+
+    if (CredentialBase::isEmpty())
+        return nil;
+
+    m_nsCredential = adoptNS([[NSURLCredential alloc] initWithUser:user() password:password() persistence:toNSURLCredentialPersistence(persistence())]);
+
+    return m_nsCredential.get();
+}
+
+bool Credential::isEmpty() const
+{
+    if (m_nsCredential)
</ins><span class="cx">         return false;
</span><del>-    if (a.certificates() != b.certificates())
-        return false;
</del><span class="cx"> 
</span><del>-    return true;
</del><ins>+    return CredentialBase::isEmpty();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool Credential::platformCompare(const Credential&amp; a, const Credential&amp; b)
+{
+    if (!a.m_nsCredential &amp;&amp; !b.m_nsCredential)
+        return true;
+
+    return [a.nsCredential() isEqual:b.nsCredential()];
+}
+
+bool Credential::encodingRequiresPlatformData(NSURLCredential *credential)
+{
+    return !credential.user;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacAuthenticationMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/AuthenticationMac.h (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/AuthenticationMac.h        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/mac/AuthenticationMac.h        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -28,18 +28,14 @@
</span><span class="cx"> #ifdef __OBJC__
</span><span class="cx"> 
</span><span class="cx"> @class NSURLAuthenticationChallenge;
</span><del>-@class NSURLCredential;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class AuthenticationChallenge;
</span><del>-class Credential;
</del><span class="cx"> 
</span><span class="cx"> NSURLAuthenticationChallenge *mac(const AuthenticationChallenge&amp;);
</span><del>-NSURLCredential *mac(const Credential&amp;);
</del><span class="cx"> 
</span><span class="cx"> AuthenticationChallenge core(NSURLAuthenticationChallenge *);
</span><del>-Credential core(NSURLCredential *);
</del><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> #endif // __OBJC__
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacAuthenticationMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #import &quot;AuthenticationClient.h&quot;
</span><span class="cx"> #import &quot;Credential.h&quot;
</span><span class="cx"> #import &lt;Foundation/NSURLAuthenticationChallenge.h&gt;
</span><del>-#import &lt;Foundation/NSURLCredential.h&gt;
</del><span class="cx"> #import &lt;Foundation/NSURLProtectionSpace.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if USE(CFNETWORK)
</span><span class="lines">@@ -43,11 +42,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@interface NSURLCredential (Details)
-- (id) _initWithCFURLCredential:(CFURLCredentialRef)credential;
-- (CFURLCredentialRef) _cfurlcredential;
-@end
-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -88,7 +82,7 @@
</span><span class="cx"> - (void)useCredential:(NSURLCredential *)credential forAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
</span><span class="cx"> {
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;receivedCredential(core(challenge), core(credential));
</del><ins>+        m_client-&gt;receivedCredential(core(challenge), Credential(credential));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)continueWithoutCredentialForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
</span><span class="lines">@@ -127,11 +121,6 @@
</span><span class="cx">     return AuthenticationChallenge([challengeSender cfChallenge], [challengeSender client]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Credential core(NSURLCredential *macCredential)
-{
-    return core([macCredential _cfurlcredential]);
-}
-
</del><span class="cx"> NSURLAuthenticationChallenge *mac(const AuthenticationChallenge&amp; coreChallenge)
</span><span class="cx"> {
</span><span class="cx">     AuthenticationClient* authClient = coreChallenge.authenticationClient();
</span><span class="lines">@@ -147,12 +136,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-NSURLCredential *mac(const Credential&amp; coreCredential)
-{
-    RetainPtr&lt;CFURLCredentialRef&gt; credential = adoptCF(createCF(coreCredential));
-    return [[[NSURLCredential alloc] _initWithCFURLCredential:credential.get()] autorelease];
-}
-
</del><span class="cx"> #else
</span><span class="cx"> 
</span><span class="cx"> AuthenticationChallenge::AuthenticationChallenge(const ProtectionSpace&amp; protectionSpace,
</span><span class="lines">@@ -170,7 +153,7 @@
</span><span class="cx"> 
</span><span class="cx"> AuthenticationChallenge::AuthenticationChallenge(NSURLAuthenticationChallenge *challenge)
</span><span class="cx">     : AuthenticationChallengeBase(ProtectionSpace([challenge protectionSpace]),
</span><del>-                                  core([challenge proposedCredential]),
</del><ins>+                                  Credential([challenge proposedCredential]),
</ins><span class="cx">                                   [challenge previousFailureCount],
</span><span class="cx">                                   [challenge failureResponse],
</span><span class="cx">                                   [challenge error])
</span><span class="lines">@@ -216,73 +199,18 @@
</span><span class="cx">         return coreChallenge.nsURLAuthenticationChallenge();
</span><span class="cx">         
</span><span class="cx">     return [[[NSURLAuthenticationChallenge alloc] initWithProtectionSpace:coreChallenge.protectionSpace().nsSpace()
</span><del>-                                                       proposedCredential:mac(coreChallenge.proposedCredential())
</del><ins>+                                                       proposedCredential:coreChallenge.proposedCredential().nsCredential()
</ins><span class="cx">                                                      previousFailureCount:coreChallenge.previousFailureCount()
</span><span class="cx">                                                           failureResponse:coreChallenge.failureResponse().nsURLResponse()
</span><span class="cx">                                                                     error:coreChallenge.error()
</span><span class="cx">                                                                    sender:coreChallenge.sender()] autorelease];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-NSURLCredential *mac(const Credential&amp; coreCredential)
-{
-    if (coreCredential.isEmpty())
-        return nil;
-
-    NSURLCredentialPersistence persistence = NSURLCredentialPersistenceNone;
-    switch (coreCredential.persistence()) {
-        case CredentialPersistenceNone:
-            break;
-        case CredentialPersistenceForSession:
-            persistence = NSURLCredentialPersistenceForSession;
-            break;
-        case CredentialPersistencePermanent:
-            persistence = NSURLCredentialPersistencePermanent;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-    }
-
-    if (coreCredential.type() == CredentialTypeClientCertificate) {
-        return [[[NSURLCredential alloc] initWithIdentity:coreCredential.identity()
-                                             certificates:(NSArray *)coreCredential.certificates()
-                                              persistence:persistence]
-                                              autorelease];
-    }
-
-    return [[[NSURLCredential alloc] initWithUser:coreCredential.user()
-                                        password:coreCredential.password()
-                                     persistence:persistence]
-                                     autorelease];
-}
-
</del><span class="cx"> AuthenticationChallenge core(NSURLAuthenticationChallenge *macChallenge)
</span><span class="cx"> {
</span><span class="cx">     return AuthenticationChallenge(macChallenge);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Credential core(NSURLCredential *macCredential)
-{
-    CredentialPersistence persistence = CredentialPersistenceNone;
-    switch ([macCredential persistence]) {
-        case NSURLCredentialPersistenceNone:
-            break;
-        case NSURLCredentialPersistenceForSession:
-            persistence = CredentialPersistenceForSession;
-            break;
-        case NSURLCredentialPersistencePermanent:
-            persistence = CredentialPersistencePermanent;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-    }
-
-    SecIdentityRef identity = [macCredential identity];
-    if (identity)
-        return Credential(identity, (CFArrayRef)[macCredential certificates], persistence);
-    
-    return Credential([macCredential user], [macCredential password], persistence);
-}
-
</del><span class="cx"> #endif // USE(CFNETWORK)
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacCredentialStorageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> Credential CredentialStorage::getFromPersistentStorage(const ProtectionSpace&amp; protectionSpace)
</span><span class="cx"> {
</span><span class="cx">     NSURLCredential *credential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace.nsSpace()];
</span><del>-    return credential ? core(credential) : Credential();
</del><ins>+    return credential ? Credential(credential) : Credential();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -549,7 +549,7 @@
</span><span class="cx">                                                                 persistence:NSURLCredentialPersistenceForSession];
</span><span class="cx">         d-&gt;m_currentMacChallenge = challenge.nsURLAuthenticationChallenge();
</span><span class="cx">         d-&gt;m_currentWebChallenge = challenge;
</span><del>-        receivedCredential(challenge, core(credential));
</del><ins>+        receivedCredential(challenge, Credential(credential));
</ins><span class="cx">         [credential release];
</span><span class="cx">         // FIXME: Per the specification, the user shouldn't be asked for credentials if there were incorrect ones provided explicitly.
</span><span class="cx">         d-&gt;m_user = String();
</span><span class="lines">@@ -574,7 +574,7 @@
</span><span class="cx">                     // Store the credential back, possibly adding it as a default for this directory.
</span><span class="cx">                     CredentialStorage::set(credential, challenge.protectionSpace(), challenge.failureResponse().url());
</span><span class="cx">                 }
</span><del>-                [challenge.sender() useCredential:mac(credential) forAuthenticationChallenge:mac(challenge)];
</del><ins>+                [challenge.sender() useCredential:credential.nsCredential() forAuthenticationChallenge:mac(challenge)];
</ins><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -658,9 +658,9 @@
</span><span class="cx">         if (challenge.failureResponse().httpStatusCode() == 401)
</span><span class="cx">             urlToStore = challenge.failureResponse().url();
</span><span class="cx">         CredentialStorage::set(webCredential, ProtectionSpace([d-&gt;m_currentMacChallenge protectionSpace]), urlToStore);
</span><del>-        [[d-&gt;m_currentMacChallenge sender] useCredential:mac(webCredential) forAuthenticationChallenge:d-&gt;m_currentMacChallenge];
</del><ins>+        [[d-&gt;m_currentMacChallenge sender] useCredential:webCredential.nsCredential() forAuthenticationChallenge:d-&gt;m_currentMacChallenge];
</ins><span class="cx">     } else
</span><del>-        [[d-&gt;m_currentMacChallenge sender] useCredential:mac(credential) forAuthenticationChallenge:d-&gt;m_currentMacChallenge];
</del><ins>+        [[d-&gt;m_currentMacChallenge sender] useCredential:credential.nsCredential() forAuthenticationChallenge:d-&gt;m_currentMacChallenge];
</ins><span class="cx"> 
</span><span class="cx">     clearAuthentication();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-07-30  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        Updated for changes to the WebCore::Credential API.
+        Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Misc/WebDownload.mm:
+        (-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]): Use new nsCredential
+        getter.
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (WebKit::getAuthenticationInfo): Ditto.
+
</ins><span class="cx"> 2014-07-27  Pratik Solanki  &lt;psolanki@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove unused preference keys
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebDownloadmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebDownload.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebDownload.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit/mac/Misc/WebDownload.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     // Try previously stored credential first.
</span><span class="cx">     if (![challenge previousFailureCount]) {
</span><del>-        NSURLCredential *credential = mac(CredentialStorage::get(ProtectionSpace([challenge protectionSpace])));
</del><ins>+        NSURLCredential *credential = CredentialStorage::get(ProtectionSpace([challenge protectionSpace])).nsCredential();
</ins><span class="cx">         if (credential) {
</span><span class="cx">             [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebKitmacPluginsWebBaseNetscapePluginViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -928,7 +928,7 @@
</span><span class="cx">     
</span><span class="cx">     RetainPtr&lt;NSURLProtectionSpace&gt; protectionSpace = adoptNS([[NSURLProtectionSpace alloc] initWithHost:host port:port protocol:protocol realm:realm authenticationMethod:authenticationMethod]);
</span><span class="cx">     
</span><del>-    NSURLCredential *credential = mac(CredentialStorage::get(ProtectionSpace(protectionSpace.get())));
</del><ins>+    NSURLCredential *credential = CredentialStorage::get(ProtectionSpace(protectionSpace.get())).nsCredential();
</ins><span class="cx">     if (!credential)
</span><span class="cx">         credential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:protectionSpace.get()];
</span><span class="cx">     if (!credential)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit2/ChangeLog        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2014-07-30  Dan Bernstein  &lt;mitz@apple.com&gt;
+
+        Updated for changes to the WebCore::Credential API.
+        Work towards fixing https://bugs.webkit.org/show_bug.cgi?id=135327
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Shared/Downloads/mac/DownloadMac.mm:
+        (WebKit::Download::receivedCredential):Use new Credential::nsCredential getter.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;Credential&gt;::encode):  If encoding the credential requires encoding the
+        platform data, do that.
+        (IPC::ArgumentCoder&lt;Credential&gt;::decode): If platform data was encoded, decode it.
+        * Shared/WebCoreArgumentCoders.h:
+
+        * Shared/mac/WebCoreArgumentCodersMac.mm:
+        (IPC::ArgumentCoder&lt;Credential&gt;::encodePlatformData): Archive the NSURLCredential.
+        (IPC::ArgumentCoder&lt;Credential&gt;::decodePlatformData): Unarchive it.
+
+        * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
+        (-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]): Use
+        Credential constructor that takes an NSURLCredential.
+
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): Ditto.
+
+
</ins><span class="cx"> 2014-07-30  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] REGRESSION(r171742): Test /webkit2/WebKitWebView/disallow-modal-dialogs fails
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedDownloadsmacDownloadMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Downloads/mac/DownloadMac.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Downloads/mac/DownloadMac.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit2/Shared/Downloads/mac/DownloadMac.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Download::receivedCredential(const AuthenticationChallenge&amp; authenticationChallenge, const Credential&amp; credential)
</span><span class="cx"> {
</span><del>-    [authenticationChallenge.sender() useCredential:mac(credential) forAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];
</del><ins>+    [authenticationChallenge.sender() useCredential:credential.nsCredential() forAuthenticationChallenge:authenticationChallenge.nsURLAuthenticationChallenge()];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Download::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&amp; authenticationChallenge)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -506,57 +506,26 @@
</span><span class="cx"> 
</span><span class="cx"> void ArgumentCoder&lt;Credential&gt;::encode(ArgumentEncoder&amp; encoder, const Credential&amp; credential)
</span><span class="cx"> {
</span><del>-#if CERTIFICATE_CREDENTIALS_SUPPORTED
-    encoder.encodeEnum(credential.type());
-
-    if (credential.type() == CredentialTypeClientCertificate) {
-        IPC::encode(encoder, credential.identity());
-
-        encoder &lt;&lt; !!credential.certificates();
-        if (credential.certificates())
-            IPC::encode(encoder, credential.certificates());
-
-        encoder.encodeEnum(credential.persistence());
</del><ins>+    if (credential.encodingRequiresPlatformData()) {
+        encoder &lt;&lt; true;
+        encodePlatformData(encoder, credential);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-#endif
-    encoder &lt;&lt; credential.user() &lt;&lt; credential.password();
</del><span class="cx"> 
</span><ins>+    encoder &lt;&lt; false;
+    encoder &lt;&lt; credential.user() &lt;&lt; credential.password();
</ins><span class="cx">     encoder.encodeEnum(credential.persistence());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ArgumentCoder&lt;Credential&gt;::decode(ArgumentDecoder&amp; decoder, Credential&amp; credential)
</span><span class="cx"> {
</span><del>-#if CERTIFICATE_CREDENTIALS_SUPPORTED
-    CredentialType type;
-
-    if (!decoder.decodeEnum(type))
</del><ins>+    bool hasPlatformData;
+    if (!decoder.decode(hasPlatformData))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (type == CredentialTypeClientCertificate) {
-        RetainPtr&lt;SecIdentityRef&gt; identity;
-        if (!IPC::decode(decoder, identity))
-            return false;
</del><ins>+    if (hasPlatformData)
+        return decodePlatformData(decoder, credential);
</ins><span class="cx"> 
</span><del>-        bool hasCertificates;
-        if (!decoder.decode(hasCertificates))
-            return false;
-
-        RetainPtr&lt;CFArrayRef&gt; certificates;
-        if (hasCertificates) {
-            if (!IPC::decode(decoder, certificates))
-                return false;
-        }
-
-        CredentialPersistence persistence;
-        if (!decoder.decodeEnum(persistence))
-            return false;
-
-        credential = Credential(identity.get(), certificates.get(), persistence);
-        return true;
-    }
-#endif
-
</del><span class="cx">     String user;
</span><span class="cx">     if (!decoder.decode(user))
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -235,6 +235,8 @@
</span><span class="cx"> template&lt;&gt; struct ArgumentCoder&lt;WebCore::Credential&gt; {
</span><span class="cx">     static void encode(ArgumentEncoder&amp;, const WebCore::Credential&amp;);
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::Credential&amp;);
</span><ins>+    static void encodePlatformData(ArgumentEncoder&amp;, const WebCore::Credential&amp;);
+    static bool decodePlatformData(ArgumentDecoder&amp;, WebCore::Credential&amp;);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt; struct ArgumentCoder&lt;WebCore::Cursor&gt; {
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacWebCoreArgumentCodersMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #import &quot;WebKitSystemInterface.h&quot;
</span><span class="cx"> #import &lt;WebCore/CertificateInfo.h&gt;
</span><span class="cx"> #import &lt;WebCore/ContentFilter.h&gt;
</span><ins>+#import &lt;WebCore/Credential.h&gt;
</ins><span class="cx"> #import &lt;WebCore/KeyboardEvent.h&gt;
</span><span class="cx"> #import &lt;WebCore/ProtectionSpace.h&gt;
</span><span class="cx"> #import &lt;WebCore/ResourceError.h&gt;
</span><span class="lines">@@ -315,6 +316,35 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;Credential&gt;::encodePlatformData(ArgumentEncoder&amp; encoder, const Credential&amp; credential)
+{
+    RetainPtr&lt;NSMutableData&gt; data = adoptNS([[NSMutableData alloc] init]);
+    RetainPtr&lt;NSKeyedArchiver&gt; archiver = adoptNS([[NSKeyedArchiver alloc] initForWritingWithMutableData:data.get()]);
+    [archiver setRequiresSecureCoding:YES];
+    [archiver encodeObject:credential.nsCredential() forKey:@&quot;credential&quot;];
+    [archiver finishEncoding];
+    IPC::encode(encoder, reinterpret_cast&lt;CFDataRef&gt;(data.get()));
+}
+
+bool ArgumentCoder&lt;Credential&gt;::decodePlatformData(ArgumentDecoder&amp; decoder, Credential&amp; credential)
+{
+    RetainPtr&lt;CFDataRef&gt; data;
+    if (!IPC::decode(decoder, data))
+        return false;
+
+    RetainPtr&lt;NSKeyedUnarchiver&gt; unarchiver = adoptNS([[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)data.get()]);
+    [unarchiver setRequiresSecureCoding:YES];
+    @try {
+        if (RetainPtr&lt;NSURLCredential&gt; nsCredential = [unarchiver decodeObjectOfClass:[NSURLCredential class] forKey:@&quot;credential&quot;])
+            credential = Credential(nsCredential.get());
+    } @catch (NSException *exception) {
+        LOG_ERROR(&quot;Failed to decode NSURLCredential: %@&quot;, exception);
+    }
+
+    [unarchiver finishDecoding];
+    return true;
+}
+
</ins><span class="cx"> void ArgumentCoder&lt;KeypressCommand&gt;::encode(ArgumentEncoder&amp; encoder, const KeypressCommand&amp; keypressCommand)
</span><span class="cx"> {
</span><span class="cx">     encoder &lt;&lt; keypressCommand.commandName &lt;&lt; keypressCommand.text;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedsoupWebCoreArgumentCodersSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -152,5 +152,16 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;Credential&gt;::encodePlatformData(ArgumentEncoder&amp;, const Credential&amp;)
+{
+    ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ArgumentCoder&lt;Credential&gt;::decodePlatformData(ArgumentDecoder&amp;, Credential&amp;)
+{
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+}
+
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKNSURLAuthenticationChallengemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> {
</span><span class="cx">     checkChallenge(challenge);
</span><span class="cx">     AuthenticationChallengeProxy&amp; webChallenge = ((WKNSURLAuthenticationChallenge *)challenge)._web_authenticationChallengeProxy;
</span><del>-    webChallenge.listener()-&gt;useCredential(WebCredential::create(core(credential)).get());
</del><ins>+    webChallenge.listener()-&gt;useCredential(WebCredential::create(Credential(credential)).get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)performDefaultHandlingForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (171800 => 171801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2014-07-30 16:49:33 UTC (rev 171800)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2014-07-30 18:56:13 UTC (rev 171801)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> #import &quot;WebProcessProxy.h&quot;
</span><span class="cx"> #import &quot;_WKErrorRecoveryAttempting.h&quot;
</span><span class="cx"> #import &quot;_WKFrameHandleInternal.h&quot;
</span><del>-#import &lt;WebCore/AuthenticationMac.h&gt;
</del><ins>+#import &lt;WebCore/Credential.h&gt;
</ins><span class="cx"> #import &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="lines">@@ -724,7 +724,7 @@
</span><span class="cx">                 case NSURLSessionAuthChallengeUseCredential: {
</span><span class="cx">                     RefPtr&lt;WebCredential&gt; webCredential;
</span><span class="cx">                     if (credential)
</span><del>-                        webCredential = WebCredential::create(WebCore::core(credential));
</del><ins>+                        webCredential = WebCredential::create(WebCore::Credential(credential));
</ins><span class="cx"> 
</span><span class="cx">                     challenge-&gt;listener()-&gt;useCredential(webCredential.get());
</span><span class="cx">                     break;
</span></span></pre>
</div>
</div>

</body>
</html>