OLD | NEW |
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/callback.h" | 10 #include "base/callback.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 void PpapiDecryptor::ReleaseSession( | 214 void PpapiDecryptor::ReleaseSession( |
215 const std::string& web_session_id, | 215 const std::string& web_session_id, |
216 scoped_ptr<media::SimpleCdmPromise> promise) { | 216 scoped_ptr<media::SimpleCdmPromise> promise) { |
217 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); | 217 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); |
218 | 218 |
219 if (!CdmDelegate()) { | 219 if (!CdmDelegate()) { |
220 promise->reject(INVALID_STATE_ERROR, 0, "CdmDelegate() does not exist."); | 220 promise->reject(INVALID_STATE_ERROR, 0, "CdmDelegate() does not exist."); |
221 return; | 221 return; |
222 } | 222 } |
223 | 223 |
224 CdmDelegate()->ReleaseSession(web_session_id, promise.Pass()); | 224 CdmDelegate()->CloseSession(web_session_id, promise.Pass()); |
225 } | 225 } |
226 | 226 |
227 media::Decryptor* PpapiDecryptor::GetDecryptor() { | 227 media::Decryptor* PpapiDecryptor::GetDecryptor() { |
228 return this; | 228 return this; |
229 } | 229 } |
230 | 230 |
231 void PpapiDecryptor::RegisterNewKeyCB(StreamType stream_type, | 231 void PpapiDecryptor::RegisterNewKeyCB(StreamType stream_type, |
232 const NewKeyCB& new_key_cb) { | 232 const NewKeyCB& new_key_cb) { |
233 if (!render_loop_proxy_->BelongsToCurrentThread()) { | 233 if (!render_loop_proxy_->BelongsToCurrentThread()) { |
234 render_loop_proxy_->PostTask(FROM_HERE, | 234 render_loop_proxy_->PostTask(FROM_HERE, |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); | 472 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); |
473 pepper_cdm_wrapper_.reset(); | 473 pepper_cdm_wrapper_.reset(); |
474 } | 474 } |
475 | 475 |
476 ContentDecryptorDelegate* PpapiDecryptor::CdmDelegate() { | 476 ContentDecryptorDelegate* PpapiDecryptor::CdmDelegate() { |
477 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); | 477 DCHECK(render_loop_proxy_->BelongsToCurrentThread()); |
478 return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() : NULL; | 478 return (pepper_cdm_wrapper_) ? pepper_cdm_wrapper_->GetCdmDelegate() : NULL; |
479 } | 479 } |
480 | 480 |
481 } // namespace content | 481 } // namespace content |
OLD | NEW |