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/browser/media/android/media_drm_credential_manager.h" | 5 #include "content/browser/media/android/media_drm_credential_manager.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 void MediaDrmCredentialManager::OnResetCredentialsCompleted( | 79 void MediaDrmCredentialManager::OnResetCredentialsCompleted( |
80 SecurityLevel security_level, bool success) { | 80 SecurityLevel security_level, bool success) { |
81 if (security_level == media::MediaDrmBridge::SECURITY_LEVEL_3 && success) { | 81 if (security_level == media::MediaDrmBridge::SECURITY_LEVEL_3 && success) { |
82 if (ResetCredentialsInternal(media::MediaDrmBridge::SECURITY_LEVEL_1)) | 82 if (ResetCredentialsInternal(media::MediaDrmBridge::SECURITY_LEVEL_1)) |
83 return; | 83 return; |
84 success = false; | 84 success = false; |
85 } | 85 } |
86 | 86 |
87 base::ResetAndReturn(&reset_credentials_cb_).Run(success); | 87 base::ResetAndReturn(&reset_credentials_cb_).Run(success); |
88 media_drm_bridge_.reset(); | 88 media_drm_bridge_ = nullptr; |
89 } | 89 } |
90 | 90 |
91 // TODO(ddorwin): The key system should be passed in. http://crbug.com/459400 | 91 // TODO(ddorwin): The key system should be passed in. http://crbug.com/459400 |
92 bool MediaDrmCredentialManager::ResetCredentialsInternal( | 92 bool MediaDrmCredentialManager::ResetCredentialsInternal( |
93 SecurityLevel security_level) { | 93 SecurityLevel security_level) { |
94 media_drm_bridge_ = | 94 media_drm_bridge_ = |
95 media::MediaDrmBridge::CreateWithoutSessionSupport(kWidevineKeySystem); | 95 media::MediaDrmBridge::CreateWithoutSessionSupport(kWidevineKeySystem); |
96 if (!media_drm_bridge_) | 96 if (!media_drm_bridge_) |
97 return false; | 97 return false; |
98 | 98 |
(...skipping 11 matching lines...) Expand all Loading... |
110 media_drm_bridge_->ResetDeviceCredentials(reset_credentials_cb); | 110 media_drm_bridge_->ResetDeviceCredentials(reset_credentials_cb); |
111 return true; | 111 return true; |
112 } | 112 } |
113 | 113 |
114 // static | 114 // static |
115 bool MediaDrmCredentialManager::RegisterMediaDrmCredentialManager(JNIEnv* env) { | 115 bool MediaDrmCredentialManager::RegisterMediaDrmCredentialManager(JNIEnv* env) { |
116 return RegisterNativesImpl(env); | 116 return RegisterNativesImpl(env); |
117 } | 117 } |
118 | 118 |
119 } // namespace content | 119 } // namespace content |
OLD | NEW |