diff options
author | ghc@google.com <ghc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-26 21:01:10 +0000 |
---|---|---|
committer | ghc@google.com <ghc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-26 21:01:10 +0000 |
commit | 8b2a7f607a2675b0bae9ab5923c7e2a165740bc7 (patch) | |
tree | 0358862aab3a66bf678aa1dd4e988621cf5daf4a /chrome/browser/sync | |
parent | 4a1e436e29a5731dc775c20f157f91be76633d4e (diff) | |
download | chromium_src-8b2a7f607a2675b0bae9ab5923c7e2a165740bc7.zip chromium_src-8b2a7f607a2675b0bae9ab5923c7e2a165740bc7.tar.gz chromium_src-8b2a7f607a2675b0bae9ab5923c7e2a165740bc7.tar.bz2 |
This avoids unnecessarily scheduling a callback wrapped inside another callback, which was causing a memory leak in unit tests.
This change also removes the valgrind leak suppression (bug 89025).
Tested by running sync_unit_tests through valgrind with the suppression removed. Also did a manual end-to-end test of cache invalidation with Chrome.
Review URL: http://codereview.chromium.org/7514017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94160 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/notifier/chrome_system_resources.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/chrome/browser/sync/notifier/chrome_system_resources.cc b/chrome/browser/sync/notifier/chrome_system_resources.cc index 47725b0..44e4176 100644 --- a/chrome/browser/sync/notifier/chrome_system_resources.cc +++ b/chrome/browser/sync/notifier/chrome_system_resources.cc @@ -157,11 +157,8 @@ void ChromeStorage::WriteKey(const std::string& key, const std::string& value, void ChromeStorage::ReadKey(const std::string& key, invalidation::ReadKeyCallback* done) { - scheduler_->Schedule( - invalidation::Scheduler::NoDelay(), - invalidation::NewPermanentCallback( - this, &ChromeStorage::RunAndDeleteReadKeyCallback, - done, cached_state_)); + DCHECK(scheduler_->IsRunningOnThread()) << "not running on scheduler thread"; + RunAndDeleteReadKeyCallback(done, cached_state_); } void ChromeStorage::DeleteKey(const std::string& key, |