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

Unified Diff: media/mojo/clients/mojo_cdm.cc

Issue 2268283003: media: Add External Clear Key content browser test on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/clients/mojo_cdm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/clients/mojo_cdm.cc
diff --git a/media/mojo/clients/mojo_cdm.cc b/media/mojo/clients/mojo_cdm.cc
index f97d3905307b050fe153366866a3f1ad58bed18f..6674f81a2a2536e1f5dc40429218e88f6a059b79 100644
--- a/media/mojo/clients/mojo_cdm.cc
+++ b/media/mojo/clients/mojo_cdm.cc
@@ -84,8 +84,8 @@ MojoCdm::~MojoCdm() {
base::AutoLock auto_lock(lock_);
// Release |decryptor_| on the correct thread. If GetDecryptor() is never
- // called but |decryptor_ptr_| is not null, it is not bound to any thread and
- // is safe to be released on the current thread.
+ // called but |decryptor_ptr_info_| is not null, it is not bound to any thread
+ // and is safe to be released on the current thread.
if (decryptor_task_runner_ &&
!decryptor_task_runner_->BelongsToCurrentThread() && decryptor_) {
decryptor_task_runner_->DeleteSoon(FROM_HERE, decryptor_.release());
@@ -219,9 +219,11 @@ media::Decryptor* MojoCdm::GetDecryptor() {
DCHECK(decryptor_task_runner_->BelongsToCurrentThread());
// Can be called on a different thread.
- if (decryptor_ptr_) {
+ if (decryptor_ptr_info_.is_valid()) {
DCHECK(!decryptor_);
- decryptor_.reset(new MojoDecryptor(std::move(decryptor_ptr_)));
+ mojom::DecryptorPtr decryptor_ptr;
+ decryptor_ptr.Bind(std::move(decryptor_ptr_info_));
+ decryptor_.reset(new MojoDecryptor(std::move(decryptor_ptr)));
}
return decryptor_.get();
@@ -306,7 +308,7 @@ void MojoCdm::OnCdmInitialized(mojom::CdmPromiseResultPtr result,
base::AutoLock auto_lock(lock_);
DCHECK_NE(CdmContext::kInvalidCdmId, cdm_id);
cdm_id_ = cdm_id;
- decryptor_ptr_ = std::move(decryptor);
+ decryptor_ptr_info_ = decryptor.PassInterface();
}
pending_init_promise_->resolve();
« no previous file with comments | « media/mojo/clients/mojo_cdm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698