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

Unified Diff: chrome/browser/chromeos/login/signed_settings_helper.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_helper.h
diff --git a/chrome/browser/chromeos/login/signed_settings_helper.h b/chrome/browser/chromeos/login/signed_settings_helper.h
index 61ed87345c3bb2573e9f3f3e0b3a7822871cdd88..a46a2bd33b26f28ab39cbfbeb43047d694ff683f 100644
--- a/chrome/browser/chromeos/login/signed_settings_helper.h
+++ b/chrome/browser/chromeos/login/signed_settings_helper.h
@@ -26,45 +26,19 @@ class SignedSettings;
// and handle callbacks destruction before ops completion.
class SignedSettingsHelper {
public:
- class Callback {
- public:
- // Callback of StorePropertyOp.
- virtual void OnStorePropertyCompleted(
- SignedSettings::ReturnCode code,
- const std::string& name,
- const base::Value& value) {}
-
- // Callback of RetrievePropertyOp.
- virtual void OnRetrievePropertyCompleted(
- SignedSettings::ReturnCode code,
- const std::string& name,
- const base::Value* value) {}
-
- // Callback of StorePolicyOp.
- virtual void OnStorePolicyCompleted(
- SignedSettings::ReturnCode code) {}
-
- // Callback of RetrievePolicyOp.
- virtual void OnRetrievePolicyCompleted(
- SignedSettings::ReturnCode code,
- const em::PolicyFetchResponse& policy) {}
- };
+ typedef base::Callback<void(SignedSettings::ReturnCode)> StorePolicyCallback;
+ typedef base::Callback<void(SignedSettings::ReturnCode,
+ const em::PolicyFetchResponse&)> RetrievePolicyCallback;
// Class factory
static SignedSettingsHelper* Get();
// Functions to start signed settings ops.
- virtual void StartStorePropertyOp(const std::string& name,
- const base::Value& value,
- Callback* callback) = 0;
- virtual void StartRetrieveProperty(const std::string& name,
- Callback* callback) = 0;
- virtual void StartStorePolicyOp(const em::PolicyFetchResponse& policy,
- Callback* callback) = 0;
- virtual void StartRetrievePolicyOp(Callback* callback) = 0;
-
- // Cancels all pending calls of given callback.
- virtual void CancelCallback(Callback* callback) = 0;
+ virtual void StartStorePolicyOp(
+ const em::PolicyFetchResponse& policy,
+ StorePolicyCallback callback) = 0;
+ virtual void StartRetrievePolicyOp(
+ RetrievePolicyCallback callback) = 0;
class TestDelegate {
public:

Powered by Google App Engine
This is Rietveld 408576698