| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MEDIA_KEYS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_MEDIA_KEYS_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_MEDIA_KEYS_H_ | 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_MEDIA_KEYS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // A MediaKeys proxy that wraps the EME part of RendererCdmManager. | 23 // A MediaKeys proxy that wraps the EME part of RendererCdmManager. |
| 24 class ProxyMediaKeys : public media::MediaKeys { | 24 class ProxyMediaKeys : public media::MediaKeys { |
| 25 public: | 25 public: |
| 26 static scoped_ptr<ProxyMediaKeys> Create( | 26 static scoped_ptr<ProxyMediaKeys> Create( |
| 27 const std::string& key_system, | 27 const std::string& key_system, |
| 28 const GURL& security_origin, | 28 const GURL& security_origin, |
| 29 RendererCdmManager* manager, | 29 RendererCdmManager* manager, |
| 30 const media::SessionMessageCB& session_message_cb, | 30 const media::SessionMessageCB& session_message_cb, |
| 31 const media::SessionReadyCB& session_ready_cb, | 31 const media::SessionReadyCB& session_ready_cb, |
| 32 const media::SessionClosedCB& session_closed_cb, | 32 const media::SessionClosedCB& session_closed_cb, |
| 33 const media::SessionErrorCB& session_error_cb); | 33 const media::SessionErrorCB& session_error_cb, |
| 34 const media::SessionKeysChangeCB& session_keys_change_cb, |
| 35 const media::SessionExpirationChangeCB& session_expiration_change_cb); |
| 34 | 36 |
| 35 virtual ~ProxyMediaKeys(); | 37 virtual ~ProxyMediaKeys(); |
| 36 | 38 |
| 37 // MediaKeys implementation. | 39 // MediaKeys implementation. |
| 40 virtual void SetServerCertificate( |
| 41 const uint8* certificate_data, |
| 42 int certificate_data_length, |
| 43 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE; |
| 38 virtual void CreateSession( | 44 virtual void CreateSession( |
| 39 const std::string& init_data_type, | 45 const std::string& init_data_type, |
| 40 const uint8* init_data, | 46 const uint8* init_data, |
| 41 int init_data_length, | 47 int init_data_length, |
| 42 SessionType session_type, | 48 SessionType session_type, |
| 43 scoped_ptr<media::NewSessionCdmPromise> promise) OVERRIDE; | 49 scoped_ptr<media::NewSessionCdmPromise> promise) OVERRIDE; |
| 44 virtual void LoadSession( | 50 virtual void LoadSession( |
| 45 const std::string& web_session_id, | 51 const std::string& web_session_id, |
| 46 scoped_ptr<media::NewSessionCdmPromise> promise) OVERRIDE; | 52 scoped_ptr<media::NewSessionCdmPromise> promise) OVERRIDE; |
| 47 virtual void UpdateSession( | 53 virtual void UpdateSession( |
| 48 const std::string& web_session_id, | 54 const std::string& web_session_id, |
| 49 const uint8* response, | 55 const uint8* response, |
| 50 int response_length, | 56 int response_length, |
| 51 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE; | 57 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE; |
| 52 virtual void ReleaseSession( | 58 virtual void CloseSession( |
| 53 const std::string& web_session_id, | 59 const std::string& web_session_id, |
| 54 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE; | 60 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE; |
| 61 virtual void RemoveSession( |
| 62 const std::string& web_session_id, |
| 63 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE; |
| 64 virtual void GetUsableKeyIds( |
| 65 const std::string& web_session_id, |
| 66 scoped_ptr<media::KeyIdsPromise> promise) OVERRIDE; |
| 55 | 67 |
| 56 // Callbacks. | 68 // Callbacks. |
| 57 void OnSessionCreated(uint32 session_id, const std::string& web_session_id); | 69 void OnSessionCreated(uint32 session_id, const std::string& web_session_id); |
| 58 void OnSessionMessage(uint32 session_id, | 70 void OnSessionMessage(uint32 session_id, |
| 59 const std::vector<uint8>& message, | 71 const std::vector<uint8>& message, |
| 60 const GURL& destination_url); | 72 const GURL& destination_url); |
| 61 void OnSessionReady(uint32 session_id); | 73 void OnSessionReady(uint32 session_id); |
| 62 void OnSessionClosed(uint32 session_id); | 74 void OnSessionClosed(uint32 session_id); |
| 63 void OnSessionError(uint32 session_id, | 75 void OnSessionError(uint32 session_id, |
| 64 media::MediaKeys::KeyError error_code, | 76 media::MediaKeys::KeyError error_code, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 130 |
| 119 // Keep track of outstanding promises. This map owns the promise object. | 131 // Keep track of outstanding promises. This map owns the promise object. |
| 120 PromiseMap session_id_to_promise_map_; | 132 PromiseMap session_id_to_promise_map_; |
| 121 | 133 |
| 122 DISALLOW_COPY_AND_ASSIGN(ProxyMediaKeys); | 134 DISALLOW_COPY_AND_ASSIGN(ProxyMediaKeys); |
| 123 }; | 135 }; |
| 124 | 136 |
| 125 } // namespace content | 137 } // namespace content |
| 126 | 138 |
| 127 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_MEDIA_KEYS_H_ | 139 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_MEDIA_KEYS_H_ |
| OLD | NEW |