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

Unified Diff: chrome/service/service_process_prefs.cc

Issue 11232048: Adding XMPP ping functionality to CLoudPrint. XMPP ping and timeout is controlled thorugh Service S… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added missing files Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/service/service_process_prefs.cc
diff --git a/chrome/service/service_process_prefs.cc b/chrome/service/service_process_prefs.cc
index 7de70a4b573e39fab97d28f3ebe7d882d2c984a3..811647dc525c32238714d7fe46c9e28a35fa1e23 100644
--- a/chrome/service/service_process_prefs.cc
+++ b/chrome/service/service_process_prefs.cc
@@ -54,6 +54,21 @@ void ServiceProcessPrefs::SetBoolean(const std::string& key, bool value) {
prefs_->SetValue(key, Value::CreateBooleanValue(value));
}
+int ServiceProcessPrefs::GetInt(const std::string& key,
+ int default_value) const {
+ const Value* value;
+ int result = default_value;
+ if (prefs_->GetValue(key, &value) != PersistentPrefStore::READ_OK ||
+ !value->GetAsInteger(&result)) {
+ return default_value;
+ }
+ return result;
+}
+
+void ServiceProcessPrefs::SetInt(const std::string& key, int value) {
+ prefs_->SetValue(key, Value::CreateIntegerValue(value));
+}
+
const DictionaryValue* ServiceProcessPrefs::GetDictionary(
const std::string& key) const {
const Value* value;

Powered by Google App Engine
This is Rietveld 408576698