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

Side by Side Diff: remoting/host/setup/host_starter.cc

Issue 2253233004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/host/setup/host_starter.h" 5 #include "remoting/host/setup/host_starter.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 25 matching lines...) Expand all
36 weak_ptr_ = weak_ptr_factory_.GetWeakPtr(); 36 weak_ptr_ = weak_ptr_factory_.GetWeakPtr();
37 main_task_runner_ = base::ThreadTaskRunnerHandle::Get(); 37 main_task_runner_ = base::ThreadTaskRunnerHandle::Get();
38 } 38 }
39 39
40 HostStarter::~HostStarter() {} 40 HostStarter::~HostStarter() {}
41 41
42 std::unique_ptr<HostStarter> HostStarter::Create( 42 std::unique_ptr<HostStarter> HostStarter::Create(
43 const std::string& chromoting_hosts_url, 43 const std::string& chromoting_hosts_url,
44 net::URLRequestContextGetter* url_request_context_getter) { 44 net::URLRequestContextGetter* url_request_context_getter) {
45 return base::WrapUnique(new HostStarter( 45 return base::WrapUnique(new HostStarter(
46 base::WrapUnique(new gaia::GaiaOAuthClient(url_request_context_getter)), 46 base::MakeUnique<gaia::GaiaOAuthClient>(url_request_context_getter),
47 base::WrapUnique(new remoting::ServiceClient(chromoting_hosts_url, 47 base::MakeUnique<remoting::ServiceClient>(chromoting_hosts_url,
48 url_request_context_getter)), 48 url_request_context_getter),
49 remoting::DaemonController::Create())); 49 remoting::DaemonController::Create()));
50 } 50 }
51 51
52 void HostStarter::StartHost( 52 void HostStarter::StartHost(
53 const std::string& host_name, 53 const std::string& host_name,
54 const std::string& host_pin, 54 const std::string& host_pin,
55 bool consent_to_data_collection, 55 bool consent_to_data_collection,
56 const std::string& auth_code, 56 const std::string& auth_code,
57 const std::string& redirect_url, 57 const std::string& redirect_url,
58 CompletionCallback on_done) { 58 CompletionCallback on_done) {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void HostStarter::OnHostUnregistered() { 217 void HostStarter::OnHostUnregistered() {
218 if (!main_task_runner_->BelongsToCurrentThread()) { 218 if (!main_task_runner_->BelongsToCurrentThread()) {
219 main_task_runner_->PostTask(FROM_HERE, base::Bind( 219 main_task_runner_->PostTask(FROM_HERE, base::Bind(
220 &HostStarter::OnHostUnregistered, weak_ptr_)); 220 &HostStarter::OnHostUnregistered, weak_ptr_));
221 return; 221 return;
222 } 222 }
223 base::ResetAndReturn(&on_done_).Run(START_ERROR); 223 base::ResetAndReturn(&on_done_).Run(START_ERROR);
224 } 224 }
225 225
226 } // namespace remoting 226 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/host/setup/me2me_native_messaging_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698