OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "media/base/android/android_cdm_factory.h" | 5 #include "media/base/android/android_cdm_factory.h" |
6 | 6 |
7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "media/base/android/media_drm_bridge.h" | 9 #include "media/base/android/media_drm_bridge.h" |
10 #include "media/base/bind_to_current_loop.h" | 10 #include "media/base/bind_to_current_loop.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 bound_cdm_created_cb.Run(nullptr, "Invalid origin."); | 42 bound_cdm_created_cb.Run(nullptr, "Invalid origin."); |
43 return; | 43 return; |
44 } | 44 } |
45 | 45 |
46 // Create AesDecryptor here to support External Clear Key key system. | 46 // Create AesDecryptor here to support External Clear Key key system. |
47 // This is used for testing. | 47 // This is used for testing. |
48 if (base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting) && | 48 if (base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting) && |
49 IsExternalClearKey(key_system)) { | 49 IsExternalClearKey(key_system)) { |
50 scoped_refptr<ContentDecryptionModule> cdm( | 50 scoped_refptr<ContentDecryptionModule> cdm( |
51 new AesDecryptor(security_origin, session_message_cb, session_closed_cb, | 51 new AesDecryptor(security_origin, session_message_cb, session_closed_cb, |
52 session_keys_change_cb)); | 52 session_keys_change_cb, session_expiration_update_cb)); |
53 bound_cdm_created_cb.Run(cdm, ""); | 53 bound_cdm_created_cb.Run(cdm, ""); |
54 return; | 54 return; |
55 } | 55 } |
56 | 56 |
57 std::string error_message; | 57 std::string error_message; |
58 | 58 |
59 if (!MediaDrmBridge::IsKeySystemSupported(key_system)) { | 59 if (!MediaDrmBridge::IsKeySystemSupported(key_system)) { |
60 error_message = "Key system not supported unexpectedly: " + key_system; | 60 error_message = "Key system not supported unexpectedly: " + key_system; |
61 NOTREACHED() << error_message; | 61 NOTREACHED() << error_message; |
62 bound_cdm_created_cb.Run(nullptr, error_message); | 62 bound_cdm_created_cb.Run(nullptr, error_message); |
(...skipping 27 matching lines...) Expand all Loading... |
90 LOG(ERROR) << error_message; | 90 LOG(ERROR) << error_message; |
91 bound_cdm_created_cb.Run(nullptr, error_message); | 91 bound_cdm_created_cb.Run(nullptr, error_message); |
92 return; | 92 return; |
93 } | 93 } |
94 | 94 |
95 // Success! | 95 // Success! |
96 bound_cdm_created_cb.Run(cdm, ""); | 96 bound_cdm_created_cb.Run(cdm, ""); |
97 } | 97 } |
98 | 98 |
99 } // namespace media | 99 } // namespace media |
OLD | NEW |