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

Side by Side Diff: content/renderer/media/crypto/proxy_decryptor.h

Issue 193523002: Encrypted Media: Implement IPC based SetCdm(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
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_CRYPTO_PROXY_DECRYPTOR_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_
6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 uint32 system_code)> KeyErrorCB; 52 uint32 system_code)> KeyErrorCB;
53 typedef base::Callback<void(const std::string& session_id, 53 typedef base::Callback<void(const std::string& session_id,
54 const std::vector<uint8>& message, 54 const std::vector<uint8>& message,
55 const std::string& default_url)> KeyMessageCB; 55 const std::string& default_url)> KeyMessageCB;
56 56
57 ProxyDecryptor( 57 ProxyDecryptor(
58 #if defined(ENABLE_PEPPER_CDMS) 58 #if defined(ENABLE_PEPPER_CDMS)
59 const CreatePepperCdmCB& create_pepper_cdm_cb, 59 const CreatePepperCdmCB& create_pepper_cdm_cb,
60 #elif defined(OS_ANDROID) 60 #elif defined(OS_ANDROID)
61 RendererMediaPlayerManager* manager, 61 RendererMediaPlayerManager* manager,
62 int cdm_id,
63 #endif // defined(ENABLE_PEPPER_CDMS) 62 #endif // defined(ENABLE_PEPPER_CDMS)
64 const KeyAddedCB& key_added_cb, 63 const KeyAddedCB& key_added_cb,
65 const KeyErrorCB& key_error_cb, 64 const KeyErrorCB& key_error_cb,
66 const KeyMessageCB& key_message_cb); 65 const KeyMessageCB& key_message_cb);
67 virtual ~ProxyDecryptor(); 66 virtual ~ProxyDecryptor();
68 67
69 // Returns the Decryptor associated with this object. May be NULL if no 68 // Returns the Decryptor associated with this object. May be NULL if no
70 // Decryptor is associated. 69 // Decryptor is associated.
71 media::Decryptor* GetDecryptor(); 70 media::Decryptor* GetDecryptor();
72 71
72 // Returns the CDM ID associated with this object. May be kInvalidCdmId if no
73 // CDM ID is associated.
ddorwin 2014/03/25 23:03:59 Comment why that might happen? Can we just disallo
xhwang 2014/03/26 06:02:04 Even after Initialize() this could still happen, e
74 int GetCdmId();
75
73 // Only call this once. 76 // Only call this once.
74 bool InitializeCDM(const std::string& key_system, const GURL& frame_url); 77 bool InitializeCDM(const std::string& key_system, const GURL& frame_url);
75 78
76 // May only be called after InitializeCDM() succeeds. 79 // May only be called after InitializeCDM() succeeds.
77 bool GenerateKeyRequest(const std::string& type, 80 bool GenerateKeyRequest(const std::string& type,
78 const uint8* init_data, 81 const uint8* init_data,
79 int init_data_length); 82 int init_data_length);
80 void AddKey(const uint8* key, int key_length, 83 void AddKey(const uint8* key, int key_length,
81 const uint8* init_data, int init_data_length, 84 const uint8* init_data, int init_data_length,
82 const std::string& session_id); 85 const std::string& session_id);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 141
139 // NOTE: Weak pointers must be invalidated before all other member variables. 142 // NOTE: Weak pointers must be invalidated before all other member variables.
140 base::WeakPtrFactory<ProxyDecryptor> weak_ptr_factory_; 143 base::WeakPtrFactory<ProxyDecryptor> weak_ptr_factory_;
141 144
142 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); 145 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor);
143 }; 146 };
144 147
145 } // namespace content 148 } // namespace content
146 149
147 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ 150 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698