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

Side by Side Diff: chrome/browser/signin/token_service.cc

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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 "chrome/browser/signin/token_service.h" 5 #include "chrome/browser/signin/token_service.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 202
203 bool TokenService::AreCredentialsValid() const { 203 bool TokenService::AreCredentialsValid() const {
204 return !credentials_.lsid.empty() && !credentials_.sid.empty(); 204 return !credentials_.lsid.empty() && !credentials_.sid.empty();
205 } 205 }
206 206
207 void TokenService::StartFetchingTokens() { 207 void TokenService::StartFetchingTokens() {
208 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 208 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
209 DCHECK(AreCredentialsValid()); 209 DCHECK(AreCredentialsValid());
210 for (size_t i = 0; i < arraysize(kServices); i++) { 210 for (size_t i = 0; i < arraysize(kServices); i++) {
211 fetchers_[i].reset(new GaiaAuthFetcher(this, source_, getter_)); 211 fetchers_[i].reset(new GaiaAuthFetcher(this, source_, getter_.get()));
212 fetchers_[i]->StartIssueAuthToken(credentials_.sid, 212 fetchers_[i]->StartIssueAuthToken(credentials_.sid,
213 credentials_.lsid, 213 credentials_.lsid,
214 kServices[i]); 214 kServices[i]);
215 } 215 }
216 } 216 }
217 217
218 // Services dependent on a token will check if a token is available. 218 // Services dependent on a token will check if a token is available.
219 // If it isn't, they'll go to sleep until they get a token event. 219 // If it isn't, they'll go to sleep until they get a token event.
220 bool TokenService::HasTokenForService(const char* service) const { 220 bool TokenService::HasTokenForService(const char* service) const {
221 return token_map_.count(service) > 0; 221 return token_map_.count(service) > 0;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 if (!in_memory_tokens->count(service) && db_tokens.count(service)) { 427 if (!in_memory_tokens->count(service) && db_tokens.count(service)) {
428 std::string db_token = db_tokens.find(service)->second; 428 std::string db_token = db_tokens.find(service)->second;
429 if (!db_token.empty()) { 429 if (!db_token.empty()) {
430 VLOG(1) << "Loading " << service << " token from DB: " << db_token; 430 VLOG(1) << "Loading " << service << " token from DB: " << db_token;
431 (*in_memory_tokens)[service] = db_token; 431 (*in_memory_tokens)[service] = db_token;
432 FireTokenAvailableNotification(service, db_token); 432 FireTokenAvailableNotification(service, db_token);
433 // Failures are only for network errors. 433 // Failures are only for network errors.
434 } 434 }
435 } 435 }
436 } 436 }
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url_service_unittest.cc ('k') | chrome/browser/ssl/ssl_add_cert_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698