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

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 roger's comments Created 5 years, 6 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 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 if (access_token_request_ != NULL) 2099 if (access_token_request_ != NULL)
2100 return; 2100 return;
2101 request_access_token_retry_timer_.Stop(); 2101 request_access_token_retry_timer_.Stop();
2102 OAuth2TokenService::ScopeSet oauth2_scopes; 2102 OAuth2TokenService::ScopeSet oauth2_scopes;
2103 oauth2_scopes.insert(signin_->GetSyncScopeToUse()); 2103 oauth2_scopes.insert(signin_->GetSyncScopeToUse());
2104 2104
2105 // Invalidate previous token, otherwise token service will return the same 2105 // Invalidate previous token, otherwise token service will return the same
2106 // token again. 2106 // token again.
2107 const std::string& account_id = signin_->GetAccountIdToUse(); 2107 const std::string& account_id = signin_->GetAccountIdToUse();
2108 if (!access_token_.empty()) { 2108 if (!access_token_.empty()) {
2109 oauth2_token_service_->InvalidateToken( 2109 oauth2_token_service_->InvalidateAccessToken(account_id, oauth2_scopes,
2110 account_id, oauth2_scopes, access_token_); 2110 access_token_);
2111 } 2111 }
2112 2112
2113 access_token_.clear(); 2113 access_token_.clear();
2114 2114
2115 token_request_time_ = base::Time::Now(); 2115 token_request_time_ = base::Time::Now();
2116 token_receive_time_ = base::Time(); 2116 token_receive_time_ = base::Time();
2117 next_token_request_time_ = base::Time(); 2117 next_token_request_time_ = base::Time();
2118 access_token_request_ = 2118 access_token_request_ =
2119 oauth2_token_service_->StartRequest(account_id, oauth2_scopes, this); 2119 oauth2_token_service_->StartRequest(account_id, oauth2_scopes, this);
2120 } 2120 }
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
2713 std::string birthday; 2713 std::string birthday;
2714 syncer::UserShare* user_share = GetUserShare(); 2714 syncer::UserShare* user_share = GetUserShare();
2715 if (user_share && user_share->directory.get()) { 2715 if (user_share && user_share->directory.get()) {
2716 birthday = user_share->directory->store_birthday(); 2716 birthday = user_share->directory->store_birthday();
2717 } 2717 }
2718 if (!access_token_.empty() && !cache_guid.empty() && !birthday.empty()) { 2718 if (!access_token_.empty() && !cache_guid.empty() && !birthday.empty()) {
2719 sync_stopped_reporter_->ReportSyncStopped( 2719 sync_stopped_reporter_->ReportSyncStopped(
2720 access_token_, cache_guid, birthday); 2720 access_token_, cache_guid, birthday);
2721 } 2721 }
2722 } 2722 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698