Chromium Code Reviews| Index: components/cdm/browser/cdm_message_filter_android.cc |
| diff --git a/components/cdm/browser/cdm_message_filter_android.cc b/components/cdm/browser/cdm_message_filter_android.cc |
| index 2bda86078edf434c9f5dc759f716cb77ad7f2ab1..62d027638c2cbfad1499472b5e089b4c2e7d55de 100644 |
| --- a/components/cdm/browser/cdm_message_filter_android.cc |
| +++ b/components/cdm/browser/cdm_message_filter_android.cc |
| @@ -5,12 +5,15 @@ |
| #include "components/cdm/browser/cdm_message_filter_android.h" |
| #include <string> |
| +#include <vector> |
| #include "components/cdm/common/cdm_messages_android.h" |
| #include "ipc/ipc_message_macros.h" |
| #include "media/base/android/media_codec_bridge.h" |
| #include "media/base/android/media_drm_bridge.h" |
| +#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
| + |
| using content::BrowserThread; |
| using content::SupportedCodecs; |
| using media::MediaCodecBridge; |
| @@ -66,15 +69,24 @@ static SupportedCodecs GetSupportedCodecs( |
| } |
| CdmMessageFilterAndroid::CdmMessageFilterAndroid() |
|
ddorwin
2014/06/10 18:48:03
This is used by Chrome and the next one is only us
ycheo (away)
2014/06/11 00:08:22
That's my original intention.
|
| - : BrowserMessageFilter(EncryptedMediaMsgStart) {} |
| + : BrowserMessageFilter(EncryptedMediaMsgStart) { |
| + key_systems_.push_back(kWidevineKeySystem); |
|
ddorwin
2014/06/10 18:48:03
If we need special handling for Chrome, why not ju
ycheo (away)
2014/06/11 00:08:21
Removed.
|
| +} |
| + |
| +CdmMessageFilterAndroid::CdmMessageFilterAndroid( |
|
ddorwin
2014/06/10 18:48:04
This is never used.
ycheo (away)
2014/06/11 00:08:22
Removed.
|
| + const std::vector<std::string> key_systems) |
| + : BrowserMessageFilter(EncryptedMediaMsgStart), |
| + key_systems_(key_systems) {} |
| CdmMessageFilterAndroid::~CdmMessageFilterAndroid() {} |
| bool CdmMessageFilterAndroid::OnMessageReceived(const IPC::Message& message) { |
| bool handled = true; |
| IPC_BEGIN_MESSAGE_MAP(CdmMessageFilterAndroid, message) |
| - IPC_MESSAGE_HANDLER(ChromeViewHostMsg_GetSupportedKeySystems, |
| - OnGetSupportedKeySystems) |
| + IPC_MESSAGE_HANDLER(CdmHostMsg_GetSupportedKeySystem, |
|
ddorwin
2014/06/10 18:48:03
I'm not sure CdmHostMsg is correct. It is not a me
ycheo (away)
2014/06/11 00:08:22
Reverted the prefix to ChromeViewHostMsg.
|
| + OnGetSupportedKeySystem) |
| + IPC_MESSAGE_HANDLER(CdmHostMsg_GetAllSupportedKeySystemNames, |
| + OnGetAllSupportedKeySystemNames) |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP() |
| return handled; |
| @@ -83,11 +95,13 @@ bool CdmMessageFilterAndroid::OnMessageReceived(const IPC::Message& message) { |
| void CdmMessageFilterAndroid::OverrideThreadForMessage( |
| const IPC::Message& message, BrowserThread::ID* thread) { |
| // Move the IPC handling to FILE thread as it is not very cheap. |
| - if (message.type() == ChromeViewHostMsg_GetSupportedKeySystems::ID) |
| + if (message.type() == CdmHostMsg_GetSupportedKeySystem::ID || |
| + message.type() == CdmHostMsg_GetAllSupportedKeySystemNames) { |
|
ddorwin
2014/06/10 18:48:04
This one is cheap - it just returns a list, right?
ycheo (away)
2014/06/11 00:08:21
Correct. Removed this from the condition.
|
| *thread = BrowserThread::FILE; |
| + } |
| } |
| -void CdmMessageFilterAndroid::OnGetSupportedKeySystems( |
| +void CdmMessageFilterAndroid::OnGetSupportedKeySystem( |
|
ddorwin
2014/06/10 18:48:04
This should probably be something like OnGetKeySys
ycheo (away)
2014/06/11 00:08:22
Thanks for the suggestion.
|
| const SupportedKeySystemRequest& request, |
| SupportedKeySystemResponse* response) { |
| if (!response) { |
| @@ -110,4 +124,9 @@ void CdmMessageFilterAndroid::OnGetSupportedKeySystems( |
| response->non_compositing_codecs = GetSupportedCodecs(request, false); |
| } |
| +void CdmMessageFilterAndroid::OnGetAllSupportedKeySystemNames( |
|
ddorwin
2014/06/10 18:48:04
If this was OnGetPlatform... then you wouldn't nee
ycheo (away)
2014/06/11 00:08:21
Done.
|
| + std::vector<std::string>* key_systems) { |
| + *key_systems = key_systems_; |
|
ddorwin
2014/06/10 18:48:04
It seems this information should come from the sam
ycheo (away)
2014/06/11 00:08:21
Added a method MediaDrmBridge::GetPlatformKeySyste
|
| +} |
| + |
| } // namespace cdm |