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 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" | 5 #include "content/renderer/media/webcontentdecryptionmodule_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "content/renderer/media/crypto/pepper_cdm_wrapper_impl.h" | 21 #include "content/renderer/media/crypto/pepper_cdm_wrapper_impl.h" |
22 #endif | 22 #endif |
23 | 23 |
24 namespace blink { | 24 namespace blink { |
25 class WebFrame; | 25 class WebFrame; |
26 } | 26 } |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
30 WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create( | 30 WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create( |
31 const base::string16& key_system) { | |
32 blink::WebSecurityOrigin no_origin; | |
33 return WebContentDecryptionModuleImpl::Create(NULL, no_origin, key_system); | |
34 } | |
35 | |
36 WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create( | |
37 blink::WebFrame* frame, | 31 blink::WebFrame* frame, |
38 const blink::WebSecurityOrigin& security_origin, | 32 const blink::WebSecurityOrigin& security_origin, |
39 const base::string16& key_system) { | 33 const base::string16& key_system) { |
40 // TODO(jrummell): Use |security_origin| rather than using the document URL. | 34 // TODO(jrummell): Use |security_origin| rather than using the document URL. |
41 // TODO(jrummell): Once the other Create() method is removed, validate |frame| | 35 DCHECK(frame); |
42 // and |security_origin|. | 36 DCHECK(!security_origin.isNull()); |
43 DCHECK(!key_system.empty()); | 37 DCHECK(!key_system.empty()); |
44 | 38 |
45 // TODO(ddorwin): Guard against this in supported types check and remove this. | 39 // TODO(ddorwin): Guard against this in supported types check and remove this. |
46 // Chromium only supports ASCII key systems. | 40 // Chromium only supports ASCII key systems. |
47 if (!IsStringASCII(key_system)) { | 41 if (!IsStringASCII(key_system)) { |
48 NOTREACHED(); | 42 NOTREACHED(); |
49 return NULL; | 43 return NULL; |
50 } | 44 } |
51 | 45 |
52 scoped_refptr<CdmSessionAdapter> adapter(new CdmSessionAdapter()); | 46 scoped_refptr<CdmSessionAdapter> adapter(new CdmSessionAdapter()); |
(...skipping 21 matching lines...) Expand all Loading... |
74 WebContentDecryptionModuleImpl::createSession( | 68 WebContentDecryptionModuleImpl::createSession( |
75 blink::WebContentDecryptionModuleSession::Client* client) { | 69 blink::WebContentDecryptionModuleSession::Client* client) { |
76 return adapter_->CreateSession(client); | 70 return adapter_->CreateSession(client); |
77 } | 71 } |
78 | 72 |
79 media::Decryptor* WebContentDecryptionModuleImpl::GetDecryptor() { | 73 media::Decryptor* WebContentDecryptionModuleImpl::GetDecryptor() { |
80 return adapter_->GetDecryptor(); | 74 return adapter_->GetDecryptor(); |
81 } | 75 } |
82 | 76 |
83 } // namespace content | 77 } // namespace content |
OLD | NEW |