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

Side by Side Diff: chrome/browser/media/android/cdm/media_drm_credential_manager.cc

Issue 2823513002: [Clank] Load origin id before create MediaDrmBridge (Closed)
Patch Set: Rebase + Nit Created 3 years, 5 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
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 "chrome/browser/media/android/cdm/media_drm_credential_manager.h" 5 #include "chrome/browser/media/android/cdm/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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 // TODO(ddorwin): The key system should be passed in. http://crbug.com/459400 89 // TODO(ddorwin): The key system should be passed in. http://crbug.com/459400
90 void MediaDrmCredentialManager::ResetCredentialsInternal( 90 void MediaDrmCredentialManager::ResetCredentialsInternal(
91 SecurityLevel security_level) { 91 SecurityLevel security_level) {
92 // Create provision fetcher for the default browser http request context. 92 // Create provision fetcher for the default browser http request context.
93 media::CreateFetcherCB create_fetcher_cb = 93 media::CreateFetcherCB create_fetcher_cb =
94 base::Bind(&content::CreateProvisionFetcher, 94 base::Bind(&content::CreateProvisionFetcher,
95 g_browser_process->system_request_context()); 95 g_browser_process->system_request_context());
96 96
97 ResetCredentialsCB reset_credentials_cb = 97 media::MediaDrmBridge::CreateWithoutSessionSupport(
98 base::Bind(&MediaDrmCredentialManager::OnResetCredentialsCompleted, 98 kWidevineKeySystem, security_level, create_fetcher_cb,
99 base::Unretained(this), security_level); 99 base::BindOnce(
100 &MediaDrmCredentialManager::OnMediaDrmCreated, base::Unretained(this),
101 base::Bind(&MediaDrmCredentialManager::OnResetCredentialsCompleted,
102 base::Unretained(this), security_level)));
103 }
100 104
101 media_drm_bridge_ = media::MediaDrmBridge::CreateWithoutSessionSupport( 105 void MediaDrmCredentialManager::OnMediaDrmCreated(
102 kWidevineKeySystem, security_level, create_fetcher_cb); 106 const ResetCredentialsCB& reset_credentials_cb,
103 107 scoped_refptr<media::MediaDrmBridge> cdm) {
104 // No need to reset credentials for unsupported |security_level|. 108 // No need to reset credentials for unsupported |security_level|.
105 if (!media_drm_bridge_) { 109 if (!cdm) {
106 base::ThreadTaskRunnerHandle::Get()->PostTask( 110 base::ThreadTaskRunnerHandle::Get()->PostTask(
107 FROM_HERE, base::Bind(reset_credentials_cb, true)); 111 FROM_HERE, base::Bind(reset_credentials_cb, true));
108 return; 112 return;
109 } 113 }
110 114
115 media_drm_bridge_ = std::move(cdm);
111 media_drm_bridge_->ResetDeviceCredentials(reset_credentials_cb); 116 media_drm_bridge_->ResetDeviceCredentials(reset_credentials_cb);
112 } 117 }
OLDNEW
« no previous file with comments | « chrome/browser/media/android/cdm/media_drm_credential_manager.h ('k') | media/base/android/android_cdm_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698