Title: [222946] trunk
Revision
222946
Author
jer.no...@apple.com
Date
2017-10-05 17:13:23 -0700 (Thu, 05 Oct 2017)

Log Message

[Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
https://bugs.webkit.org/show_bug.cgi?id=177261

Reviewed by Eric Carlson.

Source/_javascript_Core:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Enable ENCRYPTED_MEDIA, and make the changes required for ENABLED_MEDIA and LEGACY_ENABLED_MEDIA
to co-exist while both enabled simultaneously.

* Configurations/FeatureDefines.xcconfig:
* Modules/encryptedmedia/legacy/LegacyCDM.cpp:
(WebCore::LegacyCDM::registerCDMFactory):
(WebCore::LegacyCDM::supportsKeySystem):
(WebCore::LegacyCDM::keySystemSupportsMimeType):
(WebCore::LegacyCDM::create):
(WebCore::LegacyCDM::LegacyCDM):
(WebCore::LegacyCDM::~LegacyCDM):
(WebCore::LegacyCDM::supportsMIMEType const):
(WebCore::LegacyCDM::createSession):
(WebCore::LegacyCDM::mediaPlayer const):
(WebCore::CDM::registerCDMFactory): Deleted.
(WebCore::CDM::supportsKeySystem): Deleted.
(WebCore::CDM::keySystemSupportsMimeType): Deleted.
(WebCore::CDM::create): Deleted.
(WebCore::CDM::CDM): Deleted.
(WebCore::CDM::~CDM): Deleted.
(WebCore::CDM::supportsMIMEType const): Deleted.
(WebCore::CDM::createSession): Deleted.
(WebCore::CDM::mediaPlayer const): Deleted.
* Modules/encryptedmedia/legacy/LegacyCDM.h:
(WebCore::LegacyCDMClient::~LegacyCDMClient):
(WebCore::LegacyCDM::client const):
(WebCore::LegacyCDM::setClient):
(WebCore::CDMClient::~CDMClient): Deleted.
(WebCore::CDM::keySystem const): Deleted.
(WebCore::CDM::client const): Deleted.
(WebCore::CDM::setClient): Deleted.
* Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
(WebCore::LegacyCDMPrivateClearKey::supportsKeySystem):
(WebCore::LegacyCDMPrivateClearKey::supportsKeySystemAndMimeType):
(WebCore::LegacyCDMPrivateClearKey::supportsMIMEType):
(WebCore::LegacyCDMPrivateClearKey::createSession):
(WebCore::CDMPrivateClearKey::supportsKeySystem): Deleted.
(WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Deleted.
(WebCore::CDMPrivateClearKey::supportsMIMEType): Deleted.
(WebCore::CDMPrivateClearKey::createSession): Deleted.
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
(WebCore::LegacyCDMPrivateClearKey::LegacyCDMPrivateClearKey):
(WebCore::LegacyCDMPrivateClearKey::~LegacyCDMPrivateClearKey):
(WebCore::CDMPrivateClearKey::CDMPrivateClearKey): Deleted.
(WebCore::CDMPrivateClearKey::~CDMPrivateClearKey): Deleted.
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
(WebCore::CDMPrivateMediaPlayer::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
(WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::cdm const):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::CDMSessionClearKey):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::create):
(WebCore::WebKitMediaKeys::WebKitMediaKeys):
(WebCore::WebKitMediaKeys::isTypeSupported):
(WebCore::WebKitMediaKeys::cdmMediaPlayer const):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/encryptedmedia/CDMFactory.cpp:
(WebCore::CDMFactory::platformRegisterFactories):
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::ClearKeyState::singleton):
(WebCore::parseJSONObject):
(WebCore::parseLicenseFormat):
(WebCore::parseLicenseReleaseAcknowledgementFormat):
(WebCore::CDMFactoryClearKey::singleton):
(WebCore::containsPersistentLicenseType):
(WebCore::CDMInstanceClearKey::keySystem const):
* platform/encryptedmedia/clearkey/CDMClearKey.h:
* platform/graphics/LegacyCDMSession.h:
(WebCore::LegacyCDMSessionClient::~LegacyCDMSessionClient):
(WebCore::CDMSession::type):
(WebCore::CDMSessionClient::~CDMSessionClient): Deleted.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::createSession):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::createSession):
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
(WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC):
(WebCore::CDMPrivateMediaSourceAVFObjC::cdm const):
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
(WebCore::CDMSessionAVContentKeySession::update):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
(WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
(WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
(WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
* testing/Internals.cpp:
(WebCore::Internals::initializeMockCDM):
* testing/LegacyMockCDM.cpp:
(WebCore::LegacyMockCDM::supportsKeySystem):
(WebCore::LegacyMockCDM::supportsKeySystemAndMimeType):
(WebCore::LegacyMockCDM::supportsMIMEType):
(WebCore::LegacyMockCDM::createSession):
(WebCore::MockCDMSession::MockCDMSession):
(WebCore::MockCDM::supportsKeySystem): Deleted.
(WebCore::MockCDM::supportsKeySystemAndMimeType): Deleted.
(WebCore::MockCDM::supportsMIMEType): Deleted.
(WebCore::MockCDM::createSession): Deleted.
* testing/LegacyMockCDM.h:
(WebCore::LegacyMockCDM::LegacyMockCDM):
(WebCore::LegacyMockCDM::~LegacyMockCDM):
(WebCore::MockCDM::MockCDM): Deleted.
(WebCore::MockCDM::~MockCDM): Deleted.
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::keySystem const):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (222945 => 222946)


--- trunk/Source/_javascript_Core/ChangeLog	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-10-06 00:13:23 UTC (rev 222946)
@@ -1,3 +1,12 @@
+2017-10-05  Jer Noble  <jer.no...@apple.com>
+
+        [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
+        https://bugs.webkit.org/show_bug.cgi?id=177261
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2017-10-05  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r222929.

Modified: trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig (222945 => 222946)


--- trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2017-10-06 00:13:23 UTC (rev 222946)
@@ -68,7 +68,7 @@
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
-ENABLE_ENCRYPTED_MEDIA = ;
+ENABLE_ENCRYPTED_MEDIA = ENABLE_ENCRYPTED_MEDIA;
 ENABLE_CONTENT_FILTERING[sdk=appletv*] = ;
 ENABLE_CONTENT_FILTERING[sdk=iphone*] = ENABLE_CONTENT_FILTERING;
 ENABLE_CONTENT_FILTERING[sdk=macosx*] = ENABLE_CONTENT_FILTERING;

Modified: trunk/Source/WebCore/ChangeLog (222945 => 222946)


--- trunk/Source/WebCore/ChangeLog	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/ChangeLog	2017-10-06 00:13:23 UTC (rev 222946)
@@ -1,3 +1,141 @@
+2017-10-05  Jer Noble  <jer.no...@apple.com>
+
+        [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
+        https://bugs.webkit.org/show_bug.cgi?id=177261
+
+        Reviewed by Eric Carlson.
+
+        Enable ENCRYPTED_MEDIA, and make the changes required for ENABLED_MEDIA and LEGACY_ENABLED_MEDIA
+        to co-exist while both enabled simultaneously.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
+        (WebCore::LegacyCDM::registerCDMFactory):
+        (WebCore::LegacyCDM::supportsKeySystem):
+        (WebCore::LegacyCDM::keySystemSupportsMimeType):
+        (WebCore::LegacyCDM::create):
+        (WebCore::LegacyCDM::LegacyCDM):
+        (WebCore::LegacyCDM::~LegacyCDM):
+        (WebCore::LegacyCDM::supportsMIMEType const):
+        (WebCore::LegacyCDM::createSession):
+        (WebCore::LegacyCDM::mediaPlayer const):
+        (WebCore::CDM::registerCDMFactory): Deleted.
+        (WebCore::CDM::supportsKeySystem): Deleted.
+        (WebCore::CDM::keySystemSupportsMimeType): Deleted.
+        (WebCore::CDM::create): Deleted.
+        (WebCore::CDM::CDM): Deleted.
+        (WebCore::CDM::~CDM): Deleted.
+        (WebCore::CDM::supportsMIMEType const): Deleted.
+        (WebCore::CDM::createSession): Deleted.
+        (WebCore::CDM::mediaPlayer const): Deleted.
+        * Modules/encryptedmedia/legacy/LegacyCDM.h:
+        (WebCore::LegacyCDMClient::~LegacyCDMClient):
+        (WebCore::LegacyCDM::client const):
+        (WebCore::LegacyCDM::setClient):
+        (WebCore::CDMClient::~CDMClient): Deleted.
+        (WebCore::CDM::keySystem const): Deleted.
+        (WebCore::CDM::client const): Deleted.
+        (WebCore::CDM::setClient): Deleted.
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
+        (WebCore::LegacyCDMPrivateClearKey::supportsKeySystem):
+        (WebCore::LegacyCDMPrivateClearKey::supportsKeySystemAndMimeType):
+        (WebCore::LegacyCDMPrivateClearKey::supportsMIMEType):
+        (WebCore::LegacyCDMPrivateClearKey::createSession):
+        (WebCore::CDMPrivateClearKey::supportsKeySystem): Deleted.
+        (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Deleted.
+        (WebCore::CDMPrivateClearKey::supportsMIMEType): Deleted.
+        (WebCore::CDMPrivateClearKey::createSession): Deleted.
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
+        (WebCore::LegacyCDMPrivateClearKey::LegacyCDMPrivateClearKey):
+        (WebCore::LegacyCDMPrivateClearKey::~LegacyCDMPrivateClearKey):
+        (WebCore::CDMPrivateClearKey::CDMPrivateClearKey): Deleted.
+        (WebCore::CDMPrivateClearKey::~CDMPrivateClearKey): Deleted.
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
+        (WebCore::CDMPrivateMediaPlayer::createSession):
+        * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
+        (WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
+        (WebCore::CDMPrivateMediaPlayer::cdm const):
+        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
+        (WebCore::CDMSessionClearKey::CDMSessionClearKey):
+        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
+        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
+        * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
+        (WebCore::WebKitMediaKeys::create):
+        (WebCore::WebKitMediaKeys::WebKitMediaKeys):
+        (WebCore::WebKitMediaKeys::isTypeSupported):
+        (WebCore::WebKitMediaKeys::cdmMediaPlayer const):
+        * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/encryptedmedia/CDMFactory.cpp:
+        (WebCore::CDMFactory::platformRegisterFactories):
+        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
+        (WebCore::ClearKeyState::singleton):
+        (WebCore::parseJSONObject):
+        (WebCore::parseLicenseFormat):
+        (WebCore::parseLicenseReleaseAcknowledgementFormat):
+        (WebCore::CDMFactoryClearKey::singleton):
+        (WebCore::containsPersistentLicenseType):
+        (WebCore::CDMInstanceClearKey::keySystem const):
+        * platform/encryptedmedia/clearkey/CDMClearKey.h:
+        * platform/graphics/LegacyCDMSession.h:
+        (WebCore::LegacyCDMSessionClient::~LegacyCDMSessionClient):
+        (WebCore::CDMSession::type):
+        (WebCore::CDMSessionClient::~CDMSessionClient): Deleted.
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::createSession):
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::createSession):
+        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
+        (WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC):
+        (WebCore::CDMPrivateMediaSourceAVFObjC::cdm const):
+        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
+        (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
+        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
+        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
+        (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
+        (WebCore::CDMSessionAVContentKeySession::update):
+        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
+        (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
+        (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
+        (WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
+        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
+        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
+        (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
+        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
+        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
+        (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
+        (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
+        (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
+        * testing/Internals.cpp:
+        (WebCore::Internals::initializeMockCDM):
+        * testing/LegacyMockCDM.cpp:
+        (WebCore::LegacyMockCDM::supportsKeySystem):
+        (WebCore::LegacyMockCDM::supportsKeySystemAndMimeType):
+        (WebCore::LegacyMockCDM::supportsMIMEType):
+        (WebCore::LegacyMockCDM::createSession):
+        (WebCore::MockCDMSession::MockCDMSession):
+        (WebCore::MockCDM::supportsKeySystem): Deleted.
+        (WebCore::MockCDM::supportsKeySystemAndMimeType): Deleted.
+        (WebCore::MockCDM::supportsMIMEType): Deleted.
+        (WebCore::MockCDM::createSession): Deleted.
+        * testing/LegacyMockCDM.h:
+        (WebCore::LegacyMockCDM::LegacyMockCDM):
+        (WebCore::LegacyMockCDM::~LegacyMockCDM):
+        (WebCore::MockCDM::MockCDM): Deleted.
+        (WebCore::MockCDM::~MockCDM): Deleted.
+        * testing/MockCDMFactory.cpp:
+        (WebCore::MockCDMInstance::keySystem const):
+
 2017-10-05  John Wilander  <wilan...@apple.com>
 
         Storage Access API: Web process should ask UI process for grant/deny

Modified: trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig (222945 => 222946)


--- trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig	2017-10-06 00:13:23 UTC (rev 222946)
@@ -68,7 +68,7 @@
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
-ENABLE_ENCRYPTED_MEDIA = ;
+ENABLE_ENCRYPTED_MEDIA = ENABLE_ENCRYPTED_MEDIA;
 ENABLE_CONTENT_FILTERING[sdk=appletv*] = ;
 ENABLE_CONTENT_FILTERING[sdk=iphone*] = ENABLE_CONTENT_FILTERING;
 ENABLE_CONTENT_FILTERING[sdk=macosx*] = ENABLE_CONTENT_FILTERING;

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.cpp (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -61,15 +61,15 @@
 static Vector<CDMFactory*>& installedCDMFactories()
 {
     static auto cdms = makeNeverDestroyed(Vector<CDMFactory*> {
-        new CDMFactory([](CDM* cdm) { return std::make_unique<CDMPrivateClearKey>(cdm); },
-            CDMPrivateClearKey::supportsKeySystem, CDMPrivateClearKey::supportsKeySystemAndMimeType),
+        new CDMFactory([](LegacyCDM* cdm) { return std::make_unique<LegacyCDMPrivateClearKey>(cdm); },
+            LegacyCDMPrivateClearKey::supportsKeySystem, LegacyCDMPrivateClearKey::supportsKeySystemAndMimeType),
 
         // FIXME: initialize specific UA CDMs. http://webkit.org/b/109318, http://webkit.org/b/109320
-        new CDMFactory([](CDM* cdm) { return std::make_unique<CDMPrivateMediaPlayer>(cdm); },
+        new CDMFactory([](LegacyCDM* cdm) { return std::make_unique<CDMPrivateMediaPlayer>(cdm); },
             CDMPrivateMediaPlayer::supportsKeySystem, CDMPrivateMediaPlayer::supportsKeySystemAndMimeType),
 
 #if PLATFORM(MAC) && ENABLE(MEDIA_SOURCE)
-        new CDMFactory([](CDM* cdm) { return std::make_unique<CDMPrivateMediaSourceAVFObjC>(cdm); },
+        new CDMFactory([](LegacyCDM* cdm) { return std::make_unique<CDMPrivateMediaSourceAVFObjC>(cdm); },
             CDMPrivateMediaSourceAVFObjC::supportsKeySystem, CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType),
 #endif
     });
@@ -76,7 +76,7 @@
     return cdms;
 }
 
-void CDM::registerCDMFactory(CreateCDM&& constructor, CDMSupportsKeySystem supportsKeySystem, CDMSupportsKeySystemAndMimeType supportsKeySystemAndMimeType)
+void LegacyCDM::registerCDMFactory(CreateCDM&& constructor, CDMSupportsKeySystem supportsKeySystem, CDMSupportsKeySystemAndMimeType supportsKeySystemAndMimeType)
 {
     installedCDMFactories().append(new CDMFactory(WTFMove(constructor), supportsKeySystem, supportsKeySystemAndMimeType));
 }
@@ -90,12 +90,12 @@
     return nullptr;
 }
 
-bool CDM::supportsKeySystem(const String& keySystem)
+bool LegacyCDM::supportsKeySystem(const String& keySystem)
 {
     return CDMFactoryForKeySystem(keySystem);
 }
 
-bool CDM::keySystemSupportsMimeType(const String& keySystem, const String& mimeType)
+bool LegacyCDM::keySystemSupportsMimeType(const String& keySystem, const String& mimeType)
 {
     if (CDMFactory* factory = CDMFactoryForKeySystem(keySystem))
         return factory->supportsKeySystemAndMimeType(keySystem, mimeType);
@@ -102,15 +102,15 @@
     return false;
 }
 
-std::unique_ptr<CDM> CDM::create(const String& keySystem)
+std::unique_ptr<LegacyCDM> LegacyCDM::create(const String& keySystem)
 {
     if (!supportsKeySystem(keySystem))
         return nullptr;
 
-    return std::make_unique<CDM>(keySystem);
+    return std::make_unique<LegacyCDM>(keySystem);
 }
 
-CDM::CDM(const String& keySystem)
+LegacyCDM::LegacyCDM(const String& keySystem)
     : m_keySystem(keySystem)
     , m_client(nullptr)
 {
@@ -117,16 +117,16 @@
     m_private = CDMFactoryForKeySystem(keySystem)->constructor(this);
 }
 
-CDM::~CDM()
+LegacyCDM::~LegacyCDM()
 {
 }
 
-bool CDM::supportsMIMEType(const String& mimeType) const
+bool LegacyCDM::supportsMIMEType(const String& mimeType) const
 {
     return m_private->supportsMIMEType(mimeType);
 }
 
-std::unique_ptr<CDMSession> CDM::createSession(CDMSessionClient& client)
+std::unique_ptr<LegacyCDMSession> LegacyCDM::createSession(LegacyCDMSessionClient& client)
 {
     auto session = m_private->createSession(&client);
     if (mediaPlayer())
@@ -134,7 +134,7 @@
     return session;
 }
 
-MediaPlayer* CDM::mediaPlayer() const
+MediaPlayer* LegacyCDM::mediaPlayer() const
 {
     if (!m_client)
         return 0;

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.h (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDM.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -35,39 +35,39 @@
 
 namespace WebCore {
 
-class CDM;
+class LegacyCDM;
 class CDMPrivateInterface;
 class MediaPlayer;
 
-using CreateCDM = WTF::Function<std::unique_ptr<CDMPrivateInterface> (CDM*)>;
+using CreateCDM = WTF::Function<std::unique_ptr<CDMPrivateInterface> (LegacyCDM*)>;
 typedef bool (*CDMSupportsKeySystem)(const String&);
 typedef bool (*CDMSupportsKeySystemAndMimeType)(const String&, const String&);
 
-class CDMClient {
+class LegacyCDMClient {
 public:
-    virtual ~CDMClient() { }
+    virtual ~LegacyCDMClient() { }
 
-    virtual MediaPlayer* cdmMediaPlayer(const CDM*) const = 0;
+    virtual MediaPlayer* cdmMediaPlayer(const LegacyCDM*) const = 0;
 };
 
-class CDM {
+class LegacyCDM {
 public:
-    explicit CDM(const String& keySystem);
+    explicit LegacyCDM(const String& keySystem);
 
     enum CDMErrorCode { NoError, UnknownError, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
     static bool supportsKeySystem(const String&);
     static bool keySystemSupportsMimeType(const String& keySystem, const String& mimeType);
-    static std::unique_ptr<CDM> create(const String& keySystem);
+    static std::unique_ptr<LegacyCDM> create(const String& keySystem);
     WEBCORE_EXPORT static void registerCDMFactory(CreateCDM&&, CDMSupportsKeySystem, CDMSupportsKeySystemAndMimeType);
-    ~CDM();
+    ~LegacyCDM();
 
     bool supportsMIMEType(const String&) const;
-    std::unique_ptr<CDMSession> createSession(CDMSessionClient&);
+    std::unique_ptr<LegacyCDMSession> createSession(LegacyCDMSessionClient&);
 
     const String& keySystem() const { return m_keySystem; }
 
-    CDMClient* client() const { return m_client; }
-    void setClient(CDMClient* client) { m_client = client; }
+    LegacyCDMClient* client() const { return m_client; }
+    void setClient(LegacyCDMClient* client) { m_client = client; }
 
     MediaPlayer* mediaPlayer() const;
 
@@ -74,7 +74,7 @@
 private:
     String m_keySystem;
     std::unique_ptr<CDMPrivateInterface> m_private;
-    CDMClient* m_client;
+    LegacyCDMClient* m_client;
 };
 
 }

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivate.h (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivate.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivate.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -31,8 +31,8 @@
 
 namespace WebCore {
 
-class CDMSession;
-class CDMSessionClient;
+class LegacyCDMSession;
+class LegacyCDMSessionClient;
 
 class CDMPrivateInterface {
 public:
@@ -41,7 +41,7 @@
 
     virtual bool supportsMIMEType(const String&) = 0;
 
-    virtual std::unique_ptr<CDMSession> createSession(CDMSessionClient*) = 0;
+    virtual std::unique_ptr<LegacyCDMSession> createSession(LegacyCDMSessionClient*) = 0;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -35,7 +35,7 @@
 
 namespace WebCore {
 
-bool CDMPrivateClearKey::supportsKeySystem(const String& keySystem)
+bool LegacyCDMPrivateClearKey::supportsKeySystem(const String& keySystem)
 {
     if (!equalLettersIgnoringASCIICase(keySystem, "org.w3c.clearkey"))
         return false;
@@ -44,7 +44,7 @@
     return MediaPlayer::supportsKeySystem(keySystem, emptyString());
 }
 
-bool CDMPrivateClearKey::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
+bool LegacyCDMPrivateClearKey::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
 {
     if (!equalLettersIgnoringASCIICase(keySystem, "org.w3c.clearkey"))
         return false;
@@ -53,12 +53,12 @@
     return MediaPlayer::supportsKeySystem(keySystem, mimeType);
 }
 
-bool CDMPrivateClearKey::supportsMIMEType(const String& mimeType)
+bool LegacyCDMPrivateClearKey::supportsMIMEType(const String& mimeType)
 {
     return MediaPlayer::supportsKeySystem(m_cdm->keySystem(), mimeType);
 }
 
-std::unique_ptr<CDMSession> CDMPrivateClearKey::createSession(CDMSessionClient* client)
+std::unique_ptr<LegacyCDMSession> LegacyCDMPrivateClearKey::createSession(LegacyCDMSessionClient* client)
 {
     return std::make_unique<CDMSessionClearKey>(client);
 }

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -31,25 +31,25 @@
 
 namespace WebCore {
 
-class CDM;
+class LegacyCDM;
 
-class CDMPrivateClearKey : public CDMPrivateInterface {
+class LegacyCDMPrivateClearKey : public CDMPrivateInterface {
 public:
-    explicit CDMPrivateClearKey(CDM* cdm)
+    explicit LegacyCDMPrivateClearKey(LegacyCDM* cdm)
         : m_cdm(cdm)
     {
     }
 
-    virtual ~CDMPrivateClearKey() { }
+    virtual ~LegacyCDMPrivateClearKey() { }
 
     static bool supportsKeySystem(const String&);
     static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
 
     bool supportsMIMEType(const String& mimeType) override;
-    std::unique_ptr<CDMSession> createSession(CDMSessionClient*) override;
+    std::unique_ptr<LegacyCDMSession> createSession(LegacyCDMSessionClient*) override;
 
 protected:
-    CDM* m_cdm;
+    LegacyCDM* m_cdm;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -54,7 +54,7 @@
     return MediaPlayer::supportsKeySystem(m_cdm->keySystem(), mimeType);
 }
 
-std::unique_ptr<CDMSession> CDMPrivateMediaPlayer::createSession(CDMSessionClient* client)
+std::unique_ptr<LegacyCDMSession> CDMPrivateMediaPlayer::createSession(LegacyCDMSessionClient* client)
 {
     MediaPlayer* mediaPlayer = m_cdm->mediaPlayer();
     if (!mediaPlayer)

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -31,11 +31,11 @@
 
 namespace WebCore {
 
-class CDM;
+class LegacyCDM;
 
 class CDMPrivateMediaPlayer : public CDMPrivateInterface {
 public:
-    explicit CDMPrivateMediaPlayer(CDM* cdm)
+    explicit CDMPrivateMediaPlayer(LegacyCDM* cdm)
         : m_cdm(cdm)
     { }
 
@@ -45,12 +45,12 @@
     virtual ~CDMPrivateMediaPlayer() { }
 
     bool supportsMIMEType(const String& mimeType) override;
-    std::unique_ptr<CDMSession> createSession(CDMSessionClient*) override;
+    std::unique_ptr<LegacyCDMSession> createSession(LegacyCDMSessionClient*) override;
 
-    CDM* cdm() const { return m_cdm; }
+    LegacyCDM* cdm() const { return m_cdm; }
 
 protected:
-    CDM* m_cdm;
+    LegacyCDM* m_cdm;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -49,7 +49,7 @@
     return vm;
 }
 
-CDMSessionClearKey::CDMSessionClearKey(CDMSessionClient* client)
+CDMSessionClearKey::CDMSessionClearKey(LegacyCDMSessionClient* client)
     : m_client(client)
     , m_sessionId(createCanonicalUUIDString())
 {

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -33,14 +33,14 @@
 
 namespace WebCore {
 
-class CDMSessionClearKey : public CDMSession {
+class CDMSessionClearKey : public LegacyCDMSession {
 public:
-    CDMSessionClearKey(CDMSessionClient*);
+    CDMSessionClearKey(LegacyCDMSessionClient*);
     virtual ~CDMSessionClearKey();
 
     // CDMSessionPrivate
-    CDMSessionType type() override { return CDMSessionTypeClearKey; }
-    void setClient(CDMSessionClient* client) override { m_client = client; }
+    LegacyCDMSessionType type() override { return CDMSessionTypeClearKey; }
+    void setClient(LegacyCDMSessionClient* client) override { m_client = client; }
     const String& sessionId() const override { return m_sessionId; }
     RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array*, String&, unsigned short&, uint32_t&) override;
     void releaseKeys() override;
@@ -48,7 +48,7 @@
     RefPtr<ArrayBuffer> cachedKeyForKeyID(const String&) const override;
 
 protected:
-    CDMSessionClient* m_client;
+    LegacyCDMSessionClient* m_client;
     RefPtr<Uint8Array> m_initData;
     HashMap<String, Vector<uint8_t>> m_cachedKeys;
     String m_sessionId;

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -41,7 +41,7 @@
 class WebKitMediaKeyError;
 class WebKitMediaKeys;
 
-class WebKitMediaKeySession final : public RefCounted<WebKitMediaKeySession>, public EventTargetWithInlineData, private ActiveDOMObject, private CDMSessionClient {
+class WebKitMediaKeySession final : public RefCounted<WebKitMediaKeySession>, public EventTargetWithInlineData, private ActiveDOMObject, private LegacyCDMSessionClient {
 public:
     static Ref<WebKitMediaKeySession> create(ScriptExecutionContext&, WebKitMediaKeys&, const String& keySystem);
     ~WebKitMediaKeySession();
@@ -52,7 +52,7 @@
     ExceptionOr<void> update(Ref<Uint8Array>&& key);
     void close();
 
-    CDMSession* session() { return m_session.get(); }
+    LegacyCDMSession* session() { return m_session.get(); }
 
     void detachKeys() { m_keys = nullptr; }
 
@@ -88,7 +88,7 @@
     String m_sessionId;
     RefPtr<WebKitMediaKeyError> m_error;
     GenericEventQueue m_asyncEventQueue;
-    std::unique_ptr<CDMSession> m_session;
+    std::unique_ptr<LegacyCDMSession> m_session;
 
     struct PendingKeyRequest {
         String mimeType;

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -43,12 +43,12 @@
         return Exception { InvalidAccessError };
 
     // 2. If keySystem is not one of the user agent's supported Key Systems, throw a NotSupportedError and abort these steps.
-    if (!CDM::supportsKeySystem(keySystem))
+    if (!LegacyCDM::supportsKeySystem(keySystem))
         return Exception { NotSupportedError };
 
     // 3. Let cdm be the content decryption module corresponding to keySystem.
     // 4. Load cdm if necessary.
-    auto cdm = CDM::create(keySystem);
+    auto cdm = LegacyCDM::create(keySystem);
 
     // 5. Create a new MediaKeys object.
     // 5.1 Let the keySystem attribute be keySystem.
@@ -56,7 +56,7 @@
     return adoptRef(*new WebKitMediaKeys(keySystem, WTFMove(cdm)));
 }
 
-WebKitMediaKeys::WebKitMediaKeys(const String& keySystem, std::unique_ptr<CDM>&& cdm)
+WebKitMediaKeys::WebKitMediaKeys(const String& keySystem, std::unique_ptr<LegacyCDM>&& cdm)
     : m_keySystem(keySystem)
     , m_cdm(WTFMove(cdm))
 {
@@ -110,7 +110,7 @@
 {
     // 1. If keySystem contains an unrecognized or unsupported Key System, return false and abort these steps.
     // Key system string comparison is case-sensitive.
-    if (keySystem.isEmpty() || !CDM::supportsKeySystem(keySystem))
+    if (keySystem.isEmpty() || !LegacyCDM::supportsKeySystem(keySystem))
         return false;
 
     // 2. If type is null or an empty string, return true and abort these steps.
@@ -119,7 +119,7 @@
 
     // 3. If the Key System specified by keySystem does not support decrypting the container and/or codec
     // specified by type, return false and abort these steps.
-    if (!CDM::keySystemSupportsMimeType(keySystem, mimeType))
+    if (!LegacyCDM::keySystemSupportsMimeType(keySystem, mimeType))
         return false;
 
     // 4. Return true;
@@ -137,7 +137,7 @@
         m_mediaElement->player()->setCDMSession(m_sessions.last()->session());
 }
 
-MediaPlayer* WebKitMediaKeys::cdmMediaPlayer(const CDM*) const
+MediaPlayer* WebKitMediaKeys::cdmMediaPlayer(const LegacyCDM*) const
 {
     if (!m_mediaElement)
         return nullptr;

Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h (222945 => 222946)


--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -38,7 +38,7 @@
 class ScriptExecutionContext;
 class WebKitMediaKeySession;
 
-class WebKitMediaKeys final : public RefCounted<WebKitMediaKeys>, private CDMClient {
+class WebKitMediaKeys final : public RefCounted<WebKitMediaKeys>, private LegacyCDMClient {
 public:
     static ExceptionOr<Ref<WebKitMediaKeys>> create(const String& keySystem);
     virtual ~WebKitMediaKeys();
@@ -47,7 +47,7 @@
     static bool isTypeSupported(const String& keySystem, const String& mimeType);
     const String& keySystem() const { return m_keySystem; }
 
-    CDM& cdm() { ASSERT(m_cdm); return *m_cdm; }
+    LegacyCDM& cdm() { ASSERT(m_cdm); return *m_cdm; }
 
     void setMediaElement(HTMLMediaElement*);
 
@@ -55,14 +55,14 @@
     RefPtr<ArrayBuffer> cachedKeyForKeyId(const String& keyId) const;
 
 private:
-    MediaPlayer* cdmMediaPlayer(const CDM*) const final;
+    MediaPlayer* cdmMediaPlayer(const LegacyCDM*) const final;
 
-    WebKitMediaKeys(const String& keySystem, std::unique_ptr<CDM>&&);
+    WebKitMediaKeys(const String& keySystem, std::unique_ptr<LegacyCDM>&&);
 
     Vector<Ref<WebKitMediaKeySession>> m_sessions;
     HTMLMediaElement* m_mediaElement { nullptr };
     String m_keySystem;
-    std::unique_ptr<CDM> m_cdm;
+    std::unique_ptr<LegacyCDM> m_cdm;
 };
 
 }

Modified: trunk/Source/WebCore/PAL/ChangeLog (222945 => 222946)


--- trunk/Source/WebCore/PAL/ChangeLog	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/PAL/ChangeLog	2017-10-06 00:13:23 UTC (rev 222946)
@@ -1,3 +1,12 @@
+2017-10-05  Jer Noble  <jer.no...@apple.com>
+
+        [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
+        https://bugs.webkit.org/show_bug.cgi?id=177261
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2017-09-28  Ross Kirsling  <ross.kirsl...@sony.com>
 
         [PAL] Move HysteresisActivity into PAL

Modified: trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig (222945 => 222946)


--- trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig	2017-10-06 00:13:23 UTC (rev 222946)
@@ -68,7 +68,7 @@
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
-ENABLE_ENCRYPTED_MEDIA = ;
+ENABLE_ENCRYPTED_MEDIA = ENABLE_ENCRYPTED_MEDIA;
 ENABLE_CONTENT_FILTERING[sdk=appletv*] = ;
 ENABLE_CONTENT_FILTERING[sdk=iphone*] = ENABLE_CONTENT_FILTERING;
 ENABLE_CONTENT_FILTERING[sdk=macosx*] = ENABLE_CONTENT_FILTERING;

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (222945 => 222946)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-10-06 00:13:23 UTC (rev 222946)
@@ -6360,6 +6360,9 @@
 		CD8B5A46180DFF4E008B8E65 /* VideoTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A45180DFF4E008B8E65 /* VideoTrackMediaSource.h */; };
 		CD8B5A49180E138B008B8E65 /* TextTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A48180E138B008B8E65 /* TextTrackMediaSource.h */; };
 		CD8B5A4C180E17C0008B8E65 /* AudioTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A4B180E17C0008B8E65 /* AudioTrackMediaSource.h */; };
+		CD94A5DC1F71D5D300F525C5 /* CDMFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD94A5D11F71CB6B00F525C5 /* CDMFactory.cpp */; };
+		CD94A5DD1F71D5D800F525C5 /* CDMClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD94A5DB1F71CBB000F525C5 /* CDMClearKey.cpp */; };
+		CD94A5DE1F72F57B00F525C5 /* CDMClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD94A5C91F71CA9D00F525C5 /* CDMClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CD9D82751C7AE535006FF066 /* TextureCacheCV.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD9D82731C7AE535006FF066 /* TextureCacheCV.mm */; };
 		CD9D82761C7AE535006FF066 /* TextureCacheCV.h in Headers */ = {isa = PBXBuildFile; fileRef = CD9D82741C7AE535006FF066 /* TextureCacheCV.h */; };
 		CD9D82791C7B8EE1006FF066 /* VideoTextureCopierCV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD9D82771C7B8EE1006FF066 /* VideoTextureCopierCV.cpp */; };
@@ -6475,7 +6478,6 @@
 		CDF4B71E1E01E11A00E235A2 /* JSMediaKeySessionType.h in Headers */ = {isa = PBXBuildFile; fileRef = CDF4B71C1E01E11A00E235A2 /* JSMediaKeySessionType.h */; };
 		CDF4B7201E03BF6F00E235A2 /* MockCDMFactory.idl in Headers */ = {isa = PBXBuildFile; fileRef = CDF4B71F1E03BF6F00E235A2 /* MockCDMFactory.idl */; };
 		CDF4B7241E03BF8100E235A2 /* MockCDMFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = CDF4B7221E03BF8100E235A2 /* MockCDMFactory.h */; };
-		CDF4B7261E03C15B00E235A2 /* CDMPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CDF4B7251E03C15B00E235A2 /* CDMPrivate.h */; };
 		CDF4B7281E03C57300E235A2 /* MediaKeysRequirement.idl in Headers */ = {isa = PBXBuildFile; fileRef = CDF4B7271E03C57300E235A2 /* MediaKeysRequirement.idl */; };
 		CDF4B72B1E03C63E00E235A2 /* JSMediaKeysRequirement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDF4B7291E03C63E00E235A2 /* JSMediaKeysRequirement.cpp */; };
 		CDF4B72C1E03C63E00E235A2 /* JSMediaKeysRequirement.h in Headers */ = {isa = PBXBuildFile; fileRef = CDF4B72A1E03C63E00E235A2 /* JSMediaKeysRequirement.h */; };
@@ -15123,7 +15125,20 @@
 		CD8B5A48180E138B008B8E65 /* TextTrackMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackMediaSource.h; sourceTree = "<group>"; };
 		CD8B5A4A180E17A3008B8E65 /* AudioTrackMediaSource.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AudioTrackMediaSource.idl; sourceTree = "<group>"; };
 		CD8B5A4B180E17C0008B8E65 /* AudioTrackMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioTrackMediaSource.h; sourceTree = "<group>"; };
-		CD9D05421E1EFA12003B4C4F /* CDMInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMInstance.h; sourceTree = "<group>"; };
+		CD94A5C91F71CA9D00F525C5 /* CDMClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMClient.h; sourceTree = "<group>"; };
+		CD94A5CC1F71CB6900F525C5 /* CDMRequirement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMRequirement.h; sourceTree = "<group>"; };
+		CD94A5CD1F71CB6900F525C5 /* CDMKeySystemConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMKeySystemConfiguration.h; sourceTree = "<group>"; };
+		CD94A5CE1F71CB6A00F525C5 /* CDMInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMInstance.h; sourceTree = "<group>"; };
+		CD94A5CF1F71CB6A00F525C5 /* CDMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivate.h; sourceTree = "<group>"; };
+		CD94A5D01F71CB6B00F525C5 /* CDMRestrictions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMRestrictions.h; sourceTree = "<group>"; };
+		CD94A5D11F71CB6B00F525C5 /* CDMFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMFactory.cpp; sourceTree = "<group>"; };
+		CD94A5D21F71CB6B00F525C5 /* CDMFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMFactory.h; sourceTree = "<group>"; };
+		CD94A5D31F71CB6C00F525C5 /* CDMMediaCapability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMMediaCapability.h; sourceTree = "<group>"; };
+		CD94A5D41F71CB6C00F525C5 /* CDMKeyStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMKeyStatus.h; sourceTree = "<group>"; };
+		CD94A5D51F71CB6D00F525C5 /* CDMSessionType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMSessionType.h; sourceTree = "<group>"; };
+		CD94A5D61F71CB6D00F525C5 /* CDMMessageType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMMessageType.h; sourceTree = "<group>"; };
+		CD94A5DA1F71CBB000F525C5 /* CDMClearKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMClearKey.h; sourceTree = "<group>"; };
+		CD94A5DB1F71CBB000F525C5 /* CDMClearKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CDMClearKey.cpp; sourceTree = "<group>"; };
 		CD9D82731C7AE535006FF066 /* TextureCacheCV.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TextureCacheCV.mm; path = ../cv/TextureCacheCV.mm; sourceTree = "<group>"; };
 		CD9D82741C7AE535006FF066 /* TextureCacheCV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextureCacheCV.h; path = ../cv/TextureCacheCV.h; sourceTree = "<group>"; };
 		CD9D82771C7B8EE1006FF066 /* VideoTextureCopierCV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VideoTextureCopierCV.cpp; path = ../cv/VideoTextureCopierCV.cpp; sourceTree = "<group>"; };
@@ -15264,7 +15279,6 @@
 		CDF4B71F1E03BF6F00E235A2 /* MockCDMFactory.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MockCDMFactory.idl; sourceTree = "<group>"; };
 		CDF4B7211E03BF8100E235A2 /* MockCDMFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockCDMFactory.cpp; sourceTree = "<group>"; };
 		CDF4B7221E03BF8100E235A2 /* MockCDMFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockCDMFactory.h; sourceTree = "<group>"; };
-		CDF4B7251E03C15B00E235A2 /* CDMPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDMPrivate.h; sourceTree = "<group>"; };
 		CDF4B7271E03C57300E235A2 /* MediaKeysRequirement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaKeysRequirement.idl; sourceTree = "<group>"; };
 		CDF4B7291E03C63E00E235A2 /* JSMediaKeysRequirement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaKeysRequirement.cpp; sourceTree = "<group>"; };
 		CDF4B72A1E03C63E00E235A2 /* JSMediaKeysRequirement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaKeysRequirement.h; sourceTree = "<group>"; };
@@ -24604,6 +24618,7 @@
 				FD31604012B026A300C1A359 /* audio */,
 				1AE42F670AA4B8CB00C8612D /* cf */,
 				A5C974CE11485FDA0066F2AB /* cocoa */,
+				CD94A5CB1F71CB4600F525C5 /* encryptedmedia */,
 				515BE1871D54F5DB00DD7C68 /* gamepad */,
 				B2A015910AF6CD53006BCE0E /* graphics */,
 				A59E3C1B11580F340072928E /* ios */,
@@ -24857,6 +24872,34 @@
 			name = cocoa;
 			sourceTree = "<group>";
 		};
+		CD94A5CB1F71CB4600F525C5 /* encryptedmedia */ = {
+			isa = PBXGroup;
+			children = (
+				CD94A5D91F71CB9F00F525C5 /* clearkey */,
+				CD94A5D11F71CB6B00F525C5 /* CDMFactory.cpp */,
+				CD94A5D21F71CB6B00F525C5 /* CDMFactory.h */,
+				CD94A5CE1F71CB6A00F525C5 /* CDMInstance.h */,
+				CD94A5D41F71CB6C00F525C5 /* CDMKeyStatus.h */,
+				CD94A5CD1F71CB6900F525C5 /* CDMKeySystemConfiguration.h */,
+				CD94A5D31F71CB6C00F525C5 /* CDMMediaCapability.h */,
+				CD94A5D61F71CB6D00F525C5 /* CDMMessageType.h */,
+				CD94A5CF1F71CB6A00F525C5 /* CDMPrivate.h */,
+				CD94A5CC1F71CB6900F525C5 /* CDMRequirement.h */,
+				CD94A5D01F71CB6B00F525C5 /* CDMRestrictions.h */,
+				CD94A5D51F71CB6D00F525C5 /* CDMSessionType.h */,
+			);
+			path = encryptedmedia;
+			sourceTree = "<group>";
+		};
+		CD94A5D91F71CB9F00F525C5 /* clearkey */ = {
+			isa = PBXGroup;
+			children = (
+				CD94A5DB1F71CBB000F525C5 /* CDMClearKey.cpp */,
+				CD94A5DA1F71CBB000F525C5 /* CDMClearKey.h */,
+			);
+			path = clearkey;
+			sourceTree = "<group>";
+		};
 		CD9A37F517C7D93600C5FA7A /* mediacontrols */ = {
 			isa = PBXGroup;
 			children = (
@@ -24891,8 +24934,7 @@
 				2D0621461DA639EC00A7FB26 /* legacy */,
 				CDF4B7131E00B7E500E235A2 /* CDM.cpp */,
 				CDF4B7141E00B7E500E235A2 /* CDM.h */,
-				CD9D05421E1EFA12003B4C4F /* CDMInstance.h */,
-				CDF4B7251E03C15B00E235A2 /* CDMPrivate.h */,
+				CD94A5C91F71CA9D00F525C5 /* CDMClient.h */,
 				CD063F801E23FA8900812BE3 /* InitDataRegistry.cpp */,
 				CD063F811E23FA8900812BE3 /* InitDataRegistry.h */,
 				2D9BF72F1DBFDC0F007A7D99 /* MediaKeyMessageEvent.cpp */,
@@ -27343,7 +27385,7 @@
 				CDC734151977896D0046BFC5 /* CARingBuffer.h in Headers */,
 				6550B69E099DF0270090D781 /* CDATASection.h in Headers */,
 				CDF4B7161E00B7E500E235A2 /* CDM.h in Headers */,
-				CDF4B7261E03C15B00E235A2 /* CDMPrivate.h in Headers */,
+				CD94A5DE1F72F57B00F525C5 /* CDMClient.h in Headers */,
 				CD318623199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h in Headers */,
 				CDE595971BF26E2100A1CBE8 /* CDMSessionMediaSourceAVFObjC.h in Headers */,
 				5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */,
@@ -31481,6 +31523,8 @@
 				CDC734141977896C0046BFC5 /* CARingBuffer.cpp in Sources */,
 				6550B69D099DF0270090D781 /* CDATASection.cpp in Sources */,
 				CDF4B7151E00B7E500E235A2 /* CDM.cpp in Sources */,
+				CD94A5DD1F71D5D800F525C5 /* CDMClearKey.cpp in Sources */,
+				CD94A5DC1F71D5D300F525C5 /* CDMFactory.cpp in Sources */,
 				CD318622199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.mm in Sources */,
 				CDE595951BF16DF300A1CBE8 /* CDMSessionAVContentKeySession.mm in Sources */,
 				CDDE02ED18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm in Sources */,

Modified: trunk/Source/WebCore/platform/encryptedmedia/CDMFactory.cpp (222945 => 222946)


--- trunk/Source/WebCore/platform/encryptedmedia/CDMFactory.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/encryptedmedia/CDMFactory.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -58,7 +58,7 @@
 }
 
 #if !USE(GSTREAMER)
-void CDMFactory::platformRegisterFactories()
+void CDMFactory::platformRegisterFactories(Vector<CDMFactory*>&)
 {
 }
 #endif

Modified: trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp (222945 => 222946)


--- trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -37,6 +37,7 @@
 #include "SharedBuffer.h"
 #include <inspector/InspectorValues.h>
 #include <wtf/MainThread.h>
+#include <wtf/NeverDestroyed.h>
 #include <wtf/text/Base64.h>
 
 using namespace Inspector;
@@ -52,6 +53,7 @@
     KeyStore& keys() { return m_keys; }
 
 private:
+    friend class NeverDestroyed<ClearKeyState>;
     ClearKeyState();
     KeyStore m_keys;
 };
@@ -58,13 +60,13 @@
 
 ClearKeyState& ClearKeyState::singleton()
 {
-    static ClearKeyState s_state;
+    static NeverDestroyed<ClearKeyState> s_state;
     return s_state;
 }
 
 ClearKeyState::ClearKeyState() = default;
 
-RefPtr<InspectorObject> parseJSONObject(const SharedBuffer& buffer)
+static RefPtr<InspectorObject> parseJSONObject(const SharedBuffer& buffer)
 {
     // Fail on large buffers whose size doesn't fit into a 32-bit unsigned integer.
     size_t size = buffer.size();
@@ -81,7 +83,7 @@
     return object;
 }
 
-std::optional<Vector<CDMInstanceClearKey::Key>> parseLicenseFormat(const InspectorObject& root)
+static std::optional<Vector<CDMInstanceClearKey::Key>> parseLicenseFormat(const InspectorObject& root)
 {
     // If the 'keys' key is present in the root object, parse the JSON further
     // according to the specified 'license' format.
@@ -122,7 +124,7 @@
     return decodedKeys;
 }
 
-bool parseLicenseReleaseAcknowledgementFormat(const InspectorObject& root)
+static bool parseLicenseReleaseAcknowledgementFormat(const InspectorObject& root)
 {
     // If the 'kids' key is present in the root object, parse the JSON further
     // according to the specified 'license release acknowledgement' format.
@@ -141,7 +143,7 @@
 
 CDMFactoryClearKey& CDMFactoryClearKey::singleton()
 {
-    static CDMFactoryClearKey s_factory;
+    static NeverDestroyed<CDMFactoryClearKey> s_factory;
     return s_factory;
 }
 
@@ -173,7 +175,7 @@
     return equalLettersIgnoringASCIICase(initDataType, "keyids");
 }
 
-bool containsPersistentLicenseType(const Vector<CDMSessionType>& types)
+static bool containsPersistentLicenseType(const Vector<CDMSessionType>& types)
 {
     return std::any_of(types.begin(), types.end(),
         [] (auto& sessionType) { return sessionType == CDMSessionType::PersistentLicense; });
@@ -560,7 +562,7 @@
 
 const String& CDMInstanceClearKey::keySystem() const
 {
-    static const String s_keySystem("org.w3.clearkey");
+    static const NeverDestroyed<String> s_keySystem = MAKE_STATIC_STRING_IMPL("org.w3.clearkey");
 
     return s_keySystem;
 }

Modified: trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h (222945 => 222946)


--- trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -48,6 +48,7 @@
     bool supportsKeySystem(const String&) override;
 
 private:
+    friend class NeverDestroyed<CDMFactoryClearKey>;
     CDMFactoryClearKey();
 };
 

Modified: trunk/Source/WebCore/platform/graphics/LegacyCDMSession.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/LegacyCDMSession.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/LegacyCDMSession.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -32,9 +32,9 @@
 
 namespace WebCore {
 
-class CDMSessionClient {
+class LegacyCDMSessionClient {
 public:
-    virtual ~CDMSessionClient() { }
+    virtual ~LegacyCDMSessionClient() { }
     virtual void sendMessage(Uint8Array*, String destinationURL) = 0;
 
     enum {
@@ -51,7 +51,7 @@
     virtual String mediaKeysStorageDirectory() const = 0;
 };
 
-enum CDMSessionType {
+enum LegacyCDMSessionType {
     CDMSessionTypeUnknown,
     CDMSessionTypeClearKey,
     CDMSessionTypeAVFoundationObjC,
@@ -59,12 +59,12 @@
     CDMSessionTypeAVContentKeySession,
 };
 
-class CDMSession {
+class LegacyCDMSession {
 public:
-    virtual ~CDMSession() { }
+    virtual ~LegacyCDMSession() { }
 
-    virtual CDMSessionType type() { return CDMSessionTypeUnknown; }
-    virtual void setClient(CDMSessionClient*) = 0;
+    virtual LegacyCDMSessionType type() { return CDMSessionTypeUnknown; }
+    virtual void setClient(LegacyCDMSessionClient*) = 0;
     virtual const String& sessionId() const = 0;
     virtual RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) = 0;
     virtual void releaseKeys() = 0;

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -583,12 +583,12 @@
 }
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-std::unique_ptr<CDMSession> MediaPlayer::createSession(const String& keySystem, CDMSessionClient* client)
+std::unique_ptr<LegacyCDMSession> MediaPlayer::createSession(const String& keySystem, LegacyCDMSessionClient* client)
 {
     return m_private->createSession(keySystem, client);
 }
 
-void MediaPlayer::setCDMSession(CDMSession* session)
+void MediaPlayer::setCDMSession(LegacyCDMSession* session)
 {
     m_private->setCDMSession(session);
 }

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -139,7 +139,7 @@
 
 extern const PlatformMedia NoPlatformMedia;
 
-class CDMSessionClient;
+class LegacyCDMSessionClient;
 class CachedResourceLoader;
 class ContentType;
 class GraphicsContext;
@@ -388,8 +388,8 @@
     // This is different from the asynchronous MediaKeyError.
     enum MediaKeyException { NoError, InvalidPlayerState, KeySystemNotSupported };
 
-    std::unique_ptr<CDMSession> createSession(const String& keySystem, CDMSessionClient*);
-    void setCDMSession(CDMSession*);
+    std::unique_ptr<LegacyCDMSession> createSession(const String& keySystem, LegacyCDMSessionClient*);
+    void setCDMSession(LegacyCDMSession*);
     void keyAdded();
 #endif
 

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -231,8 +231,8 @@
 #endif
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-    virtual std::unique_ptr<CDMSession> createSession(const String&, CDMSessionClient*) { return nullptr; }
-    virtual void setCDMSession(CDMSession*) { }
+    virtual std::unique_ptr<LegacyCDMSession> createSession(const String&, LegacyCDMSessionClient*) { return nullptr; }
+    virtual void setCDMSession(LegacyCDMSession*) { }
     virtual void keyAdded() { }
 #endif
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -33,12 +33,12 @@
 
 namespace WebCore {
 
-class CDM;
+class LegacyCDM;
 class CDMSessionMediaSourceAVFObjC;
 
 class CDMPrivateMediaSourceAVFObjC : public CDMPrivateInterface {
 public:
-    explicit CDMPrivateMediaSourceAVFObjC(CDM* cdm)
+    explicit CDMPrivateMediaSourceAVFObjC(LegacyCDM* cdm)
         : m_cdm(cdm)
     { }
     virtual ~CDMPrivateMediaSourceAVFObjC();
@@ -47,14 +47,14 @@
     static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
 
     bool supportsMIMEType(const String& mimeType) override;
-    std::unique_ptr<CDMSession> createSession(CDMSessionClient*) override;
+    std::unique_ptr<LegacyCDMSession> createSession(LegacyCDMSessionClient*) override;
 
-    CDM* cdm() const { return m_cdm; }
+    LegacyCDM* cdm() const { return m_cdm; }
 
     void invalidateSession(CDMSessionMediaSourceAVFObjC*);
 
 protected:
-    CDM* m_cdm;
+    LegacyCDM* m_cdm;
     Vector<CDMSessionMediaSourceAVFObjC*> m_sessions;
 };
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm	2017-10-06 00:13:23 UTC (rev 222946)
@@ -109,7 +109,7 @@
     return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::IsNotSupported;
 }
 
-std::unique_ptr<CDMSession> CDMPrivateMediaSourceAVFObjC::createSession(CDMSessionClient* client)
+std::unique_ptr<LegacyCDMSession> CDMPrivateMediaSourceAVFObjC::createSession(LegacyCDMSessionClient* client)
 {
     String keySystem = m_cdm->keySystem(); // Local copy for StringView usage
     StringView keySystemStringView { keySystem };

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -43,7 +43,7 @@
 
 namespace WebCore {
 
-CDMSessionAVFoundationCF::CDMSessionAVFoundationCF(MediaPlayerPrivateAVFoundationCF& parent, CDMSessionClient*)
+CDMSessionAVFoundationCF::CDMSessionAVFoundationCF(MediaPlayerPrivateAVFoundationCF& parent, LegacyCDMSessionClient*)
     : m_parent(parent)
     , m_sessionId(createCanonicalUUIDString())
 {

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -37,12 +37,12 @@
 
 class MediaPlayerPrivateAVFoundationCF;
 
-class CDMSessionAVFoundationCF final : public CDMSession {
+class CDMSessionAVFoundationCF final : public LegacyCDMSession {
 public:
-    CDMSessionAVFoundationCF(MediaPlayerPrivateAVFoundationCF& parent, CDMSessionClient*);
+    CDMSessionAVFoundationCF(MediaPlayerPrivateAVFoundationCF& parent, LegacyCDMSessionClient*);
 
 private:
-    void setClient(CDMSessionClient* client) final { }
+    void setClient(LegacyCDMSessionClient* client) final { }
     const String& sessionId() const final { return m_sessionId; }
     RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) final;
     void releaseKeys() final;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -1130,7 +1130,7 @@
     return m_avfWrapper->takeRequestForKeyURI(keyURI);
 }
 
-std::unique_ptr<CDMSession> MediaPlayerPrivateAVFoundationCF::createSession(const String& keySystem, CDMSessionClient* client)
+std::unique_ptr<LegacyCDMSession> MediaPlayerPrivateAVFoundationCF::createSession(const String& keySystem, LegacyCDMSessionClient* client)
 {
     if (!keySystemIsSupported(keySystem))
         return nullptr;
@@ -1140,7 +1140,7 @@
 
 #elif ENABLE(LEGACY_ENCRYPTED_MEDIA)
 
-std::unique_ptr<CDMSession> MediaPlayerPrivateAVFoundationCF::createSession(const String& keySystem, CDMSessionClient*)
+std::unique_ptr<LegacyCDMSession> MediaPlayerPrivateAVFoundationCF::createSession(const String& keySystem, LegacyCDMSessionClient*)
 {
     return nullptr;
 }

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -121,7 +121,7 @@
     bool hasSingleSecurityOrigin() const override;
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-    std::unique_ptr<CDMSession> createSession(const String&, CDMSessionClient*) override;
+    std::unique_ptr<LegacyCDMSession> createSession(const String&, LegacyCDMSessionClient*) override;
 #endif
 
     String languageOfPrimaryAudioTrack() const override;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -42,13 +42,13 @@
 
 class CDMSessionAVContentKeySession : public CDMSessionMediaSourceAVFObjC {
 public:
-    CDMSessionAVContentKeySession(const Vector<int>& protocolVersions, CDMPrivateMediaSourceAVFObjC&, CDMSessionClient*);
+    CDMSessionAVContentKeySession(const Vector<int>& protocolVersions, CDMPrivateMediaSourceAVFObjC&, LegacyCDMSessionClient*);
     virtual ~CDMSessionAVContentKeySession();
 
     static bool isAvailable();
 
-    // CDMSession
-    CDMSessionType type() override { return CDMSessionTypeAVContentKeySession; }
+    // LegacyCDMSession
+    LegacyCDMSessionType type() override { return CDMSessionTypeAVContentKeySession; }
     RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
     void releaseKeys() override;
     bool update(Uint8Array* key, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
@@ -75,7 +75,7 @@
     enum { Normal, KeyRelease } m_mode;
 };
 
-inline CDMSessionAVContentKeySession* toCDMSessionAVContentKeySession(CDMSession* session)
+inline CDMSessionAVContentKeySession* toCDMSessionAVContentKeySession(LegacyCDMSession* session)
 {
     if (!session || session->type() != CDMSessionTypeAVContentKeySession)
         return nullptr;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm	2017-10-06 00:13:23 UTC (rev 222946)
@@ -124,7 +124,7 @@
 
 namespace WebCore {
 
-CDMSessionAVContentKeySession::CDMSessionAVContentKeySession(const Vector<int>& protocolVersions, CDMPrivateMediaSourceAVFObjC& cdm, CDMSessionClient* client)
+CDMSessionAVContentKeySession::CDMSessionAVContentKeySession(const Vector<int>& protocolVersions, CDMPrivateMediaSourceAVFObjC& cdm, LegacyCDMSessionClient* client)
     : CDMSessionMediaSourceAVFObjC(cdm, client)
     , m_contentKeySessionDelegate(adoptNS([[WebCDMSessionAVContentKeySessionDelegate alloc] initWithParent:this]))
     , m_protocolVersions(protocolVersions)
@@ -290,7 +290,7 @@
         NSError* error = nil;
         NSData* requestData = [m_keyRequest contentKeyRequestDataForApp:certificateData.get() contentIdentifier:nil options:options.get() error:&error];
         if (error) {
-            errorCode = CDM::DomainError;
+            errorCode = LegacyCDM::DomainError;
             systemCode = mediaKeyErrorSystemCode(error);
             return false;
         }

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -39,13 +39,13 @@
 
 class MediaPlayerPrivateAVFoundationObjC;
 
-class CDMSessionAVFoundationObjC : public CDMSession {
+class CDMSessionAVFoundationObjC : public LegacyCDMSession {
 public:
-    CDMSessionAVFoundationObjC(MediaPlayerPrivateAVFoundationObjC* parent, CDMSessionClient*);
+    CDMSessionAVFoundationObjC(MediaPlayerPrivateAVFoundationObjC* parent, LegacyCDMSessionClient*);
     virtual ~CDMSessionAVFoundationObjC();
 
-    CDMSessionType type() override { return CDMSessionTypeAVFoundationObjC; }
-    void setClient(CDMSessionClient* client) override { m_client = client; }
+    LegacyCDMSessionType type() override { return CDMSessionTypeAVFoundationObjC; }
+    void setClient(LegacyCDMSessionClient* client) override { m_client = client; }
     const String& sessionId() const override { return m_sessionId; }
     RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
     void releaseKeys() override;
@@ -57,7 +57,7 @@
 
 protected:
     WeakPtr<MediaPlayerPrivateAVFoundationObjC> m_parent;
-    CDMSessionClient* m_client;
+    LegacyCDMSessionClient* m_client;
     String m_sessionId;
     RetainPtr<AVAssetResourceLoadingRequest> m_request;
     WeakPtrFactory<CDMSessionAVFoundationObjC> m_weakPtrFactory;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm	2017-10-06 00:13:23 UTC (rev 222946)
@@ -49,7 +49,7 @@
 
 namespace WebCore {
 
-CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC(MediaPlayerPrivateAVFoundationObjC* parent, CDMSessionClient* client)
+CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC(MediaPlayerPrivateAVFoundationObjC* parent, LegacyCDMSessionClient* client)
     : m_parent(parent->createWeakPtr())
     , m_client(client)
     , m_sessionId(createCanonicalUUIDString())
@@ -65,7 +65,7 @@
     UNUSED_PARAM(mimeType);
 
     if (!m_parent) {
-        errorCode = CDM::UnknownError;
+        errorCode = LegacyCDM::UnknownError;
         return nullptr;
     }
 
@@ -73,13 +73,13 @@
     String keyID;
     RefPtr<Uint8Array> certificate;
     if (!MediaPlayerPrivateAVFoundationObjC::extractKeyURIKeyIDAndCertificateFromInitData(initData, keyURI, keyID, certificate)) {
-        errorCode = CDM::UnknownError;
+        errorCode = LegacyCDM::UnknownError;
         return nullptr;
     }
 
     m_request = m_parent->takeRequestForKeyURI(keyURI);
     if (!m_request) {
-        errorCode = CDM::UnknownError;
+        errorCode = LegacyCDM::UnknownError;
         return nullptr;
     }
 
@@ -90,7 +90,7 @@
     RetainPtr<NSData> keyRequest = [m_request streamingContentKeyRequestDataForApp:certificateData.get() contentIdentifier:assetID.get() options:nil error:&nsError];
 
     if (!keyRequest) {
-        errorCode = CDM::DomainError;
+        errorCode = LegacyCDM::DomainError;
         systemCode = mediaKeyErrorSystemCode(nsError);
         return nullptr;
     }
@@ -126,7 +126,7 @@
         return;
 
     unsigned long code = mediaKeyErrorSystemCode(error);
-    m_client->sendError(CDMSessionClient::MediaKeyErrorDomain, code);
+    m_client->sendError(LegacyCDMSessionClient::MediaKeyErrorDomain, code);
 }
 
 }

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -42,11 +42,11 @@
 
 class CDMSessionAVStreamSession : public CDMSessionMediaSourceAVFObjC {
 public:
-    CDMSessionAVStreamSession(const Vector<int>& protocolVersions, CDMPrivateMediaSourceAVFObjC&, CDMSessionClient*);
+    CDMSessionAVStreamSession(const Vector<int>& protocolVersions, CDMPrivateMediaSourceAVFObjC&, LegacyCDMSessionClient*);
     virtual ~CDMSessionAVStreamSession();
 
-    // CDMSession
-    CDMSessionType type() override { return CDMSessionTypeAVStreamSession; }
+    // LegacyCDMSession
+    LegacyCDMSessionType type() override { return CDMSessionTypeAVStreamSession; }
     RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
     void releaseKeys() override;
     bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
@@ -70,7 +70,7 @@
     enum { Normal, KeyRelease } m_mode;
 };
 
-inline CDMSessionAVStreamSession* toCDMSessionAVStreamSession(CDMSession* session)
+inline CDMSessionAVStreamSession* toCDMSessionAVStreamSession(LegacyCDMSession* session)
 {
     if (!session || session->type() != CDMSessionTypeAVStreamSession)
         return nullptr;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm	2017-10-06 00:13:23 UTC (rev 222946)
@@ -87,7 +87,7 @@
 
 namespace WebCore {
 
-CDMSessionAVStreamSession::CDMSessionAVStreamSession(const Vector<int>& protocolVersions, CDMPrivateMediaSourceAVFObjC& cdm, CDMSessionClient* client)
+CDMSessionAVStreamSession::CDMSessionAVStreamSession(const Vector<int>& protocolVersions, CDMPrivateMediaSourceAVFObjC& cdm, LegacyCDMSessionClient* client)
     : CDMSessionMediaSourceAVFObjC(cdm, client)
     , m_dataParserObserver(adoptNS([[WebCDMSessionAVStreamSessionObserver alloc] initWithParent:this]))
     , m_protocolVersions(protocolVersions)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -40,16 +40,16 @@
 
 class CDMPrivateMediaSourceAVFObjC;
 
-class CDMSessionMediaSourceAVFObjC : public CDMSession, public SourceBufferPrivateAVFObjCErrorClient {
+class CDMSessionMediaSourceAVFObjC : public LegacyCDMSession, public SourceBufferPrivateAVFObjCErrorClient {
 public:
-    CDMSessionMediaSourceAVFObjC(CDMPrivateMediaSourceAVFObjC&, CDMSessionClient*);
+    CDMSessionMediaSourceAVFObjC(CDMPrivateMediaSourceAVFObjC&, LegacyCDMSessionClient*);
     virtual ~CDMSessionMediaSourceAVFObjC();
 
     virtual void addParser(AVStreamDataParser*) = 0;
     virtual void removeParser(AVStreamDataParser*) = 0;
 
-    // CDMSession
-    void setClient(CDMSessionClient* client) override { m_client = client; }
+    // LegacyCDMSession
+    void setClient(LegacyCDMSessionClient* client) override { m_client = client; }
     const String& sessionId() const override { return m_sessionId; }
 
     // SourceBufferPrivateAVFObjCErrorClient
@@ -70,7 +70,7 @@
     String storagePath() const;
 
     CDMPrivateMediaSourceAVFObjC* m_cdm;
-    CDMSessionClient* m_client { nullptr };
+    LegacyCDMSessionClient* m_client { nullptr };
     Vector<RefPtr<SourceBufferPrivateAVFObjC>> m_sourceBuffers;
     RefPtr<Uint8Array> m_certificate;
     String m_sessionId;
@@ -77,7 +77,7 @@
     bool m_stopped { false };
 };
 
-inline CDMSessionMediaSourceAVFObjC* toCDMSessionMediaSourceAVFObjC(CDMSession* session)
+inline CDMSessionMediaSourceAVFObjC* toCDMSessionMediaSourceAVFObjC(LegacyCDMSession* session)
 {
     if (!session || (session->type() != CDMSessionTypeAVStreamSession && session->type() != CDMSessionTypeAVContentKeySession))
         return nullptr;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm	2017-10-06 00:13:23 UTC (rev 222946)
@@ -35,7 +35,7 @@
 
 namespace WebCore {
 
-CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC(CDMPrivateMediaSourceAVFObjC& cdm, CDMSessionClient* client)
+CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC(CDMPrivateMediaSourceAVFObjC& cdm, LegacyCDMSessionClient* client)
     : m_cdm(&cdm)
     , m_client(client)
 {
@@ -57,7 +57,7 @@
     // FIXME(142246): Remove the following once <rdar://problem/20027434> is resolved.
     shouldIgnore = m_stopped && code == 12785;
     if (!shouldIgnore)
-        m_client->sendError(CDMSessionClient::MediaKeyErrorDomain, code);
+        m_client->sendError(LegacyCDMSessionClient::MediaKeyErrorDomain, code);
 }
 
 void CDMSessionMediaSourceAVFObjC::rendererDidReceiveError(AVSampleBufferAudioRenderer *, NSError *error, bool& shouldIgnore)
@@ -70,7 +70,7 @@
     // FIXME(142246): Remove the following once <rdar://problem/20027434> is resolved.
     shouldIgnore = m_stopped && code == 12785;
     if (!shouldIgnore)
-        m_client->sendError(CDMSessionClient::MediaKeyErrorDomain, code);
+        m_client->sendError(LegacyCDMSessionClient::MediaKeyErrorDomain, code);
 }
 
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -155,7 +155,7 @@
 #endif
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-    void removeSession(CDMSession&);
+    void removeSession(LegacyCDMSession&);
 #endif
 
     WeakPtr<MediaPlayerPrivateAVFoundationObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(*this); }
@@ -280,7 +280,7 @@
 #endif
 
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
-    std::unique_ptr<CDMSession> createSession(const String& keySystem, CDMSessionClient*) override;
+    std::unique_ptr<LegacyCDMSession> createSession(const String& keySystem, LegacyCDMSessionClient*) override;
 #endif
 
     String languageOfPrimaryAudioTrack() const override;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2017-10-06 00:13:23 UTC (rev 222946)
@@ -2560,13 +2560,13 @@
         m_keyURIToRequestMap.remove(keyId);
 }
 
-void MediaPlayerPrivateAVFoundationObjC::removeSession(CDMSession& session)
+void MediaPlayerPrivateAVFoundationObjC::removeSession(LegacyCDMSession& session)
 {
     ASSERT_UNUSED(session, &session == m_session);
     m_session = nullptr;
 }
 
-std::unique_ptr<CDMSession> MediaPlayerPrivateAVFoundationObjC::createSession(const String& keySystem, CDMSessionClient* client)
+std::unique_ptr<LegacyCDMSession> MediaPlayerPrivateAVFoundationObjC::createSession(const String& keySystem, LegacyCDMSessionClient* client)
 {
     if (!keySystemIsSupported(keySystem))
         return nullptr;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -122,7 +122,7 @@
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
     bool hasStreamSession() { return m_streamSession; }
     AVStreamSession *streamSession();
-    void setCDMSession(CDMSession*) override;
+    void setCDMSession(LegacyCDMSession*) override;
     CDMSessionMediaSourceAVFObjC* cdmSession() const { return m_session; }
     void keyNeeded(Uint8Array*);
 #endif

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2017-10-06 00:13:23 UTC (rev 222946)
@@ -945,7 +945,7 @@
     return m_streamSession.get();
 }
 
-void MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession(CDMSession* session)
+void MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession(LegacyCDMSession* session)
 {
     if (session == m_session)
         return;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h (222945 => 222946)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -43,7 +43,7 @@
 
 namespace WebCore {
 
-class CDMSession;
+class LegacyCDMSession;
 class MediaPlayerPrivateMediaSourceAVFObjC;
 class MediaSourcePrivateClient;
 class SourceBufferPrivateAVFObjC;

Modified: trunk/Source/WebCore/testing/Internals.cpp (222945 => 222946)


--- trunk/Source/WebCore/testing/Internals.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/testing/Internals.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -2951,8 +2951,8 @@
 
 void Internals::initializeMockCDM()
 {
-    CDM::registerCDMFactory([] (CDM* cdm) { return std::make_unique<MockCDM>(cdm); },
-        MockCDM::supportsKeySystem, MockCDM::supportsKeySystemAndMimeType);
+    LegacyCDM::registerCDMFactory([] (LegacyCDM* cdm) { return std::make_unique<LegacyMockCDM>(cdm); },
+        LegacyMockCDM::supportsKeySystem, LegacyMockCDM::supportsKeySystemAndMimeType);
 }
 
 #endif

Modified: trunk/Source/WebCore/testing/LegacyMockCDM.cpp (222945 => 222946)


--- trunk/Source/WebCore/testing/LegacyMockCDM.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/testing/LegacyMockCDM.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -37,12 +37,12 @@
 
 namespace WebCore {
 
-class MockCDMSession : public CDMSession {
+class MockCDMSession : public LegacyCDMSession {
 public:
-    MockCDMSession(CDMSessionClient*);
+    MockCDMSession(LegacyCDMSessionClient*);
     virtual ~MockCDMSession() { }
 
-    void setClient(CDMSessionClient* client) override { m_client = client; }
+    void setClient(LegacyCDMSessionClient* client) override { m_client = client; }
     const String& sessionId() const override { return m_sessionId; }
     RefPtr<Uint8Array> generateKeyRequest(const String& mimeType, Uint8Array* initData, String& destinationURL, unsigned short& errorCode, uint32_t& systemCode) override;
     void releaseKeys() override;
@@ -49,16 +49,16 @@
     bool update(Uint8Array*, RefPtr<Uint8Array>& nextMessage, unsigned short& errorCode, uint32_t& systemCode) override;
 
 protected:
-    CDMSessionClient* m_client;
+    LegacyCDMSessionClient* m_client;
     String m_sessionId;
 };
 
-bool MockCDM::supportsKeySystem(const String& keySystem)
+bool LegacyMockCDM::supportsKeySystem(const String& keySystem)
 {
     return equalLettersIgnoringASCIICase(keySystem, "com.webcore.mock");
 }
 
-bool MockCDM::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
+bool LegacyMockCDM::supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType)
 {
     if (!supportsKeySystem(keySystem))
         return false;
@@ -66,12 +66,12 @@
     return equalLettersIgnoringASCIICase(mimeType, "video/mock");
 }
 
-bool MockCDM::supportsMIMEType(const String& mimeType)
+bool LegacyMockCDM::supportsMIMEType(const String& mimeType)
 {
     return equalLettersIgnoringASCIICase(mimeType, "video/mock");
 }
 
-std::unique_ptr<CDMSession> MockCDM::createSession(CDMSessionClient* client)
+std::unique_ptr<LegacyCDMSession> LegacyMockCDM::createSession(LegacyCDMSessionClient* client)
 {
     return std::make_unique<MockCDMSession>(client);
 }
@@ -106,7 +106,7 @@
     return String::number(monotonicallyIncreasingSessionId++);
 }
 
-MockCDMSession::MockCDMSession(CDMSessionClient* client)
+MockCDMSession::MockCDMSession(LegacyCDMSessionClient* client)
     : m_client(client)
     , m_sessionId(generateSessionId())
 {

Modified: trunk/Source/WebCore/testing/LegacyMockCDM.h (222945 => 222946)


--- trunk/Source/WebCore/testing/LegacyMockCDM.h	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/testing/LegacyMockCDM.h	2017-10-06 00:13:23 UTC (rev 222946)
@@ -31,11 +31,11 @@
 
 namespace WebCore {
 
-class CDM;
+class LegacyCDM;
 
-class MockCDM : public CDMPrivateInterface {
+class LegacyMockCDM : public CDMPrivateInterface {
 public:
-    explicit MockCDM(CDM* cdm)
+    explicit LegacyMockCDM(LegacyCDM* cdm)
         : m_cdm(cdm)
     { }
 
@@ -43,13 +43,13 @@
     static bool supportsKeySystem(const String&);
     static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType);
 
-    virtual ~MockCDM() { }
+    virtual ~LegacyMockCDM() { }
 
     bool supportsMIMEType(const String& mimeType) override;
-    std::unique_ptr<CDMSession> createSession(CDMSessionClient*) override;
+    std::unique_ptr<LegacyCDMSession> createSession(LegacyCDMSessionClient*) override;
 
 protected:
-    CDM* m_cdm;
+    LegacyCDM* m_cdm;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/testing/MockCDMFactory.cpp (222945 => 222946)


--- trunk/Source/WebCore/testing/MockCDMFactory.cpp	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebCore/testing/MockCDMFactory.cpp	2017-10-06 00:13:23 UTC (rev 222946)
@@ -30,6 +30,7 @@
 
 #include "InitDataRegistry.h"
 #include <runtime/ArrayBuffer.h>
+#include <wtf/NeverDestroyed.h>
 #include <wtf/UUID.h>
 #include <wtf/text/StringHash.h>
 #include <wtf/text/StringView.h>
@@ -377,7 +378,7 @@
 
 const String& MockCDMInstance::keySystem() const
 {
-    static const String s_keySystem("org.webkit.mock");
+    static const NeverDestroyed<String> s_keySystem = MAKE_STATIC_STRING_IMPL("org.webkit.mock");
 
     return s_keySystem;
 }

Modified: trunk/Source/WebKit/ChangeLog (222945 => 222946)


--- trunk/Source/WebKit/ChangeLog	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebKit/ChangeLog	2017-10-06 00:13:23 UTC (rev 222946)
@@ -1,3 +1,12 @@
+2017-10-05  Jer Noble  <jer.no...@apple.com>
+
+        [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
+        https://bugs.webkit.org/show_bug.cgi?id=177261
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2017-10-05  Alex Christensen  <achristen...@webkit.org>
 
         Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList

Modified: trunk/Source/WebKit/Configurations/FeatureDefines.xcconfig (222945 => 222946)


--- trunk/Source/WebKit/Configurations/FeatureDefines.xcconfig	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebKit/Configurations/FeatureDefines.xcconfig	2017-10-06 00:13:23 UTC (rev 222946)
@@ -68,7 +68,7 @@
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
-ENABLE_ENCRYPTED_MEDIA = ;
+ENABLE_ENCRYPTED_MEDIA = ENABLE_ENCRYPTED_MEDIA;
 ENABLE_CONTENT_FILTERING[sdk=appletv*] = ;
 ENABLE_CONTENT_FILTERING[sdk=iphone*] = ENABLE_CONTENT_FILTERING;
 ENABLE_CONTENT_FILTERING[sdk=macosx*] = ENABLE_CONTENT_FILTERING;

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (222945 => 222946)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2017-10-06 00:13:23 UTC (rev 222946)
@@ -1,3 +1,12 @@
+2017-10-05  Jer Noble  <jer.no...@apple.com>
+
+        [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
+        https://bugs.webkit.org/show_bug.cgi?id=177261
+
+        Reviewed by Eric Carlson.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2017-10-05  Chris Dumez  <cdu...@apple.com>
 
         Drop unused parameters for CookiesStrategy::cookiesEnabled()

Modified: trunk/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig (222945 => 222946)


--- trunk/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig	2017-10-06 00:13:23 UTC (rev 222946)
@@ -68,7 +68,7 @@
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
-ENABLE_ENCRYPTED_MEDIA = ;
+ENABLE_ENCRYPTED_MEDIA = ENABLE_ENCRYPTED_MEDIA;
 ENABLE_CONTENT_FILTERING[sdk=appletv*] = ;
 ENABLE_CONTENT_FILTERING[sdk=iphone*] = ENABLE_CONTENT_FILTERING;
 ENABLE_CONTENT_FILTERING[sdk=macosx*] = ENABLE_CONTENT_FILTERING;

Modified: trunk/Tools/ChangeLog (222945 => 222946)


--- trunk/Tools/ChangeLog	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Tools/ChangeLog	2017-10-06 00:13:23 UTC (rev 222946)
@@ -1,3 +1,12 @@
+2017-10-05  Jer Noble  <jer.no...@apple.com>
+
+        [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
+        https://bugs.webkit.org/show_bug.cgi?id=177261
+
+        Reviewed by Eric Carlson.
+
+        * TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
+
 2017-10-05  Alex Christensen  <achristen...@webkit.org>
 
         Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList

Modified: trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig (222945 => 222946)


--- trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig	2017-10-05 23:48:10 UTC (rev 222945)
+++ trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig	2017-10-06 00:13:23 UTC (rev 222946)
@@ -68,7 +68,7 @@
 ENABLE_AVF_CAPTIONS = ENABLE_AVF_CAPTIONS;
 ENABLE_CACHE_PARTITIONING = ENABLE_CACHE_PARTITIONING;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
-ENABLE_ENCRYPTED_MEDIA = ;
+ENABLE_ENCRYPTED_MEDIA = ENABLE_ENCRYPTED_MEDIA;
 ENABLE_CONTENT_FILTERING[sdk=appletv*] = ;
 ENABLE_CONTENT_FILTERING[sdk=iphone*] = ENABLE_CONTENT_FILTERING;
 ENABLE_CONTENT_FILTERING[sdk=macosx*] = ENABLE_CONTENT_FILTERING;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to