summaryrefslogtreecommitdiffstats
path: root/rlz/chromeos
diff options
context:
space:
mode:
authorivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-16 11:16:39 +0000
committerivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-16 11:16:39 +0000
commitcf3aef70329cd30fe6e9a85efa404ba5c4750076 (patch)
tree3d2d8944351dfe6573b92ab22791cef71f67ed68 /rlz/chromeos
parentcba3a4bd653a63d4daaa218ceaf3a419024f1c50 (diff)
downloadchromium_src-cf3aef70329cd30fe6e9a85efa404ba5c4750076.zip
chromium_src-cf3aef70329cd30fe6e9a85efa404ba5c4750076.tar.gz
chromium_src-cf3aef70329cd30fe6e9a85efa404ba5c4750076.tar.bz2
[cros,rlz] Financial ping livelock fix and proper shutdown.
*) Fix the livelock on RLZ thread in FinancialPing *) RlzValueStore on chromeos destroys JsonPrefStore on proper thread. BUG=157348 Review URL: https://chromiumcodereview.appspot.com/11275284 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168187 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'rlz/chromeos')
-rw-r--r--rlz/chromeos/lib/rlz_value_store_chromeos.cc7
-rw-r--r--rlz/chromeos/lib/rlz_value_store_chromeos.h6
2 files changed, 10 insertions, 3 deletions
diff --git a/rlz/chromeos/lib/rlz_value_store_chromeos.cc b/rlz/chromeos/lib/rlz_value_store_chromeos.cc
index 2f75887..ddf73e7 100644
--- a/rlz/chromeos/lib/rlz_value_store_chromeos.cc
+++ b/rlz/chromeos/lib/rlz_value_store_chromeos.cc
@@ -90,6 +90,12 @@ void RlzValueStoreChromeOS::ResetForTesting() {
GetInstance()->ReadPrefs();
}
+// static
+void RlzValueStoreChromeOS::Cleanup() {
+ if (created_)
+ GetInstance()->rlz_store_ = NULL;
+}
+
RlzValueStoreChromeOS::RlzValueStoreChromeOS() {
ReadPrefs();
created_ = true;
@@ -263,7 +269,6 @@ bool RlzValueStoreChromeOS::RemoveValueFromList(std::string list_name,
ScopedRlzValueStoreLock::ScopedRlzValueStoreLock()
: store_(RlzValueStoreChromeOS::GetInstance()) {
- DCHECK(store_->CalledOnValidThread());
}
ScopedRlzValueStoreLock::~ScopedRlzValueStoreLock() {
diff --git a/rlz/chromeos/lib/rlz_value_store_chromeos.h b/rlz/chromeos/lib/rlz_value_store_chromeos.h
index 245ae00..c9456a8 100644
--- a/rlz/chromeos/lib/rlz_value_store_chromeos.h
+++ b/rlz/chromeos/lib/rlz_value_store_chromeos.h
@@ -22,8 +22,7 @@ namespace rlz_lib {
// An implementation of RlzValueStore for ChromeOS. Unlike Mac and Win
// counterparts, it's non thread-safe and should only be accessed on a single
// Thread instance that has a MessageLoop.
-class RlzValueStoreChromeOS : public RlzValueStore,
- public base::NonThreadSafe {
+class RlzValueStoreChromeOS : public RlzValueStore {
public:
static RlzValueStoreChromeOS* GetInstance();
@@ -31,6 +30,9 @@ class RlzValueStoreChromeOS : public RlzValueStore,
// tasks to. Must be called before the first GetInstance() call.
static void SetIOTaskRunner(base::SequencedTaskRunner* io_task_runner);
+ // Must be invoked during shutdown to commit pending I/O.
+ static void Cleanup();
+
// Resets the store to its initial state. Should only be used for testing.
// Same restrictions as for calling GetInstance() for the first time apply,
// i.e. must call SetIOTaskRunner first.