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

Side by Side Diff: chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h

Issue 822523003: Implement device-local account policy pushing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_2_442800_switch_device_cloud_policy_invalidator
Patch Set: Addressed comments. Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INVALIDATOR_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATED_CLOUD_POLICY_INVALIDATOR_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INVALIDATOR_H_ 6 #define CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATED_CLOUD_POLICY_INVALIDATOR_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide r.h" 11 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide r.h"
12 #include "policy/proto/device_management_backend.pb.h"
12 13
13 namespace invalidation { 14 namespace invalidation {
14 class InvalidationService; 15 class InvalidationService;
15 } 16 }
16 17
17 namespace policy { 18 namespace policy {
18 19
20 class CloudPolicyCore;
19 class CloudPolicyInvalidator; 21 class CloudPolicyInvalidator;
20 22
21 // This class manages the lifetime of a device-global |CloudPolicyInvalidator| 23 // This class provides policy invalidations for a |CloudPolicyCore| that wishes
22 // that handles device policy invalidations. It relies on an 24 // to use a shared |InvalidationService| affiliated with the device's enrollment
23 // |AffiliatedInvalidationServiceProvider| to provide it with access to a shared 25 // domain. This is the case e.g. for device policy and device-local account
24 // |InvalidationService| to back the |CloudPolicyInvalidator|. Whenever the 26 // policy.
25 // shared |InvalidationService| changes, the |CloudPolicyInvalidator| destroyed 27 // It relies on an |AffiliatedInvalidationServiceProvider| to provide it with
26 // and re-created. 28 // access to a shared |InvalidationService| to back the
27 class DeviceCloudPolicyInvalidator 29 // |CloudPolicyInvalidator|. Whenever the shared |InvalidationService| changes,
30 // the |CloudPolicyInvalidator| destroyed and re-created.
pneubeck (no reviews) 2015/02/04 10:02:13 comment nit: s/destroyed/is destroyed/
bartfab (slow) 2015/02/04 12:34:51 Done.
31 class AffiliatedCloudPolicyInvalidator
28 : public AffiliatedInvalidationServiceProvider::Consumer { 32 : public AffiliatedInvalidationServiceProvider::Consumer {
29 public: 33 public:
30 explicit DeviceCloudPolicyInvalidator( 34 AffiliatedCloudPolicyInvalidator(
35 enterprise_management::DeviceRegisterRequest::Type type,
36 CloudPolicyCore* core,
31 AffiliatedInvalidationServiceProvider* invalidation_service_provider); 37 AffiliatedInvalidationServiceProvider* invalidation_service_provider);
32 ~DeviceCloudPolicyInvalidator() override; 38 ~AffiliatedCloudPolicyInvalidator() override;
33 39
34 // AffiliatedInvalidationServiceProvider::Consumer: 40 // AffiliatedInvalidationServiceProvider::Consumer:
35 void OnInvalidationServiceSet( 41 void OnInvalidationServiceSet(
36 invalidation::InvalidationService* invalidation_service) override; 42 invalidation::InvalidationService* invalidation_service) override;
37 43
38 CloudPolicyInvalidator* GetInvalidatorForTest() const; 44 CloudPolicyInvalidator* GetInvalidatorForTest() const;
39 45
40 private: 46 private:
41 // Create a |CloudPolicyInvalidator| backed by the |invalidation_service|. 47 // Create a |CloudPolicyInvalidator| backed by the |invalidation_service|.
42 void CreateInvalidator( 48 void CreateInvalidator(
43 invalidation::InvalidationService* invalidation_service); 49 invalidation::InvalidationService* invalidation_service);
44 50
45 // Destroy the current |CloudPolicyInvalidator|, if any. 51 // Destroy the current |CloudPolicyInvalidator|, if any.
46 void DestroyInvalidator(); 52 void DestroyInvalidator();
47 53
54 enterprise_management::DeviceRegisterRequest::Type type_;
55 CloudPolicyCore* core_;
56
48 AffiliatedInvalidationServiceProvider* invalidation_service_provider_; 57 AffiliatedInvalidationServiceProvider* invalidation_service_provider_;
49 58
50 // The highest invalidation version that was handled already. 59 // The highest invalidation version that was handled already.
51 int64 highest_handled_invalidation_version_; 60 int64 highest_handled_invalidation_version_;
52 61
53 // The current |CloudPolicyInvalidator|. nullptr if no connected invalidation 62 // The current |CloudPolicyInvalidator|. nullptr if no connected invalidation
54 // service is available. 63 // service is available.
55 scoped_ptr<CloudPolicyInvalidator> invalidator_; 64 scoped_ptr<CloudPolicyInvalidator> invalidator_;
56 65
57 DISALLOW_COPY_AND_ASSIGN(DeviceCloudPolicyInvalidator); 66 DISALLOW_COPY_AND_ASSIGN(AffiliatedCloudPolicyInvalidator);
58 }; 67 };
59 68
60 } // namespace policy 69 } // namespace policy
61 70
62 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_CLOUD_POLICY_INVALIDATOR_H_ 71 #endif // CHROME_BROWSER_CHROMEOS_POLICY_AFFILIATED_CLOUD_POLICY_INVALIDATOR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698