summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-14 06:41:02 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-14 06:41:02 +0000
commitb537d10ec1d175d65ccc02619140f3a926ab403e (patch)
tree2ee5cfecdcb2ecc4e30dba2e05fecc4489ee7f8a /chrome
parentc5e00aa5531385e057e4bc62a0428762b2f13287 (diff)
downloadchromium_src-b537d10ec1d175d65ccc02619140f3a926ab403e.zip
chromium_src-b537d10ec1d175d65ccc02619140f3a926ab403e.tar.gz
chromium_src-b537d10ec1d175d65ccc02619140f3a926ab403e.tar.bz2
chromeos: Stop using lock when accessing GDataCache from GDataFileSystem
Now all GDataCache access which can cause race condition are made on the blocking pool, we no longer need lock then. BUG=126694 TEST=unit_tests --gtest_filter="GData*" Review URL: https://chromiumcodereview.appspot.com/10548024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chromeos/gdata/gdata_cache.cc3
-rw-r--r--chrome/browser/chromeos/gdata/gdata_file_system.cc13
2 files changed, 2 insertions, 14 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_cache.cc b/chrome/browser/chromeos/gdata/gdata_cache.cc
index ae1752f..c72a15f 100644
--- a/chrome/browser/chromeos/gdata/gdata_cache.cc
+++ b/chrome/browser/chromeos/gdata/gdata_cache.cc
@@ -1119,8 +1119,7 @@ GDataCacheMap::GDataCacheMap(
}
GDataCacheMap::~GDataCacheMap() {
- // TODO(satorux): Enable this once all callers are fixed: crbug.com/131826.
- // AssertOnSequencedWorkerPool();
+ AssertOnSequencedWorkerPool();
cache_map_.clear();
}
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc
index 8ff1e55..51198ba 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
@@ -1999,7 +1999,6 @@ void GDataFileSystem::OnGetDocumentEntry(const FilePath& cache_file_path,
void GDataFileSystem::FreeDiskSpaceIfNeededFor(int64 num_bytes,
bool* has_enough_space) {
- base::AutoLock lock(lock_); // For cache access.
cache_->FreeDiskSpaceIfNeededFor(num_bytes, has_enough_space);
}
@@ -2443,7 +2442,6 @@ void GDataFileSystem::SetMountedStateOnBlockingPool(
bool to_mount,
base::PlatformFileError *error,
FilePath* cache_file_path) {
- base::AutoLock lock(lock_); // For cache access.
cache_->SetMountedState(file_path, to_mount, error, cache_file_path);
}
@@ -3834,7 +3832,6 @@ void GDataFileSystem::RequestInitializeCacheForTesting() {
//========= GDataFileSystem: Cache tasks that ran on blocking pool ============
void GDataFileSystem::InitializeCacheOnBlockingPool() {
- base::AutoLock lock(lock_); // For cache access.
cache_->Initialize();
NotifyCacheInitialized();
}
@@ -3844,7 +3841,6 @@ void GDataFileSystem::GetFileFromCacheOnBlockingPool(
const std::string& md5,
base::PlatformFileError* error,
FilePath* cache_file_path) {
- base::AutoLock lock(lock_); // For cache access.
cache_->GetFile(resource_id, md5, error, cache_file_path);
}
@@ -3857,7 +3853,7 @@ void GDataFileSystem::GetCacheStateOnBlockingPool(
DCHECK(error);
DCHECK(cache_state);
- base::AutoLock lock(lock_); // For cache access.
+ base::AutoLock lock(lock_); // For |root_| access.
*error = base::PLATFORM_FILE_OK;
*cache_state = GDataCache::CACHE_STATE_NONE;
@@ -3881,7 +3877,6 @@ void GDataFileSystem::StoreToCacheOnBlockingPool(
const FilePath& source_path,
GDataCache::FileOperationType file_operation_type,
base::PlatformFileError* error) {
- base::AutoLock lock(lock_); // For cache access.
cache_->Store(resource_id, md5, source_path, file_operation_type, error);
}
@@ -3890,7 +3885,6 @@ void GDataFileSystem::PinOnBlockingPool(
const std::string& md5,
GDataCache::FileOperationType file_operation_type,
base::PlatformFileError* error) {
- base::AutoLock lock(lock_); // For cache access.
cache_->Pin(resource_id, md5, file_operation_type, error);
}
@@ -3899,7 +3893,6 @@ void GDataFileSystem::UnpinOnBlockingPool(
const std::string& md5,
GDataCache::FileOperationType file_operation_type,
base::PlatformFileError* error) {
- base::AutoLock lock(lock_); // For cache access.
cache_->Unpin(resource_id, md5, file_operation_type, error);
}
@@ -3909,7 +3902,6 @@ void GDataFileSystem::MarkDirtyInCacheOnBlockingPool(
GDataCache::FileOperationType file_operation_type,
base::PlatformFileError* error,
FilePath* cache_file_path) {
- base::AutoLock lock(lock_); // For cache access.
cache_->MarkDirty(
resource_id, md5, file_operation_type, error, cache_file_path);
}
@@ -3919,7 +3911,6 @@ void GDataFileSystem::CommitDirtyInCacheOnBlockingPool(
const std::string& md5,
GDataCache::FileOperationType file_operation_type,
base::PlatformFileError* error) {
- base::AutoLock lock(lock_); // For cache access.
cache_->CommitDirty(resource_id, md5, file_operation_type, error);
}
@@ -3928,14 +3919,12 @@ void GDataFileSystem::ClearDirtyInCacheOnBlockingPool(
const std::string& md5,
GDataCache::FileOperationType file_operation_type,
base::PlatformFileError* error) {
- base::AutoLock lock(lock_); // For cache access.
cache_->ClearDirty(resource_id, md5, file_operation_type, error);
}
void GDataFileSystem::RemoveFromCacheOnBlockingPool(
const std::string& resource_id,
base::PlatformFileError* error) {
- base::AutoLock lock(lock_); // For cache access.
cache_->Remove(resource_id, error);
}