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

Unified Diff: webkit/media/webmediaplayer_proxy.h

Issue 10534096: Generalize AesDecryptor to make it more spec compliant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
Index: webkit/media/webmediaplayer_proxy.h
diff --git a/webkit/media/webmediaplayer_proxy.h b/webkit/media/webmediaplayer_proxy.h
index 7d9817aed5412246e79db9c1b7d2c90b31eadecf..c5f919fb6990f4527b5a34a0b54832596a8cccde 100644
--- a/webkit/media/webmediaplayer_proxy.h
+++ b/webkit/media/webmediaplayer_proxy.h
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
#include "media/base/pipeline.h"
+#include "media/crypto/decryptor_client.h"
#include "media/filters/chunk_demuxer.h"
#include "media/filters/chunk_demuxer_client.h"
#include "media/filters/ffmpeg_video_decoder.h"
@@ -41,7 +42,8 @@ class WebMediaPlayerImpl;
// the render thread that WebMediaPlayerImpl is running on.
class WebMediaPlayerProxy
: public base::RefCountedThreadSafe<WebMediaPlayerProxy>,
- public media::ChunkDemuxerClient {
+ public media::ChunkDemuxerClient,
+ public media::DecryptorClient {
public:
WebMediaPlayerProxy(const scoped_refptr<base::MessageLoopProxy>& render_loop,
WebMediaPlayerImpl* webmediaplayer);
@@ -90,8 +92,8 @@ class WebMediaPlayerProxy
// ChunkDemuxerClient implementation.
virtual void DemuxerOpened(media::ChunkDemuxer* demuxer) OVERRIDE;
virtual void DemuxerClosed() OVERRIDE;
- virtual void KeyNeeded(scoped_array<uint8> init_data,
- int init_data_size) OVERRIDE;
+ virtual void DemuxerKeyNeeded(scoped_array<uint8> init_data,
+ int init_data_size) OVERRIDE;
// Methods for Demuxer communication.
void DemuxerStartWaitingForSeek();
@@ -108,7 +110,40 @@ class WebMediaPlayerProxy
void DemuxerOpenedTask(const scoped_refptr<media::ChunkDemuxer>& demuxer);
void DemuxerClosedTask();
- void KeyNeededTask(scoped_array<uint8> init_data, int init_data_size);
+
+ // DecryptorClient implementation.
+ virtual void KeyAdded(const std::string& key_system,
+ const std::string& session_id) OVERRIDE;
+ virtual void KeyError(const std::string& key_system,
+ const std::string& session_id,
+ media::AesDecryptor::KeyError error_code,
+ int system_code) OVERRIDE;
+ virtual void KeyMessage(const std::string& key_system,
+ const std::string& session_id,
+ scoped_array<uint8> message,
+ int message_length,
+ const std::string& default_url) OVERRIDE;
+ virtual void KeyNeeded(const std::string& key_system,
+ const std::string& session_id,
+ scoped_array<uint8> init_data,
+ int init_data_size) OVERRIDE;
+
+ // Methods for DecryptorClient -> WebMediaPlayerImpl communication.
ddorwin 2012/06/11 21:02:40 These should be private, right?
scherkus (not reviewing) 2012/06/12 03:15:58 yep
xhwang 2012/06/12 19:01:15 Done.
xhwang 2012/06/12 19:01:15 Done.
+ void KeyAddedTask(const std::string& key_system,
+ const std::string& session_id);
+ void KeyErrorTask(const std::string& key_system,
+ const std::string& session_id,
+ media::AesDecryptor::KeyError error_code,
+ int system_code);
+ void KeyMessageTask(const std::string& key_system,
+ const std::string& session_id,
+ scoped_array<uint8> message,
+ int message_length,
+ const std::string& default_url);
+ void KeyNeededTask(const std::string& key_system,
+ const std::string& session_id,
+ scoped_array<uint8> init_data,
+ int init_data_size);
private:
friend class base::RefCountedThreadSafe<WebMediaPlayerProxy>;

Powered by Google App Engine
This is Rietveld 408576698