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<Credential>::encode):  If encoding the credential requires encoding the
platform data, do that.
(IPC::ArgumentCoder<Credential>::decode): If platform data was encoded, decode it.
* Shared/WebCoreArgumentCoders.h:

* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<Credential>::encodePlatformData): Archive the NSURLCredential.
(IPC::ArgumentCoder<Credential>::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.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/17199364> [Mac] Popup button arrows appear on the left, underlapping text, when the UI layout direction is right-to-left
https://bugs.webkit.org/show_bug.cgi?id=135426

Reviewed by Dean Jackson.

No test, because the UI layout direction in the test harness is always left-to-right.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::popupButton): Forced the user interface layout direction of the
NSPopUpButtonCell to left-to-right. Added a FIXME about how we could make this vary based on
the direction of the <select>, though that would require additional changes elsewhere.



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