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

Side by Side Diff: content/renderer/media/cdm/ppapi_decryptor.h

Issue 2568463003: media: Rename MediaKeys to ContentDecryptionModule (Closed)
Patch Set: comments addressed Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_MEDIA_CDM_PPAPI_DECRYPTOR_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_CDM_PPAPI_DECRYPTOR_H_
6 #define CONTENT_RENDERER_MEDIA_CDM_PPAPI_DECRYPTOR_H_ 6 #define CONTENT_RENDERER_MEDIA_CDM_PPAPI_DECRYPTOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "content/renderer/media/cdm/pepper_cdm_wrapper.h" 16 #include "content/renderer/media/cdm/pepper_cdm_wrapper.h"
17 #include "media/base/cdm_context.h" 17 #include "media/base/cdm_context.h"
18 #include "media/base/cdm_factory.h" 18 #include "media/base/cdm_factory.h"
19 #include "media/base/content_decryption_module.h"
19 #include "media/base/decryptor.h" 20 #include "media/base/decryptor.h"
20 #include "media/base/media_keys.h"
21 #include "media/base/video_decoder_config.h" 21 #include "media/base/video_decoder_config.h"
22 22
23 class GURL; 23 class GURL;
24 24
25 namespace base { 25 namespace base {
26 class SingleThreadTaskRunner; 26 class SingleThreadTaskRunner;
27 } 27 }
28 28
29 namespace content { 29 namespace content {
30 class ContentDecryptorDelegate; 30 class ContentDecryptorDelegate;
31 31
32 // PpapiDecryptor implements media::MediaKeys and media::Decryptor and forwards 32 // PpapiDecryptor implements media::ContentDecryptionModule and media::Decryptor
33 // all calls to the PluginInstance. 33 // and forwards all calls to the PluginInstance.
34 // This class should always be created & destroyed on the main renderer thread. 34 // This class should always be created & destroyed on the main renderer thread.
35 class PpapiDecryptor : public media::MediaKeys, 35 class PpapiDecryptor : public media::ContentDecryptionModule,
36 public media::CdmContext, 36 public media::CdmContext,
37 public media::Decryptor { 37 public media::Decryptor {
38 public: 38 public:
39 static void Create( 39 static void Create(
40 const std::string& key_system, 40 const std::string& key_system,
41 const GURL& security_origin, 41 const GURL& security_origin,
42 bool allow_distinctive_identifier, 42 bool allow_distinctive_identifier,
43 bool allow_persistent_state, 43 bool allow_persistent_state,
44 const CreatePepperCdmCB& create_pepper_cdm_cb, 44 const CreatePepperCdmCB& create_pepper_cdm_cb,
45 const media::SessionMessageCB& session_message_cb, 45 const media::SessionMessageCB& session_message_cb,
46 const media::SessionClosedCB& session_closed_cb, 46 const media::SessionClosedCB& session_closed_cb,
47 const media::SessionKeysChangeCB& session_keys_change_cb, 47 const media::SessionKeysChangeCB& session_keys_change_cb,
48 const media::SessionExpirationUpdateCB& session_expiration_update_cb, 48 const media::SessionExpirationUpdateCB& session_expiration_update_cb,
49 const media::CdmCreatedCB& cdm_created_cb); 49 const media::CdmCreatedCB& cdm_created_cb);
50 50
51 // media::MediaKeys implementation. 51 // media::ContentDecryptionModule implementation.
52 void SetServerCertificate( 52 void SetServerCertificate(
53 const std::vector<uint8_t>& certificate, 53 const std::vector<uint8_t>& certificate,
54 std::unique_ptr<media::SimpleCdmPromise> promise) override; 54 std::unique_ptr<media::SimpleCdmPromise> promise) override;
55 void CreateSessionAndGenerateRequest( 55 void CreateSessionAndGenerateRequest(
56 SessionType session_type, 56 SessionType session_type,
57 media::EmeInitDataType init_data_type, 57 media::EmeInitDataType init_data_type,
58 const std::vector<uint8_t>& init_data, 58 const std::vector<uint8_t>& init_data,
59 std::unique_ptr<media::NewSessionCdmPromise> promise) override; 59 std::unique_ptr<media::NewSessionCdmPromise> promise) override;
60 void LoadSession( 60 void LoadSession(
61 SessionType session_type, 61 SessionType session_type,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 void InitializeCdm(const std::string& key_system, 107 void InitializeCdm(const std::string& key_system,
108 bool allow_distinctive_identifier, 108 bool allow_distinctive_identifier,
109 bool allow_persistent_state, 109 bool allow_persistent_state,
110 std::unique_ptr<media::SimpleCdmPromise> promise); 110 std::unique_ptr<media::SimpleCdmPromise> promise);
111 111
112 void OnDecoderInitialized(StreamType stream_type, bool success); 112 void OnDecoderInitialized(StreamType stream_type, bool success);
113 113
114 // Callbacks for |plugin_cdm_delegate_| to fire session events. 114 // Callbacks for |plugin_cdm_delegate_| to fire session events.
115 void OnSessionMessage(const std::string& session_id, 115 void OnSessionMessage(const std::string& session_id,
116 MediaKeys::MessageType message_type, 116 ContentDecryptionModule::MessageType message_type,
117 const std::vector<uint8_t>& message); 117 const std::vector<uint8_t>& message);
118 void OnSessionKeysChange(const std::string& session_id, 118 void OnSessionKeysChange(const std::string& session_id,
119 bool has_additional_usable_key, 119 bool has_additional_usable_key,
120 media::CdmKeysInfo keys_info); 120 media::CdmKeysInfo keys_info);
121 void OnSessionExpirationUpdate(const std::string& session_id, 121 void OnSessionExpirationUpdate(const std::string& session_id,
122 base::Time new_expiry_time); 122 base::Time new_expiry_time);
123 void OnSessionClosed(const std::string& session_id); 123 void OnSessionClosed(const std::string& session_id);
124 124
125 void AttemptToResumePlayback(); 125 void AttemptToResumePlayback();
126 126
(...skipping 23 matching lines...) Expand all
150 150
151 // NOTE: Weak pointers must be invalidated before all other member variables. 151 // NOTE: Weak pointers must be invalidated before all other member variables.
152 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; 152 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_;
153 153
154 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); 154 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor);
155 }; 155 };
156 156
157 } // namespace content 157 } // namespace content
158 158
159 #endif // CONTENT_RENDERER_MEDIA_CDM_PPAPI_DECRYPTOR_H_ 159 #endif // CONTENT_RENDERER_MEDIA_CDM_PPAPI_DECRYPTOR_H_
OLDNEW
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.cc ('k') | content/renderer/media/cdm/render_cdm_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698