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

Unified Diff: media/base/cdm_promise_adapter.cc

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: . Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: media/base/cdm_promise_adapter.cc
diff --git a/media/base/cdm_promise_adapter.cc b/media/base/cdm_promise_adapter.cc
index 5df17d861cbc00af784c6e79b8e7ab673bf8e83e..06dba4340e8e7bb0e020ba644183cf0ab6898caf 100644
--- a/media/base/cdm_promise_adapter.cc
+++ b/media/base/cdm_promise_adapter.cc
@@ -19,7 +19,7 @@ CdmPromiseAdapter::~CdmPromiseAdapter() {
Clear();
}
-uint32_t CdmPromiseAdapter::SavePromise(scoped_ptr<CdmPromise> promise) {
+uint32_t CdmPromiseAdapter::SavePromise(std::unique_ptr<CdmPromise> promise) {
DCHECK(thread_checker_.CalledOnValidThread());
uint32_t promise_id = next_promise_id_++;
promises_.add(promise_id, std::move(promise));
@@ -29,7 +29,7 @@ uint32_t CdmPromiseAdapter::SavePromise(scoped_ptr<CdmPromise> promise) {
template <typename... T>
void CdmPromiseAdapter::ResolvePromise(uint32_t promise_id,
const T&... result) {
- scoped_ptr<CdmPromise> promise = TakePromise(promise_id);
+ std::unique_ptr<CdmPromise> promise = TakePromise(promise_id);
if (!promise) {
NOTREACHED() << "Promise not found for " << promise_id;
return;
@@ -50,7 +50,7 @@ void CdmPromiseAdapter::RejectPromise(uint32_t promise_id,
MediaKeys::Exception exception_code,
uint32_t system_code,
const std::string& error_message) {
- scoped_ptr<CdmPromise> promise = TakePromise(promise_id);
+ std::unique_ptr<CdmPromise> promise = TakePromise(promise_id);
if (!promise) {
NOTREACHED() << "No promise found for promise_id " << promise_id;
return;
@@ -67,7 +67,8 @@ void CdmPromiseAdapter::Clear() {
promises_.clear();
}
-scoped_ptr<CdmPromise> CdmPromiseAdapter::TakePromise(uint32_t promise_id) {
+std::unique_ptr<CdmPromise> CdmPromiseAdapter::TakePromise(
+ uint32_t promise_id) {
DCHECK(thread_checker_.CalledOnValidThread());
PromiseMap::iterator it = promises_.find(promise_id);
if (it == promises_.end())

Powered by Google App Engine
This is Rietveld 408576698