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

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: 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..11fe7089489d209beec1fa6ce93b682f38cb3cc2 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 ||
Vitaly Buka (NO REVIEWS) 2012/10/22 20:52:53 misaligned
gene 2012/10/22 21:44:12 Done.
+ !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