replace base::MakeUnique with std::make_unique

This commit is contained in:
Shelley Vohr 2018-04-12 08:48:32 -04:00
parent 97fb15ac49
commit b05932310b
No known key found for this signature in database
GPG key ID: F13993A75599653C
28 changed files with 50 additions and 50 deletions

View file

@ -602,7 +602,7 @@ void Session::EnableNetworkEmulation(const mate::Dictionary& options) {
}
void Session::DisableNetworkEmulation() {
auto conditions = base::MakeUnique<content::DevToolsNetworkConditions>();
auto conditions = std::make_unique<content::DevToolsNetworkConditions>();
content::DevToolsNetworkController::SetNetworkState(
devtools_network_emulation_client_id_, std::move(conditions));
BrowserThread::PostTask(

View file

@ -49,7 +49,7 @@ void TrackableObjectBase::Destroy() {
void TrackableObjectBase::AttachAsUserData(base::SupportsUserData* wrapped) {
wrapped->SetUserData(kTrackedObjectKey,
base::MakeUnique<IDUserData>(weak_map_id_));
std::make_unique<IDUserData>(weak_map_id_));
}
// static

View file

@ -111,7 +111,7 @@ AtomBrowserContext::RegisterCookieChangeCallback(
std::unique_ptr<net::NetworkDelegate>
AtomBrowserContext::CreateNetworkDelegate() {
return base::MakeUnique<AtomNetworkDelegate>();
return std::make_unique<AtomNetworkDelegate>();
}
std::string AtomBrowserContext::GetUserAgent() {

View file

@ -162,7 +162,7 @@ int AtomPermissionManager::RequestPermissionsWithDetails(
auto web_contents =
content::WebContents::FromRenderFrameHost(render_frame_host);
int request_id = pending_requests_.Add(base::MakeUnique<PendingRequest>(
int request_id = pending_requests_.Add(std::make_unique<PendingRequest>(
render_frame_host, permissions, response_callback));
for (size_t i = 0; i < permissions.size(); ++i) {

View file

@ -186,7 +186,7 @@ void CommonWebContentsDelegate::SetOwnerWindow(NativeWindow* owner_window) {
void CommonWebContentsDelegate::SetOwnerWindow(
content::WebContents* web_contents, NativeWindow* owner_window) {
owner_window_ = owner_window ? owner_window->GetWeakPtr() : nullptr;
auto relay = base::MakeUnique<NativeWindowRelay>(owner_window_);
auto relay = std::make_unique<NativeWindowRelay>(owner_window_);
auto relay_key = relay->key;
if (owner_window) {
#if defined(TOOLKIT_VIEWS)
@ -397,7 +397,7 @@ void CommonWebContentsDelegate::DevToolsAddFileSystem(
auto pref_service = GetPrefService(GetDevToolsWebContents());
DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
update.Get()->SetWithoutPathExpansion(
path.AsUTF8Unsafe(), base::MakeUnique<base::Value>());
path.AsUTF8Unsafe(), std::make_unique<base::Value>());
web_contents_->CallClientFunction("DevToolsAPI.fileSystemAdded",
file_system_value.get(),

View file

@ -46,14 +46,14 @@ std::unique_ptr<base::ListValue> NSArrayToListValue(NSArray* arr) {
if (sub_arr)
result->Append(std::move(sub_arr));
else
result->Append(base::MakeUnique<base::Value>());
result->Append(std::make_unique<base::Value>());
} else if ([value isKindOfClass:[NSDictionary class]]) {
std::unique_ptr<base::DictionaryValue> sub_dict =
NSDictionaryToDictionaryValue(value);
if (sub_dict)
result->Append(std::move(sub_dict));
else
result->Append(base::MakeUnique<base::Value>());
result->Append(std::make_unique<base::Value>());
} else {
result->AppendString(base::SysNSStringToUTF8([value description]));
}
@ -104,7 +104,7 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
result->SetWithoutPathExpansion(str_key, std::move(sub_arr));
else
result->SetWithoutPathExpansion(str_key,
base::MakeUnique<base::Value>());
std::make_unique<base::Value>());
} else if ([value isKindOfClass:[NSDictionary class]]) {
std::unique_ptr<base::DictionaryValue> sub_dict =
NSDictionaryToDictionaryValue(value);
@ -112,7 +112,7 @@ std::unique_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
result->SetWithoutPathExpansion(str_key, std::move(sub_dict));
else
result->SetWithoutPathExpansion(str_key,
base::MakeUnique<base::Value>());
std::make_unique<base::Value>());
} else {
result->SetKey(str_key,
base::Value(base::SysNSStringToUTF8([value description])));

View file

@ -177,7 +177,7 @@ int AtomCertVerifier::Verify(
if (!request) {
out_req->reset();
std::unique_ptr<CertVerifierRequest> new_request =
base::MakeUnique<CertVerifierRequest>(params, this);
std::make_unique<CertVerifierRequest>(params, this);
new_request->Start(crl_set, net_log);
request = new_request.get();
*out_req = std::move(new_request);

View file

@ -290,7 +290,7 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
DCHECK(render_widget_host_);
bool is_guest_view_hack = parent_host_view_ != nullptr;
#if !defined(OS_MACOSX)
delegated_frame_host_ = base::MakeUnique<content::DelegatedFrameHost>(
delegated_frame_host_ = std::make_unique<content::DelegatedFrameHost>(
AllocateFrameSinkId(is_guest_view_hack), this,
false /* enable_surface_synchronization */);
@ -788,7 +788,7 @@ std::unique_ptr<content::CompositorResizeLock>
OffScreenRenderWidgetHostView::DelegatedFrameHostCreateResizeLock() {
HoldResize();
const gfx::Size& desired_size = GetRootLayer()->bounds().size();
return base::MakeUnique<content::CompositorResizeLock>(this, desired_size);
return std::make_unique<content::CompositorResizeLock>(this, desired_size);
}
viz::LocalSurfaceId OffScreenRenderWidgetHostView::GetLocalSurfaceId() const {
@ -897,7 +897,7 @@ void OffScreenRenderWidgetHostView::ProxyViewDestroyed(
void OffScreenRenderWidgetHostView::RegisterGuestViewFrameSwappedCallback(
content::RenderWidgetHostViewGuest* guest_host_view) {
guest_host_view->RegisterFrameSwappedCallback(base::MakeUnique<base::Closure>(
guest_host_view->RegisterFrameSwappedCallback(std::make_unique<base::Closure>(
base::Bind(&OffScreenRenderWidgetHostView::OnGuestViewFrameSwapped,
weak_ptr_factory_.GetWeakPtr(),
base::Unretained(guest_host_view))));

View file

@ -45,7 +45,7 @@ void CreateResponseHeadersDictionary(const net::HttpResponseHeaders* headers,
void PopulateStreamInfo(base::DictionaryValue* stream_info,
content::StreamInfo* stream,
const std::string& original_url) {
auto headers_dict = base::MakeUnique<base::DictionaryValue>();
auto headers_dict = std::make_unique<base::DictionaryValue>();
auto stream_url = stream->handle->GetURL().spec();
CreateResponseHeadersDictionary(stream->response_headers.get(),
headers_dict.get());
@ -66,7 +66,7 @@ PdfViewerHandler::~PdfViewerHandler() {
void PdfViewerHandler::SetPdfResourceStream(content::StreamInfo* stream) {
stream_ = stream;
if (!!initialize_callback_id_.get()) {
auto list = base::MakeUnique<base::ListValue>();
auto list = std::make_unique<base::ListValue>();
list->Set(0, std::move(initialize_callback_id_));
Initialize(list.get());
}
@ -109,7 +109,7 @@ void PdfViewerHandler::Initialize(const base::ListValue* args) {
CHECK(!initialize_callback_id_.get());
AllowJavascript();
auto stream_info = base::MakeUnique<base::DictionaryValue>();
auto stream_info = std::make_unique<base::DictionaryValue>();
PopulateStreamInfo(stream_info.get(), stream_, original_url_);
ResolveJavascriptCallback(*callback_id, *stream_info);
} else {
@ -174,7 +174,7 @@ void PdfViewerHandler::GetStrings(const base::ListValue* args) {
const base::Value* callback_id;
CHECK(args->Get(0, &callback_id));
auto result = base::MakeUnique<base::DictionaryValue>();
auto result = std::make_unique<base::DictionaryValue>();
// TODO(deepak1556): Generate strings from components/pdf_strings.grdp.
#define SET_STRING(id, resource) result->SetString(id, resource)
SET_STRING("passwordPrompt",

View file

@ -145,7 +145,7 @@ class PdfViewerUI::ResourceRequester
content::GetStreamContextForResourceContext(resource_context);
std::unique_ptr<content::ResourceHandler> handler =
base::MakeUnique<content::StreamResourceHandler>(
std::make_unique<content::StreamResourceHandler>(
request.get(), stream_context->registry(), origin, false);
info->set_is_stream(true);
stream_info_.reset(new content::StreamInfo);