| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void CdmPromiseInternal<T...>::resolve(const T&... result) { | 62 void CdmPromiseInternal<T...>::resolve(const T&... result) { |
| 63 MarkPromiseSettled(); | 63 MarkPromiseSettled(); |
| 64 task_runner_->PostTask( | 64 task_runner_->PostTask( |
| 65 FROM_HERE, base::Bind(&::media::CdmPromiseTemplate<T...>::resolve, | 65 FROM_HERE, base::Bind(&::media::CdmPromiseTemplate<T...>::resolve, |
| 66 base::Owned(promise_.release()), result...)); | 66 base::Owned(promise_.release()), result...)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 template <typename... T> | 69 template <typename... T> |
| 70 std::unique_ptr<CdmPromiseInternal<T...>> BindPromiseToCurrentLoop( | 70 std::unique_ptr<CdmPromiseInternal<T...>> BindPromiseToCurrentLoop( |
| 71 std::unique_ptr<::media::CdmPromiseTemplate<T...>> promise) { | 71 std::unique_ptr<::media::CdmPromiseTemplate<T...>> promise) { |
| 72 return base::WrapUnique(new CdmPromiseInternal<T...>(std::move(promise))); | 72 return base::MakeUnique<CdmPromiseInternal<T...>>(std::move(promise)); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace | 75 } // namespace |
| 76 | 76 |
| 77 // A macro runs current member function on |task_runner_| thread. | 77 // A macro runs current member function on |task_runner_| thread. |
| 78 #define FORWARD_ON_CDM_THREAD(param_fn, ...) \ | 78 #define FORWARD_ON_CDM_THREAD(param_fn, ...) \ |
| 79 task_runner_->PostTask( \ | 79 task_runner_->PostTask( \ |
| 80 FROM_HERE, base::Bind(&CastCdm::param_fn, \ | 80 FROM_HERE, base::Bind(&CastCdm::param_fn, \ |
| 81 base::Unretained(cast_cdm_.get()), ##__VA_ARGS__)) | 81 base::Unretained(cast_cdm_.get()), ##__VA_ARGS__)) |
| 82 | 82 |
| (...skipping 75 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 |