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

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

Issue 555223004: Update MediaKeys interface for EME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + Android changes 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 unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 class RendererCdmManager; 21 class RendererCdmManager;
22 22
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,
ddorwin 2014/09/10 22:58:38 What about adding the CB support? TODO?
jrummell 2014/09/11 21:21:55 Added them along with a TODO. Much more work is re
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 34
35 virtual ~ProxyMediaKeys(); 35 virtual ~ProxyMediaKeys();
36 36
37 // MediaKeys implementation. 37 // MediaKeys implementation.
38 virtual void SetServerCertificate(
39 const uint8* certificate_data,
40 int certificate_data_length,
41 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE;
38 virtual void CreateSession( 42 virtual void CreateSession(
39 const std::string& init_data_type, 43 const std::string& init_data_type,
40 const uint8* init_data, 44 const uint8* init_data,
41 int init_data_length, 45 int init_data_length,
42 SessionType session_type, 46 SessionType session_type,
43 scoped_ptr<media::NewSessionCdmPromise> promise) OVERRIDE; 47 scoped_ptr<media::NewSessionCdmPromise> promise) OVERRIDE;
44 virtual void LoadSession( 48 virtual void LoadSession(
45 const std::string& web_session_id, 49 const std::string& web_session_id,
46 scoped_ptr<media::NewSessionCdmPromise> promise) OVERRIDE; 50 scoped_ptr<media::NewSessionCdmPromise> promise) OVERRIDE;
47 virtual void UpdateSession( 51 virtual void UpdateSession(
48 const std::string& web_session_id, 52 const std::string& web_session_id,
49 const uint8* response, 53 const uint8* response,
50 int response_length, 54 int response_length,
51 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE; 55 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE;
52 virtual void ReleaseSession( 56 virtual void CloseSession(
53 const std::string& web_session_id, 57 const std::string& web_session_id,
54 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE; 58 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE;
59 virtual void RemoveSession(
60 const std::string& web_session_id,
61 scoped_ptr<media::SimpleCdmPromise> promise) OVERRIDE;
62 virtual void GetUsableKeyIds(
63 const std::string& web_session_id,
64 scoped_ptr<media::KeyIdsPromise> promise) OVERRIDE;
55 65
56 // Callbacks. 66 // Callbacks.
57 void OnSessionCreated(uint32 session_id, const std::string& web_session_id); 67 void OnSessionCreated(uint32 session_id, const std::string& web_session_id);
58 void OnSessionMessage(uint32 session_id, 68 void OnSessionMessage(uint32 session_id,
59 const std::vector<uint8>& message, 69 const std::vector<uint8>& message,
60 const GURL& destination_url); 70 const GURL& destination_url);
61 void OnSessionReady(uint32 session_id); 71 void OnSessionReady(uint32 session_id);
62 void OnSessionClosed(uint32 session_id); 72 void OnSessionClosed(uint32 session_id);
63 void OnSessionError(uint32 session_id, 73 void OnSessionError(uint32 session_id,
64 media::MediaKeys::KeyError error_code, 74 media::MediaKeys::KeyError error_code,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 128
119 // Keep track of outstanding promises. This map owns the promise object. 129 // Keep track of outstanding promises. This map owns the promise object.
120 PromiseMap session_id_to_promise_map_; 130 PromiseMap session_id_to_promise_map_;
121 131
122 DISALLOW_COPY_AND_ASSIGN(ProxyMediaKeys); 132 DISALLOW_COPY_AND_ASSIGN(ProxyMediaKeys);
123 }; 133 };
124 134
125 } // namespace content 135 } // namespace content
126 136
127 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_MEDIA_KEYS_H_ 137 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PROXY_MEDIA_KEYS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698