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

Side by Side Diff: google_apis/drive/auth_service.cc

Issue 498123003: Remove implicit conversions from scoped_refptr to T* in google_apis/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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
« no previous file with comments | « no previous file | google_apis/drive/request_sender.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "google_apis/drive/auth_service.h" 5 #include "google_apis/drive/auth_service.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 DCHECK(thread_checker_.CalledOnValidThread()); 142 DCHECK(thread_checker_.CalledOnValidThread());
143 143
144 if (HasAccessToken()) { 144 if (HasAccessToken()) {
145 // We already have access token. Give it back to the caller asynchronously. 145 // We already have access token. Give it back to the caller asynchronously.
146 base::MessageLoop::current()->PostTask( 146 base::MessageLoop::current()->PostTask(
147 FROM_HERE, base::Bind(callback, HTTP_SUCCESS, access_token_)); 147 FROM_HERE, base::Bind(callback, HTTP_SUCCESS, access_token_));
148 } else if (HasRefreshToken()) { 148 } else if (HasRefreshToken()) {
149 // We have refresh token, let's get an access token. 149 // We have refresh token, let's get an access token.
150 new AuthRequest(oauth2_token_service_, 150 new AuthRequest(oauth2_token_service_,
151 account_id_, 151 account_id_,
152 url_request_context_getter_, 152 url_request_context_getter_.get(),
153 base::Bind(&AuthService::OnAuthCompleted, 153 base::Bind(&AuthService::OnAuthCompleted,
154 weak_ptr_factory_.GetWeakPtr(), 154 weak_ptr_factory_.GetWeakPtr(),
155 callback), 155 callback),
156 scopes_); 156 scopes_);
157 } else { 157 } else {
158 base::MessageLoop::current()->PostTask( 158 base::MessageLoop::current()->PostTask(
159 FROM_HERE, base::Bind(callback, GDATA_NOT_READY, std::string())); 159 FROM_HERE, base::Bind(callback, GDATA_NOT_READY, std::string()));
160 } 160 }
161 } 161 }
162 162
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 void AuthService::OnHandleRefreshToken(bool has_refresh_token) { 223 void AuthService::OnHandleRefreshToken(bool has_refresh_token) {
224 access_token_.clear(); 224 access_token_.clear();
225 has_refresh_token_ = has_refresh_token; 225 has_refresh_token_ = has_refresh_token;
226 226
227 FOR_EACH_OBSERVER(AuthServiceObserver, 227 FOR_EACH_OBSERVER(AuthServiceObserver,
228 observers_, 228 observers_,
229 OnOAuth2RefreshTokenChanged()); 229 OnOAuth2RefreshTokenChanged());
230 } 230 }
231 231
232 } // namespace google_apis 232 } // namespace google_apis
OLDNEW
« no previous file with comments | « no previous file | google_apis/drive/request_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698