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

Side by Side Diff: google_apis/gaia/fake_oauth2_token_service.cc

Issue 2685123002: Make OAuth2TokenService and subclasses take delegate by unique_ptr (Closed)
Patch Set: Created 3 years, 10 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 "google_apis/gaia/fake_oauth2_token_service.h" 5 #include "google_apis/gaia/fake_oauth2_token_service.h"
6 6
7 #include "base/memory/ptr_util.h"
8
7 FakeOAuth2TokenService::PendingRequest::PendingRequest() { 9 FakeOAuth2TokenService::PendingRequest::PendingRequest() {
8 } 10 }
9 11
10 FakeOAuth2TokenService::PendingRequest::PendingRequest( 12 FakeOAuth2TokenService::PendingRequest::PendingRequest(
11 const PendingRequest& other) = default; 13 const PendingRequest& other) = default;
12 14
13 FakeOAuth2TokenService::PendingRequest::~PendingRequest() { 15 FakeOAuth2TokenService::PendingRequest::~PendingRequest() {
14 } 16 }
15 17
16 FakeOAuth2TokenService::FakeOAuth2TokenService() 18 FakeOAuth2TokenService::FakeOAuth2TokenService()
17 : OAuth2TokenService(new FakeOAuth2TokenServiceDelegate(nullptr)) { 19 : OAuth2TokenService(
18 } 20 base::MakeUnique<FakeOAuth2TokenServiceDelegate>(nullptr)) {}
19 21
20 FakeOAuth2TokenService::~FakeOAuth2TokenService() { 22 FakeOAuth2TokenService::~FakeOAuth2TokenService() {
21 } 23 }
22 24
23 void FakeOAuth2TokenService::FetchOAuth2Token( 25 void FakeOAuth2TokenService::FetchOAuth2Token(
24 RequestImpl* request, 26 RequestImpl* request,
25 const std::string& account_id, 27 const std::string& account_id,
26 net::URLRequestContextGetter* getter, 28 net::URLRequestContextGetter* getter,
27 const std::string& client_id, 29 const std::string& client_id,
28 const std::string& client_secret, 30 const std::string& client_secret,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 if (it->request && (account_id == it->account_id)) { 84 if (it->request && (account_id == it->account_id)) {
83 it->request->InformConsumer(auth_error, std::string(), base::Time()); 85 it->request->InformConsumer(auth_error, std::string(), base::Time());
84 } 86 }
85 } 87 }
86 } 88 }
87 89
88 FakeOAuth2TokenServiceDelegate* 90 FakeOAuth2TokenServiceDelegate*
89 FakeOAuth2TokenService::GetFakeOAuth2TokenServiceDelegate() { 91 FakeOAuth2TokenService::GetFakeOAuth2TokenServiceDelegate() {
90 return static_cast<FakeOAuth2TokenServiceDelegate*>(GetDelegate()); 92 return static_cast<FakeOAuth2TokenServiceDelegate*>(GetDelegate());
91 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698