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

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

Issue 56113003: Implement new invalidations ack tracking system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More review fixes Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_INVALIDATOR_H_ 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_INVALIDATOR_H_
6 #define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_INVALIDATOR_H_ 6 #define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_INVALIDATOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/threading/thread_checker.h" 14 #include "base/threading/thread_checker.h"
15 #include "chrome/browser/policy/cloud/cloud_policy_core.h" 15 #include "chrome/browser/policy/cloud/cloud_policy_core.h"
16 #include "chrome/browser/policy/cloud/cloud_policy_store.h" 16 #include "chrome/browser/policy/cloud/cloud_policy_store.h"
17 #include "google/cacheinvalidation/include/types.h"
18 #include "sync/internal_api/public/base/invalidation.h"
17 #include "sync/notifier/invalidation_handler.h" 19 #include "sync/notifier/invalidation_handler.h"
18 20
19 namespace base { 21 namespace base {
20 class SequencedTaskRunner; 22 class SequencedTaskRunner;
21 } 23 }
22 24
23 namespace invalidation { 25 namespace invalidation {
24 class InvalidationService; 26 class InvalidationService;
25 } 27 }
26 28
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // The version of the latest invalidation received. This is compared to 160 // The version of the latest invalidation received. This is compared to
159 // the invalidation version of policy stored to determine when the 161 // the invalidation version of policy stored to determine when the
160 // invalidated policy is up-to-date. 162 // invalidated policy is up-to-date.
161 int64 invalidation_version_; 163 int64 invalidation_version_;
162 164
163 // The number of invalidations with unknown version received. Since such 165 // The number of invalidations with unknown version received. Since such
164 // invalidations do not provide a version number, this count is used to set 166 // invalidations do not provide a version number, this count is used to set
165 // invalidation_version_ when such invalidations occur. 167 // invalidation_version_ when such invalidations occur.
166 int unknown_version_invalidation_count_; 168 int unknown_version_invalidation_count_;
167 169
168 // The acknowledgment handle for the current invalidation. 170 // The most up to date invalidation.
169 syncer::AckHandle ack_handle_; 171 scoped_ptr<syncer::Invalidation> invalidation_;
Joao da Silva 2013/11/25 10:11:19 #include "base/memory/scoped_ptr.h"
rlarocque 2013/11/25 21:51:25 Done.
170 172
171 // WeakPtrFactory used to create callbacks to this object. 173 // WeakPtrFactory used to create callbacks to this object.
172 base::WeakPtrFactory<CloudPolicyInvalidator> weak_factory_; 174 base::WeakPtrFactory<CloudPolicyInvalidator> weak_factory_;
173 175
174 // The maximum random delay, in ms, between receiving an invalidation and 176 // The maximum random delay, in ms, between receiving an invalidation and
175 // fetching the new policy. 177 // fetching the new policy.
176 int max_fetch_delay_; 178 int max_fetch_delay_;
177 179
178 // The hash value of the current policy. This is used to determine if a new 180 // The hash value of the current policy. This is used to determine if a new
179 // policy is different from the current one. 181 // policy is different from the current one.
180 uint32 policy_hash_value_; 182 uint32 policy_hash_value_;
181 183
182 // A thread checker to make sure that callbacks are invoked on the correct 184 // A thread checker to make sure that callbacks are invoked on the correct
183 // thread. 185 // thread.
184 base::ThreadChecker thread_checker_; 186 base::ThreadChecker thread_checker_;
185 187
186 DISALLOW_COPY_AND_ASSIGN(CloudPolicyInvalidator); 188 DISALLOW_COPY_AND_ASSIGN(CloudPolicyInvalidator);
187 }; 189 };
188 190
189 } // namespace policy 191 } // namespace policy
190 192
191 #endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_INVALIDATOR_H_ 193 #endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_INVALIDATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698