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

Unified Diff: chrome/browser/services/gcm/gcm_account_tracker.h

Issue 710903002: Revert of [GCM] Fetching OAuth2 tokens periodically in account tracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mapper-in-driver
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/services/gcm/gcm_account_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/services/gcm/gcm_account_tracker.h
diff --git a/chrome/browser/services/gcm/gcm_account_tracker.h b/chrome/browser/services/gcm/gcm_account_tracker.h
index 39f357e34c6904765974d8f42a65d5f6aa870e29..0b1c5e81f32cb42623ea79a8667de59f666ee05c 100644
--- a/chrome/browser/services/gcm/gcm_account_tracker.h
+++ b/chrome/browser/services/gcm/gcm_account_tracker.h
@@ -14,21 +14,12 @@
#include "google_apis/gaia/account_tracker.h"
#include "google_apis/gaia/oauth2_token_service.h"
-namespace base {
-class Time;
-}
-
namespace gcm {
class GCMDriver;
// Class for reporting back which accounts are signed into. It is only meant to
// be used when the user is signed into sync.
-//
-// This class makes a check for tokens periodically, to make sure the user is
-// still logged into the profile, so that in the case that the user is not, we
-// can immediately report that to the GCM and stop messages addressed to that
-// user from ever reaching Chrome.
class GCMAccountTracker : public gaia::AccountTracker::Observer,
public OAuth2TokenService::Consumer,
public GCMConnectionObserver {
@@ -85,8 +76,6 @@
}
private:
- friend class GCMAccountTrackerTest;
-
// Maps account keys to account states. Keyed by account_ids as used by
// OAuth2TokenService.
typedef std::map<std::string, AccountInfo> AccountInfos;
@@ -108,22 +97,13 @@
void OnConnected(const net::IPEndPoint& ip_endpoint) override;
void OnDisconnected() override;
- // Schedules token reporting.
- void ScheduleReportTokens();
// Report the list of accounts with OAuth2 tokens back using the |callback_|
// function. If there are token requests in progress, do nothing.
- void ReportTokens();
+ void CompleteCollectingTokens();
// Verify that all of the tokens are ready to be passed down to the GCM
// Driver, e.g. none of them has expired or is missing. Returns true if not
// all tokens are valid and a fetching yet more tokens is required.
- void SanitizeTokens();
- // Indicates whether token reporting is required, either because it is due, or
- // some of the accounts were removed.
- bool IsTokenReportingRequired() const;
- // Indicates whether there are tokens that still need fetching.
- bool IsTokenFetchingRequired() const;
- // Gets the time until next token reporting.
- base::TimeDelta GetTimeToNextTokenReporting() const;
+ bool SanitizeTokens();
// Deletes a token request. Should be called from OnGetTokenSuccess(..) or
// OnGetTokenFailure(..).
void DeleteTokenRequest(const OAuth2TokenService::Request* request);
@@ -153,10 +133,6 @@
ScopedVector<OAuth2TokenService::Request> pending_token_requests_;
- // Creates weak pointers used to postpone reporting tokens. See
- // ScheduleReportTokens.
- base::WeakPtrFactory<GCMAccountTracker> reporting_weak_ptr_factory_;
-
DISALLOW_COPY_AND_ASSIGN(GCMAccountTracker);
};
« no previous file with comments | « no previous file | chrome/browser/services/gcm/gcm_account_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698