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

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

Issue 8727037: Signed settings refactoring: Proper caching and more tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT and removed some debug output left. Created 9 years, 1 month 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_cache.h
diff --git a/chrome/browser/chromeos/login/signed_settings_temp_storage.h b/chrome/browser/chromeos/login/signed_settings_cache.h
similarity index 56%
rename from chrome/browser/chromeos/login/signed_settings_temp_storage.h
rename to chrome/browser/chromeos/login/signed_settings_cache.h
index 6633c99366f73a4a066fd1952ca69168c1d76614..f3d046e6e6ba2490e560cdd7bb198c82dc752822 100644
--- a/chrome/browser/chromeos/login/signed_settings_temp_storage.h
+++ b/chrome/browser/chromeos/login/signed_settings_cache.h
@@ -2,14 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_
-#define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_
+#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_CACHE_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_CACHE_H_
#pragma once
#include <string>
#include "base/basictypes.h"
#include "base/values.h"
+#include "chrome/browser/policy/proto/chrome_device_policy.pb.h"
+#include "chrome/browser/policy/proto/device_management_backend.pb.h"
+
+namespace em = enterprise_management;
class PrefService;
@@ -19,27 +23,26 @@ namespace chromeos {
// (that are normally go into SignedSettings storage)
Mattias Nissler (ping if slow) 2011/11/30 11:22:44 s/are//
pastarmovj 2011/11/30 17:21:16 Done.
// before owner has been assigned (hence no key is available).
// This class serves as a transient storage in that case.
-class SignedSettingsTempStorage {
+class SignedSettingsCache {
Mattias Nissler (ping if slow) 2011/11/30 11:22:44 Only statics? Convert to namespace.
pastarmovj 2011/11/30 17:21:16 Done.
public:
// Registers required pref section.
static void RegisterPrefs(PrefService* local_state);
- static bool Store(const std::string& name,
- const base::Value& value,
+ static bool Store(const em::PolicyData &policy,
PrefService* local_state);
- static bool Retrieve(const std::string& name,
- base::Value** value,
+ static bool Retrieve(em::PolicyData *policy,
PrefService* local_state);
// Call this after owner has been assigned to persist settings
// into SignedSettings storage.
- static void Finalize(PrefService* local_state);
+ static void Finalize(PrefService* local_state,
+ const em::PolicyFetchResponse& policy);
private:
- SignedSettingsTempStorage() {}
- DISALLOW_COPY_AND_ASSIGN(SignedSettingsTempStorage);
+ SignedSettingsCache() {}
+ DISALLOW_COPY_AND_ASSIGN(SignedSettingsCache);
};
} // namespace chromeos
-#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_TEMP_STORAGE_H_
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_CACHE_H_

Powered by Google App Engine
This is Rietveld 408576698