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

Side by Side Diff: chromecast/media/cdm/cast_cdm_proxy.cc

Issue 2258493003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698