Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Unified Diff: webkit/media/crypto/proxy_decryptor.cc

Issue 15028015: Conditionally build support for Pepper-based CDMs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use AppendAscii() where possible. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/media/crypto/proxy_decryptor.h ('k') | webkit/media/webkit_media.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/crypto/proxy_decryptor.cc
diff --git a/webkit/media/crypto/proxy_decryptor.cc b/webkit/media/crypto/proxy_decryptor.cc
index 866b88c97c4204429a7e5eb5723b6f8a90a9f941..3e445c418161a272e97b12ea570596ce4531e789 100644
--- a/webkit/media/crypto/proxy_decryptor.cc
+++ b/webkit/media/crypto/proxy_decryptor.cc
@@ -8,9 +8,11 @@
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "media/crypto/aes_decryptor.h"
+#include "webkit/media/crypto/key_systems.h"
+
+#if defined(ENABLE_PEPPER_CDMS)
#include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
-#include "webkit/media/crypto/key_systems.h"
#include "webkit/media/crypto/ppapi_decryptor.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
@@ -19,9 +21,11 @@
// See: https://bugs.webkit.org/show_bug.cgi?id=92031
// Fix include order here when the bug is fixed.
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient.h"
+#endif // defined(ENABLE_PEPPER_CDMS)
namespace webkit_media {
+#if defined(ENABLE_PEPPER_CDMS)
// Returns the PluginInstance associated with the Helper Plugin.
// If a non-NULL pointer is returned, the caller must call closeHelperPlugin()
// when the Helper Plugin is no longer needed.
@@ -48,6 +52,7 @@ static void DestroyHelperPlugin(
WebKit::WebMediaPlayerClient* web_media_player_client) {
web_media_player_client->closeHelperPlugin();
}
+#endif // defined(ENABLE_PEPPER_CDMS)
ProxyDecryptor::ProxyDecryptor(
WebKit::WebMediaPlayerClient* web_media_player_client,
@@ -73,8 +78,10 @@ ProxyDecryptor::~ProxyDecryptor() {
decryptor_.reset();
}
+#if defined(ENABLE_PEPPER_CDMS)
if (did_create_helper_plugin_)
DestroyHelperPlugin(web_media_player_client_);
+#endif
web_media_player_client_ = NULL; // We should be done using it now.
}
@@ -156,12 +163,13 @@ void ProxyDecryptor::CancelKeyRequest(const std::string& key_system,
decryptor_->CancelKeyRequest(key_system, session_id);
}
+#if defined(ENABLE_PEPPER_CDMS)
scoped_ptr<media::Decryptor> ProxyDecryptor::CreatePpapiDecryptor(
const std::string& key_system) {
DCHECK(web_media_player_client_);
DCHECK(web_frame_);
- std::string plugin_type = GetPluginType(key_system);
+ std::string plugin_type = GetPepperType(key_system);
DCHECK(!plugin_type.empty());
const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance =
CreateHelperPlugin(plugin_type, web_media_player_client_, web_frame_);
@@ -178,6 +186,7 @@ scoped_ptr<media::Decryptor> ProxyDecryptor::CreatePpapiDecryptor(
base::Bind(&ProxyDecryptor::KeyMessage, weak_ptr_factory_.GetWeakPtr()),
base::Bind(&ProxyDecryptor::NeedKey, weak_ptr_factory_.GetWeakPtr())));
}
+#endif // defined(ENABLE_PEPPER_CDMS)
scoped_ptr<media::Decryptor> ProxyDecryptor::CreateDecryptor(
const std::string& key_system) {
@@ -188,10 +197,14 @@ scoped_ptr<media::Decryptor> ProxyDecryptor::CreateDecryptor(
base::Bind(&ProxyDecryptor::KeyMessage, weak_ptr_factory_.GetWeakPtr()),
base::Bind(&ProxyDecryptor::NeedKey, weak_ptr_factory_.GetWeakPtr())));
+#if defined(ENABLE_PEPPER_CDMS)
// We only support AesDecryptor and PpapiDecryptor. So if we cannot
// use the AesDecryptor, then we'll try to create a PpapiDecryptor for given
// |key_system|.
return CreatePpapiDecryptor(key_system);
+#else
+ return scoped_ptr<media::Decryptor>();
+#endif // defined(ENABLE_PEPPER_CDMS)
}
void ProxyDecryptor::KeyAdded(const std::string& key_system,
« no previous file with comments | « webkit/media/crypto/proxy_decryptor.h ('k') | webkit/media/webkit_media.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698