[iOS] Support using Foundation networking code
https://bugs.webkit.org/show_bug.cgi?id=136467

Reviewed by Pratik Solanki.

Source/WebCore:

We should support building iOS WebKit with the Foundation networking code
(i.e. !USE(CFNETWORK)).

Additionally, disable USE(CFNETWORK) and use the Foundation networking code
by default when building iOS WebKit without the Apple Internal SDK.

* Configurations/WebCore.xcconfig: Remove file WebCoreURLResponse.mm from the list of excluded files
so that we compile an implementation for function WebCore::synthesizeRedirectResponseIfNecessary when
building without USE(CFNETWORK).
* WebCore.exp.in: Add symbols for WebCore::synthesizeRedirectResponseIfNecessary() and WebCore::ResourceHandleClient::willCacheResponseAsync().
* WebCore.xcodeproj/project.pbxproj: Add new files CFNetworkConnectionCacheSPI.h and CFURLRequestSPI.h.
Also move group platform/spi such that it appears in alphabetical order in the platform group.
* platform/cf/URLCF.cpp: Remove unnecessary header <CoreFoundation/CFPriv.h>.
* platform/network/ResourceHandle.h: Declare iOS-specific variant of ResourceHandle::createNSURLConnection().
* platform/network/ResourceHandleClient.h: Always include header <wtf/RetainPtr.h> when building for iOS.
(WebCore::ResourceHandleClient::connectionProperties): Add PLATFORM(IOS)-guard around declaration.
* platform/network/cf/ResourceRequestCFNet.cpp: Substitute header CFNetworkConnectionCacheSPI.h for
<CFNetwork/CFNetworkConnectionCachePriv.h>.
* platform/network/mac/CredentialStorageMac.mm:
(WebCore::CredentialStorage::saveToPersistentStorage): Use Credential::nsCredential() and ProtectionSpace::nsSpace()
instead of WebCore::mac(const {Credential, ProtectionSpace}&) as the latter were removed in <http://trac.webkit.org/changeset/171801>
and <http://trac.webkit.org/changeset/171540>, respectively.
* platform/network/mac/ResourceErrorMac.mm: Add USE(CFNETWORK)-guard around <CFNetwork/CFSocketStreamPriv.h>.
* platform/network/mac/ResourceHandleMac.mm: Substitute header CFURLRequestSPI.h for <CFNetwork/CFURLRequest.h>.
(WebCore::ResourceHandle::start): Modified to use ResourceHandle::makeDelegate() instead of d->m_proxy, which
was removed in <http://trac.webkit.org/changeset/147476>.
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary): Add !USE(CFNETWORK)- and PLATFORM(IOS)- guards.
* platform/spi/cf/CFNetworkConnectionCacheSPI.h: Added.
* platform/spi/cf/CFURLRequestSPI.h: Added.

Source/WTF:

Disable USE(CFNETWORK) and use the Foundation networking code by default when building
iOS WebKit without the Apple Internal SDK.

* wtf/Platform.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Updated German translation
https://bugs.webkit.org/show_bug.cgi?id=135956

Patch by Christian Stadelmann <gnome-de@genodeftest.de> on 2014-09-02
Reviewed by Gustavo Noronha.

* de.po: updated.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Attempt to fix the Windows build after <http://trac.webkit.org/changeset/173192>
(https://bugs.webkit.org/show_bug.cgi?id=136467)

Declare ResourceHandleClient::connectionProperties() when building for iOS or when USE(CFNETWORK).

* platform/network/ResourceHandleClient.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EME][Mac] Refactor CDMPrivateMediaSourceAVFObjC to allow sessions to be created without being attached to an AVStreamDataParser.
https://bugs.webkit.org/show_bug.cgi?id=136016

Reviewed by Eric Carlson.

The CDMPrivateMediaPlayer class will delegate creation of CDMSession instances to the current MediaPlayer. This
of course requires the MediaKeys object owning the CDM to be attached to a HTMLMediaElement, and specifically to
one with a valid src attribute or source node which has sucessfully begun loading. For certain CDM operations,
it would be better if a given MediaKeys could create a session without actually being connected to a
HTMLMediaElement (yet).

To facilitate this for CDMSessionPrivateMediaSourceAVFObjC, add a new class, CDMPrivateMediaSourceAVFObjC, which
is the primary factory for CDMSessionPrivateMediaSOurceAVFObjC. Disclaim responsibility for creating these sessions
in MediaPlayerPrivateMediaSourceAVFObjC by not passing the "supportsKeySystem" method when registering itself.

Add methods to CDMSessionPrivateMediaSourceAVFObjC to allow SourceBuffers to be added and removed from the session,
to support adding the session to the HTMLMediaElement after the session has been created.

Since MediaPlayerPrivate instance and  CDMSession instances must be able to communicate with one another, add a type()
enum and virtual method to allow CDMSession instnaces to be distinguisted from (and casted to) one another.

* Modules/encryptedmedia/CDM.cpp:
(WebCore::installedCDMFactories): Register CDMPrivateMediaSourceAVFObjC.
(WebCore::CDM::createSession): Notify the MediaPlayer of the new CDMSession.
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::setMediaElement): Notify the HTMLMediaElement of any existing sessions.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/CDMSession.h:
(WebCore::CDMSession::type): Added.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setCDMSession): Pass through to the MediaPlayerPrivate.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setCDMSession): Added. Default no-op.
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h: Added.
(WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC): Simple constructor.
(WebCore::CDMPrivateMediaSourceAVFObjC::~CDMPrivateMediaSourceAVFObjC): Simple destructor.
(WebCore::CDMPrivateMediaSourceAVFObjC::create): Simple factory.
(WebCore::CDMPrivateMediaSourceAVFObjC::cdm): Simple accessor.
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem): Moved from MediaPlayerPrivateMediaSourceAVFObjC.
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType): Ditto.
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): Ditto.
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Returns new CDMSessionMediaSourceAVFObjC.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
(WebCore::CDMSessionAVFoundationObjC::type): Added.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
(WebCore::CDMSessionMediaSourceAVFObjC::type): Added.
(WebCore::toCDMSessionMediaSourceAVFObjC): Throw assertion if type() is not correct.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC): Removed m_parent ivar.
(WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): Ditto.
(WebCore::CDMSessionMediaSourceAVFObjC::update): Determing which SourceBuffer is protected.
(WebCore::CDMSessionMediaSourceAVFObjC::addSourceBuffer): Added.
(WebCore::CDMSessionMediaSourceAVFObjC::removeSourceBuffer): Added.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): Remove supportsKeyType parameter.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Remove keyType check.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): Tell the CDMSession about outstanding SourceBuffers.
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:


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