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

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

Issue 1112333002: [content/browser/media] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build break Created 5 years, 7 months 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
« no previous file with comments | « no previous file | content/browser/media/capture/web_contents_audio_input_stream_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/message_loop/message_loop_proxy.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/thread_task_runner_handle.h"
13 #include "jni/MediaDrmCredentialManager_jni.h" 14 #include "jni/MediaDrmCredentialManager_jni.h"
14 #include "media/base/android/media_drm_bridge.h" 15 #include "media/base/android/media_drm_bridge.h"
15 #include "url/gurl.h" 16 #include "url/gurl.h"
16 17
17 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 18 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
18 19
19 using base::android::ScopedJavaGlobalRef; 20 using base::android::ScopedJavaGlobalRef;
20 21
21 namespace { 22 namespace {
22 23
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 media::MediaDrmBridge::CreateWithoutSessionSupport(kWidevineKeySystem); 95 media::MediaDrmBridge::CreateWithoutSessionSupport(kWidevineKeySystem);
95 if (!media_drm_bridge_) 96 if (!media_drm_bridge_)
96 return false; 97 return false;
97 98
98 ResetCredentialsCB reset_credentials_cb = 99 ResetCredentialsCB reset_credentials_cb =
99 base::Bind(&MediaDrmCredentialManager::OnResetCredentialsCompleted, 100 base::Bind(&MediaDrmCredentialManager::OnResetCredentialsCompleted,
100 base::Unretained(this), security_level); 101 base::Unretained(this), security_level);
101 102
102 if (!media_drm_bridge_->SetSecurityLevel(security_level)) { 103 if (!media_drm_bridge_->SetSecurityLevel(security_level)) {
103 // No need to reset credentials for unsupported |security_level|. 104 // No need to reset credentials for unsupported |security_level|.
104 base::MessageLoopProxy::current()->PostTask( 105 base::ThreadTaskRunnerHandle::Get()->PostTask(
105 FROM_HERE, base::Bind(reset_credentials_cb, true)); 106 FROM_HERE, base::Bind(reset_credentials_cb, true));
106 return true; 107 return true;
107 } 108 }
108 109
109 media_drm_bridge_->ResetDeviceCredentials(reset_credentials_cb); 110 media_drm_bridge_->ResetDeviceCredentials(reset_credentials_cb);
110 return true; 111 return true;
111 } 112 }
112 113
113 // static 114 // static
114 bool MediaDrmCredentialManager::RegisterMediaDrmCredentialManager(JNIEnv* env) { 115 bool MediaDrmCredentialManager::RegisterMediaDrmCredentialManager(JNIEnv* env) {
115 return RegisterNativesImpl(env); 116 return RegisterNativesImpl(env);
116 } 117 }
117 118
118 } // namespace content 119 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/capture/web_contents_audio_input_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698