OLD | NEW |
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_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "third_party/WebKit/public/platform/WebContentDecryptionModule.h" | 12 #include "third_party/WebKit/public/platform/WebContentDecryptionModule.h" |
13 | 13 |
14 namespace media { | 14 namespace media { |
15 class MediaKeys; | 15 class MediaKeys; |
16 } | 16 } |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class WebContentDecryptionModuleSessionImpl; | 20 class WebContentDecryptionModuleSessionImpl; |
21 class ReferenceIdAdapter; | 21 class SessionIdAdapter; |
22 | 22 |
23 class WebContentDecryptionModuleImpl | 23 class WebContentDecryptionModuleImpl |
24 : public blink::WebContentDecryptionModule { | 24 : public blink::WebContentDecryptionModule { |
25 public: | 25 public: |
26 static WebContentDecryptionModuleImpl* Create( | 26 static WebContentDecryptionModuleImpl* Create( |
27 const base::string16& key_system); | 27 const base::string16& key_system); |
28 | 28 |
29 virtual ~WebContentDecryptionModuleImpl(); | 29 virtual ~WebContentDecryptionModuleImpl(); |
30 | 30 |
31 // blink::WebContentDecryptionModule implementation. | 31 // blink::WebContentDecryptionModule implementation. |
32 virtual blink::WebContentDecryptionModuleSession* createSession( | 32 virtual blink::WebContentDecryptionModuleSession* createSession( |
33 blink::WebContentDecryptionModuleSession::Client* client); | 33 blink::WebContentDecryptionModuleSession::Client* client); |
34 | 34 |
35 private: | 35 private: |
36 // Takes ownership of |media_keys| and |adapter|. | 36 // Takes ownership of |media_keys| and |adapter|. |
37 WebContentDecryptionModuleImpl(scoped_ptr<media::MediaKeys> media_keys, | 37 WebContentDecryptionModuleImpl(scoped_ptr<media::MediaKeys> media_keys, |
38 scoped_ptr<ReferenceIdAdapter> adapter); | 38 scoped_ptr<SessionIdAdapter> adapter); |
39 | 39 |
40 // Called when a WebContentDecryptionModuleSessionImpl is closed. | 40 // Called when a WebContentDecryptionModuleSessionImpl is closed. |
41 void OnSessionClosed(uint32 reference_id); | 41 void OnSessionClosed(uint32 session_id); |
42 | 42 |
43 scoped_ptr<media::MediaKeys> media_keys_; | 43 scoped_ptr<media::MediaKeys> media_keys_; |
44 scoped_ptr<ReferenceIdAdapter> adapter_; | 44 scoped_ptr<SessionIdAdapter> adapter_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); | 46 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleImpl); |
47 }; | 47 }; |
48 | 48 |
49 } // namespace content | 49 } // namespace content |
50 | 50 |
51 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ | 51 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULE_IMPL_H_ |
OLD | NEW |