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 22 matching lines...) Expand all Loading... |
33 WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create( | 33 WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create( |
34 blink::WebLocalFrame* frame, | 34 blink::WebLocalFrame* frame, |
35 const blink::WebSecurityOrigin& security_origin, | 35 const blink::WebSecurityOrigin& security_origin, |
36 const base::string16& key_system) { | 36 const base::string16& key_system) { |
37 DCHECK(frame); | 37 DCHECK(frame); |
38 DCHECK(!security_origin.isNull()); | 38 DCHECK(!security_origin.isNull()); |
39 DCHECK(!key_system.empty()); | 39 DCHECK(!key_system.empty()); |
40 | 40 |
41 // TODO(ddorwin): Guard against this in supported types check and remove this. | 41 // TODO(ddorwin): Guard against this in supported types check and remove this. |
42 // Chromium only supports ASCII key systems. | 42 // Chromium only supports ASCII key systems. |
43 if (!IsStringASCII(key_system)) { | 43 if (!base::IsStringASCII(key_system)) { |
44 NOTREACHED(); | 44 NOTREACHED(); |
45 return NULL; | 45 return NULL; |
46 } | 46 } |
47 | 47 |
48 std::string key_system_ascii = base::UTF16ToASCII(key_system); | 48 std::string key_system_ascii = base::UTF16ToASCII(key_system); |
49 if (!IsConcreteSupportedKeySystem(key_system_ascii)) | 49 if (!IsConcreteSupportedKeySystem(key_system_ascii)) |
50 return NULL; | 50 return NULL; |
51 | 51 |
52 // If unique security origin, don't try to create the CDM. | 52 // If unique security origin, don't try to create the CDM. |
53 if (security_origin.isUnique() || security_origin.toString() == "null") { | 53 if (security_origin.isUnique() || security_origin.toString() == "null") { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 return adapter_->GetDecryptor(); | 88 return adapter_->GetDecryptor(); |
89 } | 89 } |
90 | 90 |
91 #if defined(OS_ANDROID) | 91 #if defined(OS_ANDROID) |
92 int WebContentDecryptionModuleImpl::GetCdmId() const { | 92 int WebContentDecryptionModuleImpl::GetCdmId() const { |
93 return adapter_->GetCdmId(); | 93 return adapter_->GetCdmId(); |
94 } | 94 } |
95 #endif // defined(OS_ANDROID) | 95 #endif // defined(OS_ANDROID) |
96 | 96 |
97 } // namespace content | 97 } // namespace content |
OLD | NEW |