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

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 1143323005: Refactor AO2TS to make it easier to componentize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address final comments Created 5 years, 5 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 "chrome/browser/sync/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after
2131 if (access_token_request_ != NULL) 2131 if (access_token_request_ != NULL)
2132 return; 2132 return;
2133 request_access_token_retry_timer_.Stop(); 2133 request_access_token_retry_timer_.Stop();
2134 OAuth2TokenService::ScopeSet oauth2_scopes; 2134 OAuth2TokenService::ScopeSet oauth2_scopes;
2135 oauth2_scopes.insert(signin_->GetSyncScopeToUse()); 2135 oauth2_scopes.insert(signin_->GetSyncScopeToUse());
2136 2136
2137 // Invalidate previous token, otherwise token service will return the same 2137 // Invalidate previous token, otherwise token service will return the same
2138 // token again. 2138 // token again.
2139 const std::string& account_id = signin_->GetAccountIdToUse(); 2139 const std::string& account_id = signin_->GetAccountIdToUse();
2140 if (!access_token_.empty()) { 2140 if (!access_token_.empty()) {
2141 oauth2_token_service_->InvalidateToken( 2141 oauth2_token_service_->InvalidateAccessToken(account_id, oauth2_scopes,
2142 account_id, oauth2_scopes, access_token_); 2142 access_token_);
2143 } 2143 }
2144 2144
2145 access_token_.clear(); 2145 access_token_.clear();
2146 2146
2147 token_request_time_ = base::Time::Now(); 2147 token_request_time_ = base::Time::Now();
2148 token_receive_time_ = base::Time(); 2148 token_receive_time_ = base::Time();
2149 next_token_request_time_ = base::Time(); 2149 next_token_request_time_ = base::Time();
2150 access_token_request_ = 2150 access_token_request_ =
2151 oauth2_token_service_->StartRequest(account_id, oauth2_scopes, this); 2151 oauth2_token_service_->StartRequest(account_id, oauth2_scopes, this);
2152 } 2152 }
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
2773 } else { 2773 } else {
2774 UMA_HISTOGRAM_COUNTS("Sync.MemoryPressureWarningBeforeCleanShutdown", 2774 UMA_HISTOGRAM_COUNTS("Sync.MemoryPressureWarningBeforeCleanShutdown",
2775 warning_received); 2775 warning_received);
2776 } 2776 }
2777 } 2777 }
2778 sync_prefs_.SetMemoryPressureWarningCount(0); 2778 sync_prefs_.SetMemoryPressureWarningCount(0);
2779 // Will set to true during a clean shutdown, so crash or something else will 2779 // Will set to true during a clean shutdown, so crash or something else will
2780 // remain this as false. 2780 // remain this as false.
2781 sync_prefs_.SetCleanShutdown(false); 2781 sync_prefs_.SetCleanShutdown(false);
2782 } 2782 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_auth_provider_unittest.cc ('k') | chrome/browser/sync/startup_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698