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

Unified Diff: media/blink/null_encrypted_media_player_support.h

Issue 567803002: Hook WebMediaPlayerImpl up to Mojo's HTMLDocumentView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address CR comment Created 6 years, 3 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 | « media/blink/media_blink.gyp ('k') | media/blink/null_encrypted_media_player_support.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/null_encrypted_media_player_support.h
diff --git a/media/blink/null_encrypted_media_player_support.h b/media/blink/null_encrypted_media_player_support.h
new file mode 100644
index 0000000000000000000000000000000000000000..140bef164ee1744cac483355fff8d7e9bb7266cc
--- /dev/null
+++ b/media/blink/null_encrypted_media_player_support.h
@@ -0,0 +1,78 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BLINK_NULL_ENCRYPTED_MEDIA_PLAYER_SUPPORT_H_
+#define MEDIA_BLINK_NULL_ENCRYPTED_MEDIA_PLAYER_SUPPORT_H_
+
+#include "media/base/media_export.h"
+#include "media/blink/encrypted_media_player_support.h"
+
+namespace media {
+
+// A "null" implementation of the EncryptedMediaPlayerSupport interface
+// that indicates all key systems are not supported. This makes sure that
+// any attempts to play encrypted content always fail.
+class MEDIA_EXPORT NullEncryptedMediaPlayerSupport
+ : public EncryptedMediaPlayerSupport {
+ public:
+ static scoped_ptr<EncryptedMediaPlayerSupport> Create(
+ blink::WebMediaPlayerClient* client);
+
+ virtual ~NullEncryptedMediaPlayerSupport();
+
+ // Prefixed API methods.
+ virtual blink::WebMediaPlayer::MediaKeyException GenerateKeyRequest(
+ blink::WebLocalFrame* frame,
+ const blink::WebString& key_system,
+ const unsigned char* init_data,
+ unsigned init_data_length) OVERRIDE;
+
+ virtual blink::WebMediaPlayer::MediaKeyException AddKey(
+ const blink::WebString& key_system,
+ const unsigned char* key,
+ unsigned key_length,
+ const unsigned char* init_data,
+ unsigned init_data_length,
+ const blink::WebString& session_id) OVERRIDE;
+
+ virtual blink::WebMediaPlayer::MediaKeyException CancelKeyRequest(
+ const blink::WebString& key_system,
+ const blink::WebString& session_id) OVERRIDE;
+
+
+ // Unprefixed API methods.
+ virtual void SetContentDecryptionModule(
+ blink::WebContentDecryptionModule* cdm) OVERRIDE;
+ virtual void SetContentDecryptionModule(
+ blink::WebContentDecryptionModule* cdm,
+ blink::WebContentDecryptionModuleResult result) OVERRIDE;
+ virtual void SetContentDecryptionModuleSync(
+ blink::WebContentDecryptionModule* cdm) OVERRIDE;
+
+
+ // Callback factory and notification methods used by WebMediaPlayerImpl.
+
+ // Creates a callback that Demuxers can use to signal that the content
+ // requires a key. This method makes sure the callback returned can be safely
+ // invoked from any thread.
+ virtual Demuxer::NeedKeyCB CreateNeedKeyCB() OVERRIDE;
+
+ // Creates a callback that renderers can use to set decryptor
+ // ready callback. This method makes sure the callback returned can be safely
+ // invoked from any thread.
+ virtual SetDecryptorReadyCB CreateSetDecryptorReadyCB() OVERRIDE;
+
+ // Called to inform this object that the media pipeline encountered
+ // and handled a decryption error.
+ virtual void OnPipelineDecryptError() OVERRIDE;
+
+ private:
+ NullEncryptedMediaPlayerSupport();
+
+ DISALLOW_COPY_AND_ASSIGN(NullEncryptedMediaPlayerSupport);
+};
+
+} // namespace media
+
+#endif // MEDIA_BLINK_NULL_ENCRYPTED_MEDIA_PLAYER_SUPPORT_H_
« no previous file with comments | « media/blink/media_blink.gyp ('k') | media/blink/null_encrypted_media_player_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698