diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 01:33:44 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-10 01:33:44 +0000 |
commit | 7f7bcb2efa98012235493e2ac8b3f221fd90899f (patch) | |
tree | e89337c8f62de15b10b84f9fe133a3f85c3b5150 | |
parent | 0ef418ba03df686567f480606c0af0932f352e22 (diff) | |
download | chromium_src-7f7bcb2efa98012235493e2ac8b3f221fd90899f.zip chromium_src-7f7bcb2efa98012235493e2ac8b3f221fd90899f.tar.gz chromium_src-7f7bcb2efa98012235493e2ac8b3f221fd90899f.tar.bz2 |
Merge 238901 "Don't revoke SyncFileSystem in SyncFileSystemBacke..."
> Don't revoke SyncFileSystem in SyncFileSystemBackend dtor
>
> Revoking SyncFileSystem globally removes the
> 'syncfs' mount point, which could cause INVALID_URL error (== EncodingError) on any syncfs URL conversions.
>
> Also added ExternalFileSystem::RevokeAllFileSystems() so that tests like
> ChromeOSFileSystemBackendTest.DefaultMountPoints that assumes no
> global external mount points are registered before the test runs can use it.
>
> (Ideally we should call RevokeAllFileSystems() at the end of all tests that create
> FileSystemContext, but that sounds impractical)
>
> BUG=325588
>
> Review URL: https://codereview.chromium.org/101523004
TBR=kinuko@chromium.org
Review URL: https://codereview.chromium.org/111173002
git-svn-id: svn://svn.chromium.org/chrome/branches/1700/src@239631 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/fileapi/file_system_backend_unittest.cc b/chrome/browser/chromeos/fileapi/file_system_backend_unittest.cc index bcc4581..8f94bd8 100644 --- a/chrome/browser/chromeos/fileapi/file_system_backend_unittest.cc +++ b/chrome/browser/chromeos/fileapi/file_system_backend_unittest.cc @@ -32,6 +32,10 @@ FileSystemURL CreateFileSystemURL(const std::string& extension, } TEST(ChromeOSFileSystemBackendTest, DefaultMountPoints) { + // Make sure no system-level mount points are registered before testing + // to avoid flakiness. + fileapi::ExternalMountPoints::GetSystemInstance()->RevokeAllFileSystems(); + scoped_refptr<quota::SpecialStoragePolicy> storage_policy = new quota::MockSpecialStoragePolicy(); scoped_refptr<fileapi::ExternalMountPoints> mount_points( diff --git a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc index f85aaa8..b3fee34 100644 --- a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc +++ b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc @@ -72,8 +72,6 @@ SyncFileSystemBackend::SyncFileSystemBackend(Profile* profile) } SyncFileSystemBackend::~SyncFileSystemBackend() { - RevokeSyncableFileSystem(); - if (change_tracker_) { GetDelegate()->file_task_runner()->DeleteSoon( FROM_HERE, change_tracker_.release()); diff --git a/webkit/browser/fileapi/external_mount_points.cc b/webkit/browser/fileapi/external_mount_points.cc index cfc155a..137db87 100644 --- a/webkit/browser/fileapi/external_mount_points.cc +++ b/webkit/browser/fileapi/external_mount_points.cc @@ -233,6 +233,12 @@ FileSystemURL ExternalMountPoints::CreateExternalFileSystemURL( base::FilePath::kSeparators[0] + path.value())); } +void ExternalMountPoints::RevokeAllFileSystems() { + base::AutoLock locker(lock_); + instance_map_.clear(); + path_to_name_map_.clear(); +} + ExternalMountPoints::ExternalMountPoints() {} ExternalMountPoints::~ExternalMountPoints() { diff --git a/webkit/browser/fileapi/external_mount_points.h b/webkit/browser/fileapi/external_mount_points.h index e4d059f..e4ce660 100644 --- a/webkit/browser/fileapi/external_mount_points.h +++ b/webkit/browser/fileapi/external_mount_points.h @@ -101,6 +101,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT ExternalMountPoints const std::string& mount_name, const base::FilePath& path) const; + // Revoke all registered filesystems. Used only by testing (for clean-ups). + void RevokeAllFileSystems(); + private: friend class base::RefCountedThreadSafe<ExternalMountPoints>; |