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

Side by Side Diff: chrome/browser/policy/cloud/cloud_policy_refresh_scheduler.h

Issue 23592017: Fix policy invalidator lifecycle bugs for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 #ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_ 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_
6 #define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_ 6 #define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/cancelable_callback.h" 9 #include "base/cancelable_callback.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // and the request may not be immediately sent. 55 // and the request may not be immediately sent.
56 void RefreshSoon(); 56 void RefreshSoon();
57 57
58 // The refresh scheduler starts by assuming that invalidations are not 58 // The refresh scheduler starts by assuming that invalidations are not
59 // available. This call can be used to signal whether the invalidations 59 // available. This call can be used to signal whether the invalidations
60 // service is available or not, and can be called multiple times. 60 // service is available or not, and can be called multiple times.
61 // When the invalidations service is available then the refresh rate is much 61 // When the invalidations service is available then the refresh rate is much
62 // lower. 62 // lower.
63 void SetInvalidationServiceAvailability(bool is_available); 63 void SetInvalidationServiceAvailability(bool is_available);
64 64
65 // Whether the invalidations service is available and receiving notifications
66 // of policy updates.
67 bool invalidations_available() {
68 return invalidations_available_;
69 }
70
65 // CloudPolicyClient::Observer: 71 // CloudPolicyClient::Observer:
66 virtual void OnPolicyFetched(CloudPolicyClient* client) OVERRIDE; 72 virtual void OnPolicyFetched(CloudPolicyClient* client) OVERRIDE;
67 virtual void OnRegistrationStateChanged(CloudPolicyClient* client) OVERRIDE; 73 virtual void OnRegistrationStateChanged(CloudPolicyClient* client) OVERRIDE;
68 virtual void OnClientError(CloudPolicyClient* client) OVERRIDE; 74 virtual void OnClientError(CloudPolicyClient* client) OVERRIDE;
69 75
70 // CloudPolicyStore::Observer: 76 // CloudPolicyStore::Observer:
71 virtual void OnStoreLoaded(CloudPolicyStore* store) OVERRIDE; 77 virtual void OnStoreLoaded(CloudPolicyStore* store) OVERRIDE;
72 virtual void OnStoreError(CloudPolicyStore* store) OVERRIDE; 78 virtual void OnStoreError(CloudPolicyStore* store) OVERRIDE;
73 79
74 // net::NetworkChangeNotifier::IPAddressObserver: 80 // net::NetworkChangeNotifier::IPAddressObserver:
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // Used to measure how long it took for the invalidations service to report 146 // Used to measure how long it took for the invalidations service to report
141 // its initial status. 147 // its initial status.
142 base::Time creation_time_; 148 base::Time creation_time_;
143 149
144 DISALLOW_COPY_AND_ASSIGN(CloudPolicyRefreshScheduler); 150 DISALLOW_COPY_AND_ASSIGN(CloudPolicyRefreshScheduler);
145 }; 151 };
146 152
147 } // namespace policy 153 } // namespace policy
148 154
149 #endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_ 155 #endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_REFRESH_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698