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

Side by Side Diff: components/browser_sync/browser/profile_sync_service.cc

Issue 1496573002: Ensure Sync access token is revoked when user is signed out. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | no next file » | 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 "components/browser_sync/browser/profile_sync_service.h" 5 #include "components/browser_sync/browser/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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 tracked_objects::ScopedTracker tracking_profile( 758 tracked_objects::ScopedTracker tracking_profile(
759 FROM_HERE_WITH_EXPLICIT_FUNCTION( 759 FROM_HERE_WITH_EXPLICIT_FUNCTION(
760 "422460 ProfileSyncService::OnRefreshTokenAvailable")); 760 "422460 ProfileSyncService::OnRefreshTokenAvailable"));
761 761
762 if (account_id == signin_->GetAccountIdToUse()) 762 if (account_id == signin_->GetAccountIdToUse())
763 OnRefreshTokensLoaded(); 763 OnRefreshTokensLoaded();
764 } 764 }
765 765
766 void ProfileSyncService::OnRefreshTokenRevoked( 766 void ProfileSyncService::OnRefreshTokenRevoked(
767 const std::string& account_id) { 767 const std::string& account_id) {
768 if (account_id == signin_->GetAccountIdToUse()) { 768 if (account_id == signin_->GetAccountIdToUse() ||
769 !signin_->GetOriginal()->IsAuthenticated()) {
Nicolas Zea 2015/12/02 18:57:35 Is this the right place to fix this? Why isn't the
bzanotti 2015/12/02 22:21:46 Please note that I'm not super familiar with sync
Nicolas Zea 2015/12/02 22:27:54 Yeah, I think that OnGoogleSignedOut should also b
769 access_token_.clear(); 770 access_token_.clear();
770 UpdateAuthErrorState( 771 UpdateAuthErrorState(
771 GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED)); 772 GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED));
772 } 773 }
773 } 774 }
774 775
775 void ProfileSyncService::OnRefreshTokensLoaded() { 776 void ProfileSyncService::OnRefreshTokensLoaded() {
776 // This notification gets fired when OAuth2TokenService loads the tokens 777 // This notification gets fired when OAuth2TokenService loads the tokens
777 // from storage. 778 // from storage.
778 // Initialize the backend if sync is enabled. If the sync token was 779 // Initialize the backend if sync is enabled. If the sync token was
(...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after
2703 } 2704 }
2704 2705
2705 std::string ProfileSyncService::unrecoverable_error_message() const { 2706 std::string ProfileSyncService::unrecoverable_error_message() const {
2706 return unrecoverable_error_message_; 2707 return unrecoverable_error_message_;
2707 } 2708 }
2708 2709
2709 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() 2710 tracked_objects::Location ProfileSyncService::unrecoverable_error_location()
2710 const { 2711 const {
2711 return unrecoverable_error_location_; 2712 return unrecoverable_error_location_;
2712 } 2713 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698