diff options
author | ttuttle <ttuttle@chromium.org> | 2014-08-25 12:38:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-25 19:39:40 +0000 |
commit | fa8427f940699df3073889af4ab20a1fb2b9ed37 (patch) | |
tree | a337eee618f603863bddce665f9aebc1582f6db8 /base/prefs | |
parent | 07884070ecfe2e6ad00a5493dfdc4df891bbd142 (diff) | |
download | chromium_src-fa8427f940699df3073889af4ab20a1fb2b9ed37.zip chromium_src-fa8427f940699df3073889af4ab20a1fb2b9ed37.tar.gz chromium_src-fa8427f940699df3073889af4ab20a1fb2b9ed37.tar.bz2 |
Domain Reliability: Don't upload when metrics reporting is off.
Tie Domain Reliability uploads to metrics reporting -- halt uploads when
reporting is turned off. (Keep recording, since we will eventually be able to
access reports through JavaScript as well.)
BUG=407170
Review URL: https://codereview.chromium.org/491753003
Cr-Commit-Position: refs/heads/master@{#291740}
Diffstat (limited to 'base/prefs')
-rw-r--r-- | base/prefs/pref_member.cc | 10 | ||||
-rw-r--r-- | base/prefs/pref_member.h | 14 |
2 files changed, 14 insertions, 10 deletions
diff --git a/base/prefs/pref_member.cc b/base/prefs/pref_member.cc index eb70839..4fa616f 100644 --- a/base/prefs/pref_member.cc +++ b/base/prefs/pref_member.cc @@ -7,10 +7,12 @@ #include "base/callback.h" #include "base/callback_helpers.h" #include "base/location.h" +#include "base/message_loop/message_loop_proxy.h" #include "base/prefs/pref_service.h" #include "base/value_conversions.h" using base::MessageLoopProxy; +using base::SingleThreadTaskRunner; namespace subtle { @@ -53,12 +55,12 @@ void PrefMemberBase::Destroy() { } void PrefMemberBase::MoveToThread( - const scoped_refptr<MessageLoopProxy>& message_loop) { + const scoped_refptr<SingleThreadTaskRunner>& task_runner) { VerifyValuePrefName(); // Load the value from preferences if it hasn't been loaded so far. if (!internal()) UpdateValueFromPref(base::Closure()); - internal()->MoveToThread(message_loop); + internal()->MoveToThread(task_runner); } void PrefMemberBase::OnPreferenceChanged(PrefService* service, @@ -127,9 +129,9 @@ void PrefMemberBase::Internal::UpdateValue( } void PrefMemberBase::Internal::MoveToThread( - const scoped_refptr<MessageLoopProxy>& message_loop) { + const scoped_refptr<SingleThreadTaskRunner>& task_runner) { CheckOnCorrectThread(); - thread_loop_ = message_loop; + thread_loop_ = task_runner; } bool PrefMemberVectorStringUpdate(const base::Value& value, diff --git a/base/prefs/pref_member.h b/base/prefs/pref_member.h index 17f5b44..2c3445d 100644 --- a/base/prefs/pref_member.h +++ b/base/prefs/pref_member.h @@ -33,9 +33,9 @@ #include "base/files/file_path.h" #include "base/logging.h" #include "base/memory/ref_counted.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/prefs/base_prefs_export.h" #include "base/prefs/pref_observer.h" +#include "base/single_thread_task_runner.h" #include "base/values.h" class PrefService; @@ -66,7 +66,7 @@ class BASE_PREFS_EXPORT PrefMemberBase : public PrefObserver { const base::Closure& callback) const; void MoveToThread( - const scoped_refptr<base::MessageLoopProxy>& message_loop); + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); // See PrefMember<> for description. bool IsManaged() const { @@ -92,7 +92,7 @@ class BASE_PREFS_EXPORT PrefMemberBase : public PrefObserver { bool IsOnCorrectThread() const; - scoped_refptr<base::MessageLoopProxy> thread_loop_; + scoped_refptr<base::SingleThreadTaskRunner> thread_loop_; mutable bool is_managed_; mutable bool is_user_modifiable_; @@ -112,7 +112,8 @@ class BASE_PREFS_EXPORT PrefMemberBase : public PrefObserver { // See PrefMember<> for description. void Destroy(); - void MoveToThread(const scoped_refptr<base::MessageLoopProxy>& message_loop); + void MoveToThread( + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); // PrefObserver virtual void OnPreferenceChanged(PrefService* service, @@ -197,8 +198,9 @@ class PrefMember : public subtle::PrefMemberBase { // via PostTask. // This method should only be used from the thread the PrefMember is currently // on, which is the UI thread by default. - void MoveToThread(const scoped_refptr<base::MessageLoopProxy>& message_loop) { - subtle::PrefMemberBase::MoveToThread(message_loop); + void MoveToThread( + const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { + subtle::PrefMemberBase::MoveToThread(task_runner); } // Check whether the pref is managed, i.e. controlled externally through |