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

Side by Side Diff: content/renderer/media/crypto/ppapi_decryptor.cc

Issue 748473002: Introduce CdmContext interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@set_cdm
Patch Set: Created 6 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/renderer/media/crypto/ppapi_decryptor.h" 5 #include "content/renderer/media/crypto/ppapi_decryptor.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); 188 DCHECK(render_loop_proxy_->BelongsToCurrentThread());
189 189
190 if (!CdmDelegate()) { 190 if (!CdmDelegate()) {
191 promise->reject(INVALID_STATE_ERROR, 0, "CdmDelegate() does not exist."); 191 promise->reject(INVALID_STATE_ERROR, 0, "CdmDelegate() does not exist.");
192 return; 192 return;
193 } 193 }
194 194
195 CdmDelegate()->GetUsableKeyIds(web_session_id, promise.Pass()); 195 CdmDelegate()->GetUsableKeyIds(web_session_id, promise.Pass());
196 } 196 }
197 197
198 media::CdmContext* PpapiDecryptor::GetCdmContext() {
199 return this;
200 }
201
198 media::Decryptor* PpapiDecryptor::GetDecryptor() { 202 media::Decryptor* PpapiDecryptor::GetDecryptor() {
199 return this; 203 return this;
200 } 204 }
201 205
202 void PpapiDecryptor::RegisterNewKeyCB(StreamType stream_type, 206 void PpapiDecryptor::RegisterNewKeyCB(StreamType stream_type,
203 const NewKeyCB& new_key_cb) { 207 const NewKeyCB& new_key_cb) {
204 if (!render_loop_proxy_->BelongsToCurrentThread()) { 208 if (!render_loop_proxy_->BelongsToCurrentThread()) {
205 render_loop_proxy_->PostTask(FROM_HERE, 209 render_loop_proxy_->PostTask(FROM_HERE,
206 base::Bind(&PpapiDecryptor::RegisterNewKeyCB, 210 base::Bind(&PpapiDecryptor::RegisterNewKeyCB,
207 weak_ptr_factory_.GetWeakPtr(), 211 weak_ptr_factory_.GetWeakPtr(),
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); 461 DCHECK(render_loop_proxy_->BelongsToCurrentThread());
458 pepper_cdm_wrapper_.reset(); 462 pepper_cdm_wrapper_.reset();
459 } 463 }
460 464
461 ContentDecryptorDelegate* PpapiDecryptor::CdmDelegate() { 465 ContentDecryptorDelegate* PpapiDecryptor::CdmDelegate() {
462 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); 466 DCHECK(render_loop_proxy_->BelongsToCurrentThread());
463 return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() : NULL; 467 return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() : NULL;
464 } 468 }
465 469
466 } // namespace content 470 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698