Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: content/browser/media/android/media_drm_credential_manager.cc

Issue 1407933010: media: Make MediaKeys ref-counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/media/android/media_drm_credential_manager.h ('k') | content/browser/media/cdm/browser_cdm_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698