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

Unified Diff: chrome/browser/chromeos/login/signed_settings.h

Issue 8727037: Signed settings refactoring: Proper caching and more tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Fixed small bugs. Rebased to ToT. Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/signed_settings.h
diff --git a/chrome/browser/chromeos/login/signed_settings.h b/chrome/browser/chromeos/login/signed_settings.h
index 45327cb308b3fdaebe20e2710373041bf0cc876e..18ddf35c9c99a7e4b04b16ce43bcff16a6bef122 100644
--- a/chrome/browser/chromeos/login/signed_settings.h
+++ b/chrome/browser/chromeos/login/signed_settings.h
@@ -14,17 +14,9 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/login/owner_manager.h"
-// There are two categories of operations that can be performed on the
-// Chrome OS owner-signed settings store:
-// 1) doing stuff to the whitelist (adding/removing/checking)
-// 2) Storing/Retrieving arbitrary name=value pairs
+// There are two operations that can be performed on the Chrome OS owner-signed
+// settings store: Storing and Retrieving the policy blob.
//
-// Unfortunately, it is currently a limitation that only one of each
-// category can be in-flight at a time. You can be doing exactly one thing
-// to the whitelist, and exactly one thing to the property store at a time.
-// I've filed an issue on me to remove that restriction.
-// http://code.google.com/p/chromium-os/issues/detail?id=6415
-
// The pattern of use here is that the caller instantiates some
// subclass of SignedSettings by calling one of the create
// methods. Then, call Execute() on this object from the UI
@@ -45,6 +37,8 @@ namespace em = enterprise_management;
namespace chromeos {
class OwnershipService;
+extern const char kDevicePolicyType[];
+
class SignedSettings : public base::RefCountedThreadSafe<SignedSettings>,
public OwnerManager::Delegate {
public:
@@ -66,17 +60,6 @@ class SignedSettings : public base::RefCountedThreadSafe<SignedSettings>,
SignedSettings();
virtual ~SignedSettings();
- // These are both "property" operations, and only one instance of
- // one type can be in flight at a time.
- static SignedSettings* CreateStorePropertyOp(
- const std::string& name,
- const base::Value& value,
- SignedSettings::Delegate<bool>* d);
-
- static SignedSettings* CreateRetrievePropertyOp(
- const std::string& name,
- SignedSettings::Delegate<const base::Value*>* d);
-
// These are both "policy" operations, and only one instance of
// one type can be in flight at a time.
static SignedSettings* CreateStorePolicyOp(
@@ -102,34 +85,12 @@ class SignedSettings : public base::RefCountedThreadSafe<SignedSettings>,
void set_service(OwnershipService* service) { service_ = service; }
- void TryToFetchPolicyAndCallBack();
-
OwnershipService* service_;
private:
friend class SignedSettingsTest;
friend class SignedSettingsHelperTest;
- class Relay
- : public SignedSettings::Delegate<const em::PolicyFetchResponse&> {
- public:
- // |s| must outlive your Relay instance.
- explicit Relay(SignedSettings* s);
- virtual ~Relay();
- // Implementation of SignedSettings::Delegate
- virtual void OnSettingsOpCompleted(
- SignedSettings::ReturnCode code,
- const em::PolicyFetchResponse& value) OVERRIDE;
- private:
- SignedSettings* settings_;
- DISALLOW_COPY_AND_ASSIGN(Relay);
- };
-
- // Format of this string is documented in device_management_backend.proto.
- static const char kDevicePolicyType[];
-
- scoped_ptr<Relay> relay_;
- scoped_refptr<SignedSettings> polfetcher_;
DISALLOW_COPY_AND_ASSIGN(SignedSettings);
};
« no previous file with comments | « chrome/browser/chromeos/login/session_manager_observer.cc ('k') | chrome/browser/chromeos/login/signed_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698