summaryrefslogtreecommitdiffstats
path: root/content/renderer/media/crypto/ppapi_decryptor.h
diff options
context:
space:
mode:
authorjrummell@chromium.org <jrummell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 19:40:27 +0000
committerjrummell@chromium.org <jrummell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-27 19:40:27 +0000
commitbf54920ec8cdd09ca4619a0689fc5d5713a99287 (patch)
tree803573dc6ef5481fe9023cac830ee9caed92a532 /content/renderer/media/crypto/ppapi_decryptor.h
parent3aa9ca7d36a77ac1cf4077ed041b0c624dea8eb2 (diff)
downloadchromium_src-bf54920ec8cdd09ca4619a0689fc5d5713a99287.zip
chromium_src-bf54920ec8cdd09ca4619a0689fc5d5713a99287.tar.gz
chromium_src-bf54920ec8cdd09ca4619a0689fc5d5713a99287.tar.bz2
Have PpapiDecryptor own the helper plugin
PpapiDecryptor now owns the Pepper helper plugin, which is wrapped in a class so that the helper plugin is destroyed properly. This also removes the dependency on WebMediaPlayerClientImpl to create the plugin so that it could also be created by ContentDecryptionModule::create() for EME WD (once we figure out how to pass the context). BUG=250049 TEST=EME content tests pass Review URL: https://codereview.chromium.org/138383009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/media/crypto/ppapi_decryptor.h')
-rw-r--r--content/renderer/media/crypto/ppapi_decryptor.h27
1 files changed, 10 insertions, 17 deletions
diff --git a/content/renderer/media/crypto/ppapi_decryptor.h b/content/renderer/media/crypto/ppapi_decryptor.h
index f3461ef..64b45d9 100644
--- a/content/renderer/media/crypto/ppapi_decryptor.h
+++ b/content/renderer/media/crypto/ppapi_decryptor.h
@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
+#include "content/renderer/media/crypto/pepper_cdm_wrapper.h"
#include "media/base/decryptor.h"
#include "media/base/media_keys.h"
#include "media/base/video_decoder_config.h"
@@ -29,15 +30,13 @@ class PepperPluginInstanceImpl;
class PpapiDecryptor : public media::MediaKeys, public media::Decryptor {
public:
static scoped_ptr<PpapiDecryptor> Create(
- // TODO(ddorwin): Remove after updating the delegate.
const std::string& key_system,
- const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance,
+ const CreatePepperCdmCB& create_pepper_cdm_cb,
const media::SessionCreatedCB& session_created_cb,
const media::SessionMessageCB& session_message_cb,
const media::SessionReadyCB& session_ready_cb,
const media::SessionClosedCB& session_closed_cb,
- const media::SessionErrorCB& session_error_cb,
- const base::Closure& destroy_plugin_cb);
+ const media::SessionErrorCB& session_error_cb);
virtual ~PpapiDecryptor();
@@ -76,14 +75,12 @@ class PpapiDecryptor : public media::MediaKeys, public media::Decryptor {
private:
PpapiDecryptor(const std::string& key_system,
- const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance,
- ContentDecryptorDelegate* plugin_cdm_delegate,
+ scoped_ptr<PepperCdmWrapper> pepper_cdm_wrapper,
const media::SessionCreatedCB& session_created_cb,
const media::SessionMessageCB& session_message_cb,
const media::SessionReadyCB& session_ready_cb,
const media::SessionClosedCB& session_closed_cb,
- const media::SessionErrorCB& session_error_cb,
- const base::Closure& destroy_plugin_cb);
+ const media::SessionErrorCB& session_error_cb);
void ReportFailureToCallPlugin(uint32 session_id);
@@ -105,14 +102,13 @@ class PpapiDecryptor : public media::MediaKeys, public media::Decryptor {
// this call.
void OnFatalPluginError();
- base::WeakPtr<PpapiDecryptor> weak_this_;
+ ContentDecryptorDelegate* CdmDelegate();
- // Hold a reference of the plugin instance to make sure the plugin outlives
- // the |plugin_cdm_delegate_|. This is needed because |plugin_cdm_delegate_|
- // is owned by the |plugin_instance_|.
- scoped_refptr<PepperPluginInstanceImpl> plugin_instance_;
+ base::WeakPtr<PpapiDecryptor> weak_this_;
- ContentDecryptorDelegate* plugin_cdm_delegate_;
+ // Hold a reference of the Pepper CDM wrapper to make sure the plugin lives
+ // as long as needed.
+ scoped_ptr<PepperCdmWrapper> pepper_cdm_wrapper_;
// Callbacks for firing session events.
media::SessionCreatedCB session_created_cb_;
@@ -121,9 +117,6 @@ class PpapiDecryptor : public media::MediaKeys, public media::Decryptor {
media::SessionClosedCB session_closed_cb_;
media::SessionErrorCB session_error_cb_;
- // Called to destroy the helper plugin when this class no longer needs it.
- base::Closure destroy_plugin_cb_;
-
scoped_refptr<base::MessageLoopProxy> render_loop_proxy_;
DecoderInitCB audio_decoder_init_cb_;