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

Side by Side Diff: components/proximity_auth/cryptauth/cryptauth_client_impl.cc

Issue 1912433002: Convert //components/proximity_auth from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits 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 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 "components/proximity_auth/cryptauth/cryptauth_client_impl.h" 5 #include "components/proximity_auth/cryptauth/cryptauth_client_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/memory/ptr_util.h"
11 #include "components/proximity_auth/cryptauth/cryptauth_access_token_fetcher_imp l.h" 12 #include "components/proximity_auth/cryptauth/cryptauth_access_token_fetcher_imp l.h"
12 #include "components/proximity_auth/cryptauth/switches.h" 13 #include "components/proximity_auth/cryptauth/switches.h"
13 14
14 namespace proximity_auth { 15 namespace proximity_auth {
15 16
16 namespace { 17 namespace {
17 18
18 // Default URL of Google APIs endpoint hosting CryptAuth. 19 // Default URL of Google APIs endpoint hosting CryptAuth.
19 const char kDefaultCryptAuthHTTPHost[] = "https://www.googleapis.com"; 20 const char kDefaultCryptAuthHTTPHost[] = "https://www.googleapis.com";
20 21
(...skipping 20 matching lines...) Expand all
41 GURL(command_line->HasSwitch(switches::kCryptAuthHTTPHost) 42 GURL(command_line->HasSwitch(switches::kCryptAuthHTTPHost)
42 ? command_line->GetSwitchValueASCII(switches::kCryptAuthHTTPHost) 43 ? command_line->GetSwitchValueASCII(switches::kCryptAuthHTTPHost)
43 : kDefaultCryptAuthHTTPHost); 44 : kDefaultCryptAuthHTTPHost);
44 return google_apis_url.Resolve(kCryptAuthPath + request_path + 45 return google_apis_url.Resolve(kCryptAuthPath + request_path +
45 kQueryProtobuf); 46 kQueryProtobuf);
46 } 47 }
47 48
48 } // namespace 49 } // namespace
49 50
50 CryptAuthClientImpl::CryptAuthClientImpl( 51 CryptAuthClientImpl::CryptAuthClientImpl(
51 scoped_ptr<CryptAuthApiCallFlow> api_call_flow, 52 std::unique_ptr<CryptAuthApiCallFlow> api_call_flow,
52 scoped_ptr<CryptAuthAccessTokenFetcher> access_token_fetcher, 53 std::unique_ptr<CryptAuthAccessTokenFetcher> access_token_fetcher,
53 scoped_refptr<net::URLRequestContextGetter> url_request_context, 54 scoped_refptr<net::URLRequestContextGetter> url_request_context,
54 const cryptauth::DeviceClassifier& device_classifier) 55 const cryptauth::DeviceClassifier& device_classifier)
55 : api_call_flow_(std::move(api_call_flow)), 56 : api_call_flow_(std::move(api_call_flow)),
56 access_token_fetcher_(std::move(access_token_fetcher)), 57 access_token_fetcher_(std::move(access_token_fetcher)),
57 url_request_context_(url_request_context), 58 url_request_context_(url_request_context),
58 device_classifier_(device_classifier), 59 device_classifier_(device_classifier),
59 has_call_started_(false), 60 has_call_started_(false),
60 weak_ptr_factory_(this) {} 61 weak_ptr_factory_(this) {}
61 62
62 CryptAuthClientImpl::~CryptAuthClientImpl() { 63 CryptAuthClientImpl::~CryptAuthClientImpl() {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 const cryptauth::DeviceClassifier& device_classifier) 185 const cryptauth::DeviceClassifier& device_classifier)
185 : token_service_(token_service), 186 : token_service_(token_service),
186 account_id_(account_id), 187 account_id_(account_id),
187 url_request_context_(url_request_context), 188 url_request_context_(url_request_context),
188 device_classifier_(device_classifier) { 189 device_classifier_(device_classifier) {
189 } 190 }
190 191
191 CryptAuthClientFactoryImpl::~CryptAuthClientFactoryImpl() { 192 CryptAuthClientFactoryImpl::~CryptAuthClientFactoryImpl() {
192 } 193 }
193 194
194 scoped_ptr<CryptAuthClient> CryptAuthClientFactoryImpl::CreateInstance() { 195 std::unique_ptr<CryptAuthClient> CryptAuthClientFactoryImpl::CreateInstance() {
195 return make_scoped_ptr(new CryptAuthClientImpl( 196 return base::WrapUnique(new CryptAuthClientImpl(
196 make_scoped_ptr(new CryptAuthApiCallFlow()), 197 base::WrapUnique(new CryptAuthApiCallFlow()),
197 make_scoped_ptr( 198 base::WrapUnique(
198 new CryptAuthAccessTokenFetcherImpl(token_service_, account_id_)), 199 new CryptAuthAccessTokenFetcherImpl(token_service_, account_id_)),
199 url_request_context_, device_classifier_)); 200 url_request_context_, device_classifier_));
200 } 201 }
201 202
202 } // proximity_auth 203 } // proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698