| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/media/cdm/cast_cdm_proxy.h" | 5 #include "chromecast/media/cdm/cast_cdm_proxy.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 if (IsPromiseSettled()) | 32 if (IsPromiseSettled()) |
| 33 return; | 33 return; |
| 34 | 34 |
| 35 DCHECK(promise_); | 35 DCHECK(promise_); |
| 36 RejectPromiseOnDestruction(); | 36 RejectPromiseOnDestruction(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 // CdmPromiseTemplate<> implementation. | 39 // CdmPromiseTemplate<> implementation. |
| 40 void resolve(const T&... result) final; | 40 void resolve(const T&... result) final; |
| 41 | 41 |
| 42 void reject(::media::MediaKeys::Exception exception, | 42 void reject(::media::CdmPromise::Exception exception, |
| 43 uint32_t system_code, | 43 uint32_t system_code, |
| 44 const std::string& error_message) final { | 44 const std::string& error_message) final { |
| 45 MarkPromiseSettled(); | 45 MarkPromiseSettled(); |
| 46 task_runner_->PostTask( | 46 task_runner_->PostTask( |
| 47 FROM_HERE, base::Bind(&::media::CdmPromiseTemplate<T...>::reject, | 47 FROM_HERE, base::Bind(&::media::CdmPromiseTemplate<T...>::reject, |
| 48 base::Owned(promise_.release()), exception, | 48 base::Owned(promise_.release()), exception, |
| 49 system_code, error_message)); | 49 system_code, error_message)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 private: | 52 private: |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 ::media::CdmContext* CastCdmProxy::GetCdmContext() { | 159 ::media::CdmContext* CastCdmProxy::GetCdmContext() { |
| 160 // This will be recast as a CastCdmService pointer before being passed to the | 160 // This will be recast as a CastCdmService pointer before being passed to the |
| 161 // media pipeline. The returned object should only be called on the CMA | 161 // media pipeline. The returned object should only be called on the CMA |
| 162 // renderer thread. | 162 // renderer thread. |
| 163 return cast_cdm_->GetCdmContext(); | 163 return cast_cdm_->GetCdmContext(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace media | 166 } // namespace media |
| 167 } // namespace chromecast | 167 } // namespace chromecast |
| OLD | NEW |