summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-25 22:46:34 +0000
committertbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-25 22:46:34 +0000
commit6ef0c391fe92b35b42f291a61f7c4608bc80c023 (patch)
tree30ce241eba9202f74af14b40128e2543094cfacc
parent5025c8b2136a8ac6c41081699b3aad7137862291 (diff)
downloadchromium_src-6ef0c391fe92b35b42f291a61f7c4608bc80c023.zip
chromium_src-6ef0c391fe92b35b42f291a61f7c4608bc80c023.tar.gz
chromium_src-6ef0c391fe92b35b42f291a61f7c4608bc80c023.tar.bz2
Add BrowserContext specific external mount points
... and drill them down to FileSystemContext and CrosMountPointProvider. These mount points will be used to register profile specific mount points. (read Google drive, and in multi-profile world Downloads). Also, use BrowserContext mount points to register mount points in browser tests. TBR=sky@chromium.org (for chrome/browser/ui) BUG=158837 TEST= { content_unittests:FileSystemContextTest.*; browser_tests:*FileSystemExtensionApiTest.*; manual: verify that Files.app display files and can execute fileBrowserHandlers (in Downloads and drive, with and without --file-manager-packaged flag); Review URL: https://chromiumcodereview.appspot.com/11943023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178927 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/drive/drive_system_service.cc46
-rw-r--r--chrome/browser/chromeos/extensions/external_filesystem_apitest.cc44
-rw-r--r--chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc17
-rw-r--r--chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc15
-rw-r--r--content/browser/browser_context.cc41
-rw-r--r--content/browser/fileapi/browser_file_system_helper.cc3
-rw-r--r--content/browser/fileapi/browser_file_system_helper.h5
-rw-r--r--content/browser/storage_partition_impl.cc1
-rw-r--r--content/public/browser/browser_context.h9
-rw-r--r--webkit/blob/blob_url_request_job_unittest.cc2
-rw-r--r--webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc6
-rw-r--r--webkit/fileapi/external_mount_points.cc9
-rw-r--r--webkit/fileapi/file_system_context.cc12
-rw-r--r--webkit/fileapi/file_system_context.h11
-rw-r--r--webkit/fileapi/file_system_context_unittest.cc136
-rw-r--r--webkit/fileapi/file_system_dir_url_request_job_unittest.cc2
-rw-r--r--webkit/fileapi/file_system_file_stream_reader_unittest.cc2
-rw-r--r--webkit/fileapi/file_system_mount_point_provider_unittest.cc2
-rw-r--r--webkit/fileapi/file_system_quota_client_unittest.cc2
-rw-r--r--webkit/fileapi/file_system_url_request_job_unittest.cc2
-rw-r--r--webkit/fileapi/isolated_file_util_unittest.cc2
-rw-r--r--webkit/fileapi/local_file_system_test_helper.cc2
-rw-r--r--webkit/fileapi/media/native_media_file_util_unittest.cc2
-rw-r--r--webkit/fileapi/obfuscated_file_util_unittest.cc2
-rw-r--r--webkit/fileapi/syncable/canned_syncable_file_system.cc1
-rw-r--r--webkit/fileapi/upload_file_system_file_element_reader_unittest.cc2
-rw-r--r--webkit/tools/test_shell/simple_file_system.cc2
27 files changed, 276 insertions, 104 deletions
diff --git a/chrome/browser/chromeos/drive/drive_system_service.cc b/chrome/browser/chromeos/drive/drive_system_service.cc
index f03ab54..0a73a59 100644
--- a/chrome/browser/chromeos/drive/drive_system_service.cc
+++ b/chrome/browser/chromeos/drive/drive_system_service.cc
@@ -37,8 +37,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "google/cacheinvalidation/types.pb.h"
-#include "webkit/fileapi/file_system_context.h"
-#include "webkit/fileapi/file_system_mount_point_provider.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/user_agent/user_agent_util.h"
using content::BrowserContext;
@@ -260,18 +259,26 @@ void DriveSystemService::ReloadAndRemountFileSystem() {
void DriveSystemService::AddDriveMountPoint() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- const FilePath mount_point = util::GetDriveMountPointPath();
- fileapi::ExternalFileSystemMountPointProvider* provider =
- BrowserContext::GetDefaultStoragePartition(profile_)->
- GetFileSystemContext()->external_provider();
- if (provider && !provider->HasMountPoint(mount_point)) {
+ const FilePath drive_mount_point = util::GetDriveMountPointPath();
+ fileapi::ExternalMountPoints* mount_points =
+ BrowserContext::GetMountPoints(profile_);
+ DCHECK(mount_points);
+
+ // Create a scoped_refptr so the proxy doesn't leak if
+ // |RegisterRemoteFileSystem| fails.
+ scoped_refptr<DriveFileSystemProxy> proxy(
+ new DriveFileSystemProxy(file_system_.get()));
+
+ bool success = mount_points->RegisterRemoteFileSystem(
+ drive_mount_point.BaseName().AsUTF8Unsafe(),
+ fileapi::kFileSystemTypeDrive,
+ proxy,
+ drive_mount_point);
+
+ if (success) {
event_logger_->Log("AddDriveMountPoint");
- provider->AddRemoteMountPoint(
- mount_point,
- new DriveFileSystemProxy(file_system_.get()));
+ file_system_->NotifyFileSystemMounted();
}
-
- file_system_->NotifyFileSystemMounted();
}
void DriveSystemService::RemoveDriveMountPoint() {
@@ -280,14 +287,13 @@ void DriveSystemService::RemoveDriveMountPoint() {
file_system_->NotifyFileSystemToBeUnmounted();
file_system_->StopPolling();
- const FilePath mount_point = util::GetDriveMountPointPath();
- fileapi::ExternalFileSystemMountPointProvider* provider =
- BrowserContext::GetDefaultStoragePartition(profile_)->
- GetFileSystemContext()->external_provider();
- if (provider) {
- provider->RemoveMountPoint(mount_point);
- event_logger_->Log("RemoveDriveMountPoint");
- }
+ fileapi::ExternalMountPoints* mount_points =
+ BrowserContext::GetMountPoints(profile_);
+ DCHECK(mount_points);
+
+ mount_points->RevokeFileSystem(
+ util::GetDriveMountPointPath().BaseName().AsUTF8Unsafe());
+ event_logger_->Log("RemoveDriveMountPoint");
}
void DriveSystemService::OnCacheInitialized(bool success) {
diff --git a/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc b/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc
index 1a5d443..4e4d974 100644
--- a/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc
+++ b/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc
@@ -32,10 +32,8 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
-#include "content/public/browser/storage_partition.h"
#include "content/public/test/test_utils.h"
-#include "webkit/fileapi/file_system_context.h"
-#include "webkit/fileapi/file_system_mount_point_provider.h"
+#include "webkit/fileapi/external_mount_points.h"
using content::BrowserContext;
using extensions::Extension;
@@ -110,15 +108,12 @@ class FileSystemExtensionApiTest : public ExtensionApiTest {
}
// Adds a local mount point at at mount point /tmp.
- void AddTmpMountPoint(const std::string& extension_id) {
- Profile* profile = browser()->profile();
-
- GURL site = extensions::ExtensionSystem::Get(profile)->
- extension_service()->GetSiteForExtensionId(extension_id);
- fileapi::ExternalFileSystemMountPointProvider* provider =
- BrowserContext::GetStoragePartitionForSite(profile, site)->
- GetFileSystemContext()->external_provider();
- provider->AddLocalMountPoint(mount_point_dir_);
+ virtual void SetUpOnMainThread() OVERRIDE {
+ BrowserContext::GetMountPoints(browser()->profile())->RegisterFileSystem(
+ "tmp",
+ fileapi::kFileSystemTypeNativeLocal,
+ mount_point_dir_);
+ ExtensionApiTest::SetUpOnMainThread();
}
bool RunFileBrowserHandlerTest(const std::string& test_page,
@@ -140,11 +135,6 @@ class FileSystemExtensionApiTest : public ExtensionApiTest {
if (!file_browser)
return false;
- // Add test mount point to file browser's and file handler's context.
- AddTmpMountPoint(file_browser->id());
- if (file_handler)
- AddTmpMountPoint(file_handler->id());
-
// Run the test.
ResultCatcher catcher;
GURL url = file_browser->GetResourceURL(test_page);
@@ -194,15 +184,13 @@ class RestrictedFileSystemExtensionApiTest : public ExtensionApiTest {
ExtensionApiTest::TearDown();
}
- void AddRestrictedMountPoint(const std::string& extension_id) {
- Profile* profile = browser()->profile();
+ virtual void SetUpOnMainThread() OVERRIDE {
+ BrowserContext::GetMountPoints(browser()->profile())->RegisterFileSystem(
+ "mount",
+ fileapi::kFileSystemTypeRestrictedNativeLocal,
+ mount_point_dir_);
- GURL site = extensions::ExtensionSystem::Get(profile)->
- extension_service()->GetSiteForExtensionId(extension_id);
- fileapi::ExternalFileSystemMountPointProvider* provider =
- BrowserContext::GetStoragePartitionForSite(profile, site)->
- GetFileSystemContext()->external_provider();
- provider->AddRestrictedLocalMountPoint(mount_point_dir_);
+ ExtensionApiTest::SetUpOnMainThread();
}
protected:
@@ -272,8 +260,6 @@ IN_PROC_BROWSER_TEST_F(FileSystemExtensionApiTest, FileBrowserTestLazy) {
ASSERT_TRUE(file_handler) << message_;
- AddTmpMountPoint(file_handler->id());
-
ASSERT_TRUE(RunFileBrowserHandlerTest("read.html",
"filebrowser_component",
""))
@@ -315,8 +301,6 @@ IN_PROC_BROWSER_TEST_F(FileSystemExtensionApiTest,
ASSERT_TRUE(file_handler) << message_;
- AddTmpMountPoint(file_handler->id());
-
ASSERT_TRUE(RunFileBrowserHandlerTest("write.html",
"filebrowser_component",
""))
@@ -327,8 +311,6 @@ IN_PROC_BROWSER_TEST_F(RestrictedFileSystemExtensionApiTest, Basic) {
const Extension* file_browser = LoadExtensionAsComponent(
test_data_dir_.AppendASCII("filebrowser_component"));
- AddRestrictedMountPoint(file_browser->id());
-
ResultCatcher catcher;
GURL url = file_browser->GetResourceURL("restricted.html");
ui_test_utils::NavigateToURL(browser(), url);
diff --git a/chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc b/chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc
index 93fee25..d05e1c9 100644
--- a/chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_handler_api_test.cc
@@ -22,9 +22,8 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/browser_context.h"
-#include "content/public/browser/storage_partition.h"
-#include "webkit/fileapi/file_system_context.h"
-#include "webkit/fileapi/file_system_mount_point_provider.h"
+#include "webkit/fileapi/external_mount_points.h"
+#include "webkit/fileapi/file_system_types.h"
namespace utils = extension_function_test_utils;
@@ -177,14 +176,10 @@ class FileBrowserHandlerExtensionTest : public ExtensionApiTest {
// Creates new, test mount point.
void AddTmpMountPoint(const std::string& extension_id) {
- Profile* profile = browser()->profile();
-
- GURL site = extensions::ExtensionSystem::Get(profile)->
- extension_service()->GetSiteForExtensionId(extension_id);
- fileapi::ExternalFileSystemMountPointProvider* provider =
- BrowserContext::GetStoragePartitionForSite(profile, site)->
- GetFileSystemContext()->external_provider();
- provider->AddLocalMountPoint(tmp_mount_point_);
+ BrowserContext::GetMountPoints(browser()->profile())->RegisterFileSystem(
+ "tmp",
+ fileapi::kFileSystemTypeNativeLocal,
+ tmp_mount_point_);
}
FilePath GetFullPathOnTmpMountPoint(const FilePath& relative_path) {
diff --git a/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc b/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc
index 8859487..0b91bd5 100644
--- a/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc
+++ b/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc
@@ -29,8 +29,6 @@
#include "ui/shell_dialogs/select_file_dialog.h"
#include "ui/shell_dialogs/selected_file_info.h"
#include "webkit/fileapi/external_mount_points.h"
-#include "webkit/fileapi/file_system_context.h"
-#include "webkit/fileapi/file_system_mount_point_provider.h"
using content::BrowserContext;
@@ -117,15 +115,14 @@ class SelectFileDialogExtensionBrowserTest : public ExtensionBrowserTest {
// Creates a file system mount point for a directory.
void AddMountPoint(const FilePath& path) {
- fileapi::ExternalFileSystemMountPointProvider* provider =
- BrowserContext::GetDefaultStoragePartition(browser()->profile())->
- GetFileSystemContext()->external_provider();
-
+ std::string mount_point_name = path.BaseName().AsUTF8Unsafe();
+ fileapi::ExternalMountPoints* mount_points =
+ BrowserContext::GetMountPoints(browser()->profile());
// The Downloads mount point already exists so it must be removed before
// adding the test mount point (which will also be mapped as Downloads).
- fileapi::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(
- path.BaseName().AsUTF8Unsafe());
- EXPECT_TRUE(provider->AddLocalMountPoint(path));
+ mount_points->RevokeFileSystem(mount_point_name);
+ EXPECT_TRUE(mount_points->RegisterFileSystem(
+ mount_point_name, fileapi::kFileSystemTypeNativeLocal, path));
}
void CheckJavascriptErrors() {
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 2385ca0..1b72aec 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -5,6 +5,7 @@
#include "content/public/browser/browser_context.h"
#if !defined(OS_IOS)
+#include "base/path_service.h"
#include "content/browser/appcache/chrome_appcache_service.h"
#include "content/browser/dom_storage/dom_storage_context_impl.h"
#include "content/browser/download/download_manager_impl.h"
@@ -23,6 +24,7 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "webkit/database/database_tracker.h"
+#include "webkit/fileapi/external_mount_points.h"
#endif // !OS_IOS
using base::UserDataAdapter;
@@ -34,8 +36,9 @@ namespace content {
namespace {
// Key names on BrowserContext.
-const char* kDownloadManagerKeyName = "download_manager";
-const char* kStorageParitionMapKeyName = "content_storage_partition_map";
+const char kDownloadManagerKeyName[] = "download_manager";
+const char kMountPointsKey[] = "mount_points";
+const char kStorageParitionMapKeyName[] = "content_storage_partition_map";
StoragePartitionImplMap* GetStoragePartitionMap(
BrowserContext* browser_context) {
@@ -130,6 +133,40 @@ DownloadManager* BrowserContext::GetDownloadManager(
context, kDownloadManagerKeyName);
}
+// static
+fileapi::ExternalMountPoints* BrowserContext::GetMountPoints(
+ BrowserContext* context) {
+ // Ensure that these methods are called on the UI thread, except for
+ // unittests where a UI thread might not have been created.
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
+ !BrowserThread::IsMessageLoopValid(BrowserThread::UI));
+
+#if defined(OS_CHROMEOS)
+ if (!context->GetUserData(kMountPointsKey)) {
+ scoped_refptr<fileapi::ExternalMountPoints> mount_points =
+ fileapi::ExternalMountPoints::CreateRefCounted();
+ context->SetUserData(
+ kMountPointsKey,
+ new UserDataAdapter<fileapi::ExternalMountPoints>(
+ mount_points));
+
+ // Add Downloads mount point.
+ FilePath home_path;
+ if (PathService::Get(base::DIR_HOME, &home_path)) {
+ mount_points->RegisterFileSystem(
+ "Downloads",
+ fileapi::kFileSystemTypeNativeLocal,
+ home_path.AppendASCII("Downloads"));
+ }
+ }
+
+ return UserDataAdapter<fileapi::ExternalMountPoints>::Get(
+ context, kMountPointsKey);
+#else
+ return NULL;
+#endif
+}
+
StoragePartition* BrowserContext::GetStoragePartition(
BrowserContext* browser_context,
SiteInstance* site_instance) {
diff --git a/content/browser/fileapi/browser_file_system_helper.cc b/content/browser/fileapi/browser_file_system_helper.cc
index 3cb45f0..a8b29bf 100644
--- a/content/browser/fileapi/browser_file_system_helper.cc
+++ b/content/browser/fileapi/browser_file_system_helper.cc
@@ -12,6 +12,7 @@
#include "base/threading/sequenced_worker_pool.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_options.h"
#include "webkit/fileapi/file_system_task_runners.h"
#include "webkit/quota/quota_manager.h"
@@ -42,6 +43,7 @@ FileSystemOptions CreateBrowserFileSystemOptions(bool is_incognito) {
scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext(
const FilePath& profile_path, bool is_incognito,
+ fileapi::ExternalMountPoints* external_mount_points,
quota::SpecialStoragePolicy* special_storage_policy,
quota::QuotaManagerProxy* quota_manager_proxy) {
base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
@@ -56,6 +58,7 @@ scoped_refptr<fileapi::FileSystemContext> CreateFileSystemContext(
return new fileapi::FileSystemContext(
task_runners.Pass(),
+ external_mount_points,
special_storage_policy,
quota_manager_proxy,
profile_path,
diff --git a/content/browser/fileapi/browser_file_system_helper.h b/content/browser/fileapi/browser_file_system_helper.h
index 1014947..8bd1773 100644
--- a/content/browser/fileapi/browser_file_system_helper.h
+++ b/content/browser/fileapi/browser_file_system_helper.h
@@ -9,6 +9,10 @@
#include "content/common/content_export.h"
#include "webkit/fileapi/file_system_context.h"
+namespace fileapi {
+class ExternalMountPoints;
+}
+
namespace quota {
class SpecialStoragePolicy;
}
@@ -21,6 +25,7 @@ CONTENT_EXPORT scoped_refptr<fileapi::FileSystemContext>
CreateFileSystemContext(
const FilePath& profile_path,
bool is_incognito,
+ fileapi::ExternalMountPoints* external_mount_points,
quota::SpecialStoragePolicy* special_storage_policy,
quota::QuotaManagerProxy* quota_manager_proxy);
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
index a3eafab..acf7ecd 100644
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -167,6 +167,7 @@ StoragePartitionImpl* StoragePartitionImpl::Create(
// its construction.
scoped_refptr<fileapi::FileSystemContext> filesystem_context =
CreateFileSystemContext(partition_path, in_memory,
+ BrowserContext::GetMountPoints(context),
context->GetSpecialStoragePolicy(),
quota_manager->proxy());
diff --git a/content/public/browser/browser_context.h b/content/public/browser/browser_context.h
index f2837f7..1bd5949 100644
--- a/content/public/browser/browser_context.h
+++ b/content/public/browser/browser_context.h
@@ -11,6 +11,10 @@
#include "base/supports_user_data.h"
#include "content/common/content_export.h"
+namespace fileapi {
+class ExternalMountPoints;
+}
+
namespace net {
class URLRequestContextGetter;
}
@@ -44,6 +48,11 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
static DownloadManager* GetDownloadManager(BrowserContext* browser_context);
+ // Returns BrowserContext specific external mount points. It may return NULL
+ // if the context doesn't have any BrowserContext specific external mount
+ // points. Currenty, non-NULL value is returned only on ChromeOS.
+ static fileapi::ExternalMountPoints* GetMountPoints(BrowserContext* context);
+
static content::StoragePartition* GetStoragePartition(
BrowserContext* browser_context, SiteInstance* site_instance);
static content::StoragePartition* GetStoragePartitionForSite(
diff --git a/webkit/blob/blob_url_request_job_unittest.cc b/webkit/blob/blob_url_request_job_unittest.cc
index 1ed897b..007d936 100644
--- a/webkit/blob/blob_url_request_job_unittest.cc
+++ b/webkit/blob/blob_url_request_job_unittest.cc
@@ -19,6 +19,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/blob/blob_data.h"
#include "webkit/blob/blob_url_request_job.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_operation_context.h"
@@ -169,6 +170,7 @@ class BlobURLRequestJobTest : public testing::Test {
// Prepare file system.
file_system_context_ = new fileapi::FileSystemContext(
fileapi::FileSystemTaskRunners::CreateMockTaskRunners(),
+ fileapi::ExternalMountPoints::CreateRefCounted().get(),
NULL,
NULL,
temp_dir_.path(),
diff --git a/webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc b/webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc
index b586584..a185583 100644
--- a/webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc
+++ b/webkit/chromeos/fileapi/cros_mount_point_provider_unittest.cc
@@ -39,14 +39,14 @@ TEST(CrosMountPointProviderTest, DefaultMountPoints) {
storage_policy,
mount_points.get(),
fileapi::ExternalMountPoints::GetSystemInstance());
- // By default there should be 4 mount points.
std::vector<FilePath> root_dirs = provider.GetRootDirectories();
std::set<FilePath> root_dirs_set(root_dirs.begin(), root_dirs.end());
- EXPECT_EQ(4u, root_dirs.size());
+
+ // By default there should be 3 mount points (in system mount points):
+ EXPECT_EQ(3u, root_dirs.size());
EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/media/removable"))));
EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/media/archive"))));
EXPECT_TRUE(root_dirs_set.count(FilePath(FPL("/usr/share/oem"))));
- // Fourth mount point is Downloads, but its local path is device specific.
}
TEST(CrosMountPointProviderTest, GetRootDirectories) {
diff --git a/webkit/fileapi/external_mount_points.cc b/webkit/fileapi/external_mount_points.cc
index 126c931..bca5b2b 100644
--- a/webkit/fileapi/external_mount_points.cc
+++ b/webkit/fileapi/external_mount_points.cc
@@ -62,15 +62,6 @@ class SystemMountPointsLazyWrapper {
"oem",
fileapi::kFileSystemTypeRestrictedNativeLocal,
FilePath(FILE_PATH_LITERAL("/usr/share/oem")));
-
- // TODO(tbarzic): Move this out of here.
- FilePath home_path;
- if (PathService::Get(base::DIR_HOME, &home_path)) {
- system_mount_points_->RegisterFileSystem(
- "Downloads",
- fileapi::kFileSystemTypeNativeLocal,
- home_path.AppendASCII("Downloads"));
- }
#endif // defined(OS_CHROMEOS)
}
diff --git a/webkit/fileapi/file_system_context.cc b/webkit/fileapi/file_system_context.cc
index 8d3ac54..4539ca8 100644
--- a/webkit/fileapi/file_system_context.cc
+++ b/webkit/fileapi/file_system_context.cc
@@ -55,6 +55,7 @@ void DidOpenFileSystem(
FileSystemContext::FileSystemContext(
scoped_ptr<FileSystemTaskRunners> task_runners,
+ ExternalMountPoints* external_mount_points,
quota::SpecialStoragePolicy* special_storage_policy,
quota::QuotaManagerProxy* quota_manager_proxy,
const FilePath& partition_path,
@@ -68,6 +69,7 @@ FileSystemContext::FileSystemContext(
partition_path,
options)),
isolated_provider_(new IsolatedMountPointProvider(partition_path)),
+ external_mount_points_(external_mount_points),
partition_path_(partition_path) {
DCHECK(task_runners_.get());
@@ -75,20 +77,18 @@ FileSystemContext::FileSystemContext(
quota_manager_proxy->RegisterClient(CreateQuotaClient(
this, options.is_incognito()));
}
+
#if defined(OS_CHROMEOS)
- // TODO(tbarzic): Pass this through ctor.
- scoped_refptr<ExternalMountPoints> external_mount_points =
- ExternalMountPoints::CreateRefCounted();
- // |external_provider_| will take a reference or external_mount_points so this
- // doesn't have to retain one for itself.
+ DCHECK(external_mount_points);
external_provider_.reset(
new chromeos::CrosMountPointProvider(
special_storage_policy,
external_mount_points,
ExternalMountPoints::GetSystemInstance()));
- url_crackers_.push_back(external_mount_points.get());
#endif
+ if (external_mount_points)
+ url_crackers_.push_back(external_mount_points);
url_crackers_.push_back(ExternalMountPoints::GetSystemInstance());
url_crackers_.push_back(IsolatedContext::GetInstance());
}
diff --git a/webkit/fileapi/file_system_context.h b/webkit/fileapi/file_system_context.h
index 4dd496f..55e79a3 100644
--- a/webkit/fileapi/file_system_context.h
+++ b/webkit/fileapi/file_system_context.h
@@ -62,8 +62,15 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext
// task_runners->file_task_runner()->RunsTasksOnCurrentThread()
// returns false if the current task is not running on the thread that allows
// blocking file operations (like SequencedWorkerPool implementation does).
+ //
+ // |external_mount_points| contains non-system external mount points available
+ // in the context. If not NULL, it will be used during URL cracking. On
+ // ChromeOS, it will be passed to external_mount_point_provider.
+ // |external_mount_points| may be NULL only on platforms different from
+ // ChromeOS (i.e. platforms that don't use external_mount_point_provider).
FileSystemContext(
scoped_ptr<FileSystemTaskRunners> task_runners,
+ ExternalMountPoints* external_mount_points,
quota::SpecialStoragePolicy* special_storage_policy,
quota::QuotaManagerProxy* quota_manager_proxy,
const FilePath& partition_path,
@@ -219,6 +226,10 @@ class WEBKIT_STORAGE_EXPORT FileSystemContext
// Registered mount point providers.
std::map<FileSystemType, FileSystemMountPointProvider*> provider_map_;
+ // External mount points visible in the file system context (excluding system
+ // external mount points).
+ scoped_refptr<ExternalMountPoints> external_mount_points_;
+
// MountPoints used to crack FileSystemURLs. The MountPoints are ordered
// in order they should try to crack a FileSystemURL.
std::vector<MountPoints*> url_crackers_;
diff --git a/webkit/fileapi/file_system_context_unittest.cc b/webkit/fileapi/file_system_context_unittest.cc
index c1ee85c..5155636 100644
--- a/webkit/fileapi/file_system_context_unittest.cc
+++ b/webkit/fileapi/file_system_context_unittest.cc
@@ -46,29 +46,28 @@ class FileSystemContextTest : public testing::Test {
void SetUp() {
ASSERT_TRUE(data_dir_.CreateUniqueTempDir());
- scoped_refptr<quota::SpecialStoragePolicy> storage_policy(
- new quota::MockSpecialStoragePolicy());
+ storage_policy_ = new quota::MockSpecialStoragePolicy();
mock_quota_manager_ = new quota::MockQuotaManager(
false /* is_incognito */,
data_dir_.path(),
base::MessageLoopProxy::current(),
base::MessageLoopProxy::current(),
- storage_policy);
+ storage_policy_);
+ }
- file_system_context_ = new FileSystemContext(
+ protected:
+ FileSystemContext* CreateFileSystemContextForTest(
+ ExternalMountPoints* external_mount_points) {
+ return new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
- storage_policy,
+ external_mount_points,
+ storage_policy_,
mock_quota_manager_->proxy(),
data_dir_.path(),
CreateAllowFileAccessOptions());
}
- protected:
- FileSystemContext* file_system_context() {
- return file_system_context_.get();
- }
-
// Verifies a *valid* filesystem url has expected values.
void ExpectFileSystemURLMatches(const FileSystemURL& url,
const GURL& expect_origin,
@@ -77,7 +76,7 @@ class FileSystemContextTest : public testing::Test {
const FilePath& expect_path,
const FilePath& expect_virtual_path,
const std::string& expect_filesystem_id) {
- ASSERT_TRUE(url.is_valid());
+ EXPECT_TRUE(url.is_valid());
EXPECT_EQ(expect_origin, url.origin());
EXPECT_EQ(expect_mount_type, url.mount_type());
@@ -90,11 +89,101 @@ class FileSystemContextTest : public testing::Test {
private:
base::ScopedTempDir data_dir_;
MessageLoop message_loop_;
+ scoped_refptr<quota::SpecialStoragePolicy> storage_policy_;
scoped_refptr<quota::MockQuotaManager> mock_quota_manager_;
- scoped_refptr<FileSystemContext> file_system_context_;
};
+// It is not valid to pass NULL ExternalMountPoints to FileSystemContext on
+// ChromeOS.
+#if !defined(OS_CHROMEOS)
+TEST_F(FileSystemContextTest, NullExternalMountPoints) {
+ scoped_refptr<FileSystemContext> file_system_context(
+ CreateFileSystemContextForTest(NULL));
+
+ // Cracking system external mount and isolated mount points should work.
+ std::string isolated_name = "root";
+ std::string isolated_id =
+ IsolatedContext::GetInstance()->RegisterFileSystemForPath(
+ kFileSystemTypeNativeLocal,
+ FilePath(DRIVE FPL("/test/isolated/root")),
+ &isolated_name);
+ // Register system external mount point.
+ ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
+ "system",
+ kFileSystemTypeNativeLocal,
+ FilePath(DRIVE FPL("/test/sys/"))));
+
+ FileSystemURL cracked_isolated = file_system_context->CrackURL(
+ CreateRawFileSystemURL("isolated", isolated_id));
+
+ ExpectFileSystemURLMatches(
+ cracked_isolated,
+ GURL(kTestOrigin),
+ kFileSystemTypeIsolated,
+ kFileSystemTypeNativeLocal,
+ FilePath(DRIVE FPL("/test/isolated/root/file")).NormalizePathSeparators(),
+ FilePath::FromUTF8Unsafe(isolated_id).Append(FPL("root/file")).
+ NormalizePathSeparators(),
+ isolated_id);
+
+ FileSystemURL cracked_external = file_system_context->CrackURL(
+ CreateRawFileSystemURL("external", "system"));
+
+ ExpectFileSystemURLMatches(
+ cracked_external,
+ GURL(kTestOrigin),
+ kFileSystemTypeExternal,
+ kFileSystemTypeNativeLocal,
+ FilePath(DRIVE FPL("/test/sys/root/file")).NormalizePathSeparators(),
+ FilePath(FPL("system/root/file")).NormalizePathSeparators(),
+ "system");
+
+
+ IsolatedContext::GetInstance()->RevokeFileSystem(isolated_id);
+ ExternalMountPoints::GetSystemInstance()->RevokeFileSystem("system");
+}
+#endif // !defiend(OS_CHROMEOS)
+
+TEST_F(FileSystemContextTest, FileSystemContextKeepsMountPointsAlive) {
+ scoped_refptr<ExternalMountPoints> mount_points =
+ ExternalMountPoints::CreateRefCounted();
+
+ // Register system external mount point.
+ ASSERT_TRUE(mount_points->RegisterFileSystem(
+ "system",
+ kFileSystemTypeNativeLocal,
+ FilePath(DRIVE FPL("/test/sys/"))));
+
+ scoped_refptr<FileSystemContext> file_system_context(
+ CreateFileSystemContextForTest(mount_points.get()));
+
+ // Release a MountPoints reference created in the test.
+ mount_points = NULL;
+
+ // FileSystemContext should keep a reference to the |mount_points|, so it
+ // should be able to resolve the URL.
+ FileSystemURL cracked_external = file_system_context->CrackURL(
+ CreateRawFileSystemURL("external", "system"));
+
+ ExpectFileSystemURLMatches(
+ cracked_external,
+ GURL(kTestOrigin),
+ kFileSystemTypeExternal,
+ kFileSystemTypeNativeLocal,
+ FilePath(DRIVE FPL("/test/sys/root/file")).NormalizePathSeparators(),
+ FilePath(FPL("system/root/file")).NormalizePathSeparators(),
+ "system");
+
+ // No need to revoke the registered filesystem since |mount_points| lifetime
+ // is bound to this test.
+}
+
TEST_F(FileSystemContextTest, CrackFileSystemURL) {
+ scoped_refptr<ExternalMountPoints> external_mount_points(
+ ExternalMountPoints::CreateRefCounted());
+ scoped_refptr<FileSystemContext> file_system_context(
+ CreateFileSystemContextForTest(external_mount_points));
+
// Register an isolated mount point.
std::string isolated_file_system_name = "root";
const std::string kIsolatedFileSystemID =
@@ -107,12 +196,25 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
"system",
kFileSystemTypeDrive,
FilePath(DRIVE FPL("/test/sys/"))));
+ ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
+ "ext",
+ kFileSystemTypeNativeLocal,
+ FilePath(DRIVE FPL("/test/ext"))));
// Register a system external mount point with the same name/id as the
// registered isolated mount point.
ASSERT_TRUE(ExternalMountPoints::GetSystemInstance()->RegisterFileSystem(
kIsolatedFileSystemID,
kFileSystemTypeRestrictedNativeLocal,
FilePath(DRIVE FPL("/test/system/isolated"))));
+ // Add a mount points with the same name as a system mount point to
+ // FileSystemContext's external mount points.
+ ASSERT_TRUE(external_mount_points->RegisterFileSystem(
+ "ext",
+ kFileSystemTypeNativeLocal,
+ FilePath(DRIVE FPL("/test/local/ext/"))));
+
+ const GURL kTestOrigin = GURL("http://chromium.org/");
+ const FilePath kVirtualPathNoRoot = FilePath(FPL("root/file"));
struct TestCase {
// Test case values.
@@ -163,6 +265,13 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
false /* virtual path empty */,
kIsolatedFileSystemID
},
+ // Should be cracked by FileSystemContext's ExternalMountPoints.
+ {
+ "ext", "external", true /* is_valid */,
+ kFileSystemTypeExternal, kFileSystemTypeNativeLocal,
+ DRIVE FPL("/test/local/ext/root/file"), false /* virtual path empty */,
+ "ext"
+ },
// Test for invalid filesystem url (made invalid by adding invalid
// filesystem type).
{
@@ -186,7 +295,7 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
GURL raw_url =
CreateRawFileSystemURL(kTestCases[i].type_str, kTestCases[i].root);
- FileSystemURL cracked_url = file_system_context()->CrackURL(raw_url);
+ FileSystemURL cracked_url = file_system_context->CrackURL(raw_url);
SCOPED_TRACE(testing::Message() << "Test case " << i << ": "
<< "Cracking URL: " << raw_url);
@@ -209,6 +318,7 @@ TEST_F(FileSystemContextTest, CrackFileSystemURL) {
IsolatedContext::GetInstance()->RevokeFileSystemByPath(
FilePath(DRIVE FPL("/test/isolated/root")));
ExternalMountPoints::GetSystemInstance()->RevokeFileSystem("system");
+ ExternalMountPoints::GetSystemInstance()->RevokeFileSystem("ext");
ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(
kIsolatedFileSystemID);
}
diff --git a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc
index 5892171..0af56c4 100644
--- a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc
+++ b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc
@@ -22,6 +22,7 @@
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/icu/public/i18n/unicode/regex.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_operation_context.h"
@@ -54,6 +55,7 @@ class FileSystemDirURLRequestJobTest : public testing::Test {
file_system_context_ =
new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
special_storage_policy_, NULL,
temp_dir_.path(),
CreateAllowFileAccessOptions());
diff --git a/webkit/fileapi/file_system_file_stream_reader_unittest.cc b/webkit/fileapi/file_system_file_stream_reader_unittest.cc
index ad9886a..55d0b9fd 100644
--- a/webkit/fileapi/file_system_file_stream_reader_unittest.cc
+++ b/webkit/fileapi/file_system_file_stream_reader_unittest.cc
@@ -15,6 +15,7 @@
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_operation_context.h"
@@ -72,6 +73,7 @@ class FileSystemFileStreamReaderTest : public testing::Test {
file_system_context_ =
new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
special_storage_policy_,
NULL,
temp_dir_.path(),
diff --git a/webkit/fileapi/file_system_mount_point_provider_unittest.cc b/webkit/fileapi/file_system_mount_point_provider_unittest.cc
index 405c3ce..4c7fa52 100644
--- a/webkit/fileapi/file_system_mount_point_provider_unittest.cc
+++ b/webkit/fileapi/file_system_mount_point_provider_unittest.cc
@@ -18,6 +18,7 @@
#include "base/utf_string_conversions.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_task_runners.h"
#include "webkit/fileapi/file_system_url.h"
@@ -213,6 +214,7 @@ class FileSystemMountPointProviderTest : public testing::Test {
void SetupNewContext(const FileSystemOptions& options) {
file_system_context_ = new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
special_storage_policy_,
NULL,
data_dir_.path(),
diff --git a/webkit/fileapi/file_system_quota_client_unittest.cc b/webkit/fileapi/file_system_quota_client_unittest.cc
index 24137eb..ae858e0 100644
--- a/webkit/fileapi/file_system_quota_client_unittest.cc
+++ b/webkit/fileapi/file_system_quota_client_unittest.cc
@@ -11,6 +11,7 @@
#include "base/platform_file.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation_context.h"
#include "webkit/fileapi/file_system_quota_client.h"
@@ -49,6 +50,7 @@ class FileSystemQuotaClientTest : public testing::Test {
file_system_context_ =
new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
NULL, NULL,
data_dir_.path(),
CreateDisallowFileAccessOptions());
diff --git a/webkit/fileapi/file_system_url_request_job_unittest.cc b/webkit/fileapi/file_system_url_request_job_unittest.cc
index 2605d76..5168886 100644
--- a/webkit/fileapi/file_system_url_request_job_unittest.cc
+++ b/webkit/fileapi/file_system_url_request_job_unittest.cc
@@ -28,6 +28,7 @@
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_operation_context.h"
@@ -65,6 +66,7 @@ class FileSystemURLRequestJobTest : public testing::Test {
file_system_context_ =
new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
special_storage_policy_, NULL,
temp_dir_.path(),
CreateDisallowFileAccessOptions());
diff --git a/webkit/fileapi/isolated_file_util_unittest.cc b/webkit/fileapi/isolated_file_util_unittest.cc
index 949b244..06c1a34 100644
--- a/webkit/fileapi/isolated_file_util_unittest.cc
+++ b/webkit/fileapi/isolated_file_util_unittest.cc
@@ -14,6 +14,7 @@
#include "base/message_loop_proxy.h"
#include "base/time.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation_context.h"
#include "webkit/fileapi/file_system_task_runners.h"
@@ -78,6 +79,7 @@ class IsolatedFileUtilTest : public testing::Test {
file_system_context_ = new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
make_scoped_refptr(new quota::MockSpecialStoragePolicy()),
NULL /* quota_manager */,
partition_dir_.path(),
diff --git a/webkit/fileapi/local_file_system_test_helper.cc b/webkit/fileapi/local_file_system_test_helper.cc
index a71a799..bbc9b2d 100644
--- a/webkit/fileapi/local_file_system_test_helper.cc
+++ b/webkit/fileapi/local_file_system_test_helper.cc
@@ -8,6 +8,7 @@
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
#include "googleurl/src/gurl.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation_context.h"
#include "webkit/fileapi/file_system_task_runners.h"
@@ -67,6 +68,7 @@ void LocalFileSystemTestOriginHelper::SetUp(
special_storage_policy->SetAllUnlimited(unlimited_quota);
file_system_context_ = new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
special_storage_policy,
quota_manager_proxy,
base_dir,
diff --git a/webkit/fileapi/media/native_media_file_util_unittest.cc b/webkit/fileapi/media/native_media_file_util_unittest.cc
index 66bffd3..48f9c29 100644
--- a/webkit/fileapi/media/native_media_file_util_unittest.cc
+++ b/webkit/fileapi/media/native_media_file_util_unittest.cc
@@ -12,6 +12,7 @@
#include "base/stringprintf.h"
#include "base/time.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation.h"
#include "webkit/fileapi/file_system_task_runners.h"
@@ -112,6 +113,7 @@ class NativeMediaFileUtilTest : public testing::Test {
file_system_context_ =
new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
storage_policy,
NULL,
data_dir_.path(),
diff --git a/webkit/fileapi/obfuscated_file_util_unittest.cc b/webkit/fileapi/obfuscated_file_util_unittest.cc
index af92761..f33bc6b 100644
--- a/webkit/fileapi/obfuscated_file_util_unittest.cc
+++ b/webkit/fileapi/obfuscated_file_util_unittest.cc
@@ -14,6 +14,7 @@
#include "base/message_loop.h"
#include "base/platform_file.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation_context.h"
#include "webkit/fileapi/file_system_task_runners.h"
@@ -123,6 +124,7 @@ class ObfuscatedFileUtilTest : public testing::Test {
// another OFU. We need to pass in the context to skip all that.
file_system_context_ = new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
storage_policy,
quota_manager_->proxy(),
data_dir_.path(),
diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.cc b/webkit/fileapi/syncable/canned_syncable_file_system.cc
index 0f72c17..e2746e5 100644
--- a/webkit/fileapi/syncable/canned_syncable_file_system.cc
+++ b/webkit/fileapi/syncable/canned_syncable_file_system.cc
@@ -205,6 +205,7 @@ void CannedSyncableFileSystem::SetUp() {
io_task_runner_,
file_task_runner_,
file_task_runner_)),
+ ExternalMountPoints::CreateRefCounted().get(),
storage_policy,
quota_manager_->proxy(),
data_dir_.path(),
diff --git a/webkit/fileapi/upload_file_system_file_element_reader_unittest.cc b/webkit/fileapi/upload_file_system_file_element_reader_unittest.cc
index 40128fe..4d9c7bef 100644
--- a/webkit/fileapi/upload_file_system_file_element_reader_unittest.cc
+++ b/webkit/fileapi/upload_file_system_file_element_reader_unittest.cc
@@ -9,6 +9,7 @@
#include "net/base/io_buffer.h"
#include "net/base/test_completion_callback.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_file_util.h"
#include "webkit/fileapi/file_system_operation_context.h"
@@ -36,6 +37,7 @@ class UploadFileSystemFileElementReaderTest : public testing::Test {
file_system_context_ = new fileapi::FileSystemContext(
fileapi::FileSystemTaskRunners::CreateMockTaskRunners(),
+ ExternalMountPoints::CreateRefCounted().get(),
NULL,
NULL,
temp_dir_.path(),
diff --git a/webkit/tools/test_shell/simple_file_system.cc b/webkit/tools/test_shell/simple_file_system.cc
index aace922..f665541 100644
--- a/webkit/tools/test_shell/simple_file_system.cc
+++ b/webkit/tools/test_shell/simple_file_system.cc
@@ -22,6 +22,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "webkit/base/file_path_string_conversions.h"
#include "webkit/blob/blob_storage_controller.h"
+#include "webkit/fileapi/external_mount_points.h"
#include "webkit/fileapi/file_system_task_runners.h"
#include "webkit/fileapi/file_system_url.h"
#include "webkit/fileapi/file_system_util.h"
@@ -77,6 +78,7 @@ SimpleFileSystem::SimpleFileSystem() {
if (file_system_dir_.CreateUniqueTempDir()) {
file_system_context_ = new FileSystemContext(
FileSystemTaskRunners::CreateMockTaskRunners(),
+ fileapi::ExternalMountPoints::CreateRefCounted().get(),
NULL /* special storage policy */,
NULL /* quota manager */,
file_system_dir_.path(),