summaryrefslogtreecommitdiffstats
path: root/components/cronet
diff options
context:
space:
mode:
authorestade <estade@chromium.org>2015-06-26 11:16:18 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-26 18:16:54 +0000
commit0bd407f3979d07dad729c5edfbd6d9e2d399867f (patch)
tree9361f23e5032ced375ca81233b55a9391dc40165 /components/cronet
parent83d4d08f5cdbefec78f77d9b83c5406b92cdb9a0 (diff)
downloadchromium_src-0bd407f3979d07dad729c5edfbd6d9e2d399867f.zip
chromium_src-0bd407f3979d07dad729c5edfbd6d9e2d399867f.tar.gz
chromium_src-0bd407f3979d07dad729c5edfbd6d9e2d399867f.tar.bz2
Convert some base/prefs/ methods to scoped_ptr instead of bare ptr
BUG= Review URL: https://codereview.chromium.org/1160403002 Cr-Commit-Position: refs/heads/master@{#336412}
Diffstat (limited to 'components/cronet')
-rw-r--r--components/cronet/android/cronet_in_memory_pref_store.cc10
-rw-r--r--components/cronet/android/cronet_in_memory_pref_store.h5
2 files changed, 8 insertions, 7 deletions
diff --git a/components/cronet/android/cronet_in_memory_pref_store.cc b/components/cronet/android/cronet_in_memory_pref_store.cc
index ca60e70..0826497 100644
--- a/components/cronet/android/cronet_in_memory_pref_store.cc
+++ b/components/cronet/android/cronet_in_memory_pref_store.cc
@@ -5,7 +5,7 @@
#include "components/cronet/android/cronet_in_memory_pref_store.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/values.h"
CronetInMemoryPrefStore::CronetInMemoryPrefStore() {}
@@ -38,16 +38,16 @@ bool CronetInMemoryPrefStore::IsInitializationComplete() const {
}
void CronetInMemoryPrefStore::SetValue(
- const std::string& key, base::Value* value, uint32 flags) {
+ const std::string& key, scoped_ptr<base::Value> value, uint32 flags) {
DCHECK(value);
- if (prefs_.SetValue(key, value))
+ if (prefs_.SetValue(key, value.Pass()))
ReportValueChanged(key, flags);
}
void CronetInMemoryPrefStore::SetValueSilently(const std::string& key,
- base::Value* value,
+ scoped_ptr<base::Value> value,
uint32 flags) {
- prefs_.SetValue(key, value);
+ prefs_.SetValue(key, value.Pass());
}
void CronetInMemoryPrefStore::RemoveValue(const std::string& key,
diff --git a/components/cronet/android/cronet_in_memory_pref_store.h b/components/cronet/android/cronet_in_memory_pref_store.h
index daebace..3c589a1 100644
--- a/components/cronet/android/cronet_in_memory_pref_store.h
+++ b/components/cronet/android/cronet_in_memory_pref_store.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/prefs/persistent_pref_store.h"
#include "base/prefs/pref_value_map.h"
@@ -36,10 +37,10 @@ class CronetInMemoryPrefStore : public PersistentPrefStore {
bool GetMutableValue(const std::string& key, base::Value** result) override;
void ReportValueChanged(const std::string& key, uint32 flags) override;
void SetValue(const std::string& key,
- base::Value* value,
+ scoped_ptr<base::Value> value,
uint32 flags) override;
void SetValueSilently(const std::string& key,
- base::Value* value,
+ scoped_ptr<base::Value> value,
uint32 flags) override;
void RemoveValue(const std::string& key, uint32 flags) override;
bool ReadOnly() const override;