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

Side by Side Diff: chrome/browser/policy/user_policy_cache.h

Issue 9111022: Removed ConfigurationPolicyType and extended PolicyMap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed builds, rebased Created 8 years, 11 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 | Annotate | Revision Log
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_USER_POLICY_CACHE_H_ 5 #ifndef CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_
6 #define CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_ 6 #define CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // UserPolicyDiskCache::Delegate implementation: 54 // UserPolicyDiskCache::Delegate implementation:
55 virtual void OnDiskCacheLoaded( 55 virtual void OnDiskCacheLoaded(
56 UserPolicyDiskCache::LoadResult result, 56 UserPolicyDiskCache::LoadResult result,
57 const enterprise_management::CachedCloudPolicyResponse& 57 const enterprise_management::CachedCloudPolicyResponse&
58 cached_response) OVERRIDE; 58 cached_response) OVERRIDE;
59 59
60 // CloudPolicyCacheBase implementation: 60 // CloudPolicyCacheBase implementation:
61 virtual bool DecodePolicyData( 61 virtual bool DecodePolicyData(
62 const enterprise_management::PolicyData& policy_data, 62 const enterprise_management::PolicyData& policy_data,
63 PolicyMap* mandatory, 63 PolicyMap* policies) OVERRIDE;
64 PolicyMap* recommended) OVERRIDE;
65 64
66 // Checks if this cache is ready, and invokes SetReady() if so. 65 // Checks if this cache is ready, and invokes SetReady() if so.
67 void CheckIfReady(); 66 void CheckIfReady();
68 67
69 // <Old-style policy support> 68 // <Old-style policy support>
70 // The following member functions are needed to support old-style policy and 69 // The following member functions are needed to support old-style policy and
71 // can be removed once all server-side components (CPanel, D3) have been 70 // can be removed once all server-side components (CPanel, D3) have been
72 // migrated to providing the new policy format. 71 // migrated to providing the new policy format.
73
74 // If |mandatory| and |recommended| are both empty, and |policy_data|
75 // contains a field named "repeated GenericNamedValue named_value = 2;",
76 // this field is decoded into |mandatory|.
Mattias Nissler (ping if slow) 2012/01/17 09:52:45 Please keep this comment, updating it to reflect t
Joao da Silva 2012/01/17 13:09:29 Done.
77 void MaybeDecodeOldstylePolicy(const std::string& policy_data, 72 void MaybeDecodeOldstylePolicy(const std::string& policy_data,
78 PolicyMap* mandatory, 73 PolicyMap* policies);
79 PolicyMap* recommended);
80 74
81 Value* DecodeIntegerValue(google::protobuf::int64 value) const; 75 Value* DecodeIntegerValue(google::protobuf::int64 value) const;
82 Value* DecodeValue(const enterprise_management::GenericValue& value) const; 76 Value* DecodeValue(const enterprise_management::GenericValue& value) const;
83 77
84 // </Old-style policy support> 78 // </Old-style policy support>
85 79
86 // Manages the cache file. 80 // Manages the cache file.
87 scoped_refptr<UserPolicyDiskCache> disk_cache_; 81 scoped_refptr<UserPolicyDiskCache> disk_cache_;
88 82
89 // Used for constructing the weak ptr passed to |disk_cache_|. 83 // Used for constructing the weak ptr passed to |disk_cache_|.
90 base::WeakPtrFactory<UserPolicyDiskCache::Delegate> weak_ptr_factory_; 84 base::WeakPtrFactory<UserPolicyDiskCache::Delegate> weak_ptr_factory_;
91 85
92 // True if the disk cache has been loaded. 86 // True if the disk cache has been loaded.
93 bool disk_cache_ready_; 87 bool disk_cache_ready_;
94 88
95 // True if at least one attempt was made to refresh the cache with a freshly 89 // True if at least one attempt was made to refresh the cache with a freshly
96 // fetched policy, or if there is no need to wait for that. 90 // fetched policy, or if there is no need to wait for that.
97 bool fetch_ready_; 91 bool fetch_ready_;
98 92
99 DISALLOW_COPY_AND_ASSIGN(UserPolicyCache); 93 DISALLOW_COPY_AND_ASSIGN(UserPolicyCache);
100 }; 94 };
101 95
102 } // namespace policy 96 } // namespace policy
103 97
104 #endif // CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_ 98 #endif // CHROME_BROWSER_POLICY_USER_POLICY_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698