From 8f477c00fe9d679700a3a3d03d3b99cba72a0ca9 Mon Sep 17 00:00:00 2001 From: "kinuko@chromium.org" Date: Thu, 5 Dec 2013 05:08:06 +0000 Subject: 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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238901 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/browser/fileapi/external_mount_points.cc | 6 ++++++ webkit/browser/fileapi/external_mount_points.h | 3 +++ 2 files changed, 9 insertions(+) (limited to 'webkit') 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; -- cgit v1.1