Commit 0f1cc17c authored by codeimpl's avatar codeimpl Committed by Commit Bot

std::make_unique should be preferred than base::WrapUnique in Payments.

std::make_unique<Type>(...) and base::WrapUnique<new Type(...)) are
equivalent but std::make_unique should be preferred, because it is
harder to use unsafely than base::WrapUnique.

Ref:
 https://www.chromium.org/developers/coding-style/cpp-dos-and-donts#TOC-Prefer-MakeUnique-to-WrapUnique

Bug: None
Change-Id: I0e13e0fa0088e3f9adcbcbbee341eea04a3f2307
Reviewed-on: https://chromium-review.googlesource.com/1034048Reviewed-by: default avatarJinho Bang <jinho.bang@samsung.com>
Commit-Queue: Jinho Bang <jinho.bang@samsung.com>
Cr-Commit-Position: refs/heads/master@{#554793}
parent b4314c2c
......@@ -7,7 +7,6 @@
#include <utility>
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "content/browser/payments/payment_manager.h"
......@@ -82,9 +81,9 @@ void PaymentAppContextImpl::CreatePaymentAppDatabaseOnIO(
void PaymentAppContextImpl::CreatePaymentManagerOnIO(
mojo::InterfaceRequest<payments::mojom::PaymentManager> request) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
PaymentManager* payment_manager =
new PaymentManager(this, std::move(request));
payment_managers_[payment_manager] = base::WrapUnique(payment_manager);
auto payment_manager =
std::make_unique<PaymentManager>(this, std::move(request));
payment_managers_[payment_manager.get()] = std::move(payment_manager);
}
void PaymentAppContextImpl::ShutdownOnIO() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment