summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi
diff options
context:
space:
mode:
authortbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-14 07:14:20 +0000
committertbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-14 07:14:20 +0000
commit199263ee614a079d14f5114866ab0f99dde7c111 (patch)
tree0c7c21fded436c0a385cf131d3b78a85745a2325 /webkit/fileapi
parentec0720d24f63f8c2bedfd0b4afaf71314ac33a6c (diff)
downloadchromium_src-199263ee614a079d14f5114866ab0f99dde7c111.zip
chromium_src-199263ee614a079d14f5114866ab0f99dde7c111.tar.gz
chromium_src-199263ee614a079d14f5114866ab0f99dde7c111.tar.bz2
Change FileSystemMountPointProvider::GetFileSystemRootPathOnFileThread to take FileSystemURL
The only place GetFileSystemRootPathOnFileThread is called in production, the args are extracted from a FileSystemURL instance, so why not just pass that object to the method.. BUG=None TEST=None (trybots) Review URL: https://chromiumcodereview.appspot.com/11555013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r--webkit/fileapi/file_system_mount_point_provider.h6
-rw-r--r--webkit/fileapi/file_system_mount_point_provider_unittest.cc3
-rw-r--r--webkit/fileapi/isolated_mount_point_provider.cc4
-rw-r--r--webkit/fileapi/isolated_mount_point_provider.h4
-rw-r--r--webkit/fileapi/local_file_system_test_helper.cc7
-rw-r--r--webkit/fileapi/local_file_util.cc3
-rw-r--r--webkit/fileapi/sandbox_mount_point_provider.cc6
-rw-r--r--webkit/fileapi/sandbox_mount_point_provider.h4
-rw-r--r--webkit/fileapi/test_mount_point_provider.cc6
-rw-r--r--webkit/fileapi/test_mount_point_provider.h4
10 files changed, 18 insertions, 29 deletions
diff --git a/webkit/fileapi/file_system_mount_point_provider.h b/webkit/fileapi/file_system_mount_point_provider.h
index 097932a..7e2ef11 100644
--- a/webkit/fileapi/file_system_mount_point_provider.h
+++ b/webkit/fileapi/file_system_mount_point_provider.h
@@ -51,13 +51,11 @@ class WEBKIT_STORAGE_EXPORT FileSystemMountPointProvider {
const ValidateFileSystemCallback& callback) = 0;
// Retrieves the root path of the filesystem specified by the given
- // |origin_url| and |type| on the file thread.
+ // file system url on the file thread.
// If |create| is true this may also create the root directory for
// the filesystem if it doesn't exist.
virtual FilePath GetFileSystemRootPathOnFileThread(
- const GURL& origin_url,
- FileSystemType type,
- const FilePath& virtual_path,
+ const FileSystemURL& url,
bool create) = 0;
// Checks if access to |virtual_path| is allowed from |origin_url|.
diff --git a/webkit/fileapi/file_system_mount_point_provider_unittest.cc b/webkit/fileapi/file_system_mount_point_provider_unittest.cc
index 81c48eb..9c925a0 100644
--- a/webkit/fileapi/file_system_mount_point_provider_unittest.cc
+++ b/webkit/fileapi/file_system_mount_point_provider_unittest.cc
@@ -20,6 +20,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_task_runners.h"
+#include "webkit/fileapi/file_system_url.h"
#include "webkit/fileapi/file_system_util.h"
#include "webkit/fileapi/mock_file_system_options.h"
#include "webkit/fileapi/sandbox_mount_point_provider.h"
@@ -237,7 +238,7 @@ class FileSystemMountPointProviderTest : public testing::Test {
virtual_path = FilePath(kVirtualPath);
FilePath returned_root_path =
provider(type)->GetFileSystemRootPathOnFileThread(
- origin_url, type, virtual_path, create);
+ FileSystemURL(origin_url, type, virtual_path), create);
if (root_path)
*root_path = returned_root_path;
return !returned_root_path.empty();
diff --git a/webkit/fileapi/isolated_mount_point_provider.cc b/webkit/fileapi/isolated_mount_point_provider.cc
index e94d3a5..7e72f4a 100644
--- a/webkit/fileapi/isolated_mount_point_provider.cc
+++ b/webkit/fileapi/isolated_mount_point_provider.cc
@@ -62,9 +62,7 @@ void IsolatedMountPointProvider::ValidateFileSystemRoot(
}
FilePath IsolatedMountPointProvider::GetFileSystemRootPathOnFileThread(
- const GURL& origin_url,
- FileSystemType type,
- const FilePath& virtual_path,
+ const FileSystemURL& url,
bool create) {
// This is not supposed to be used.
NOTREACHED();
diff --git a/webkit/fileapi/isolated_mount_point_provider.h b/webkit/fileapi/isolated_mount_point_provider.h
index 641b810..659a711 100644
--- a/webkit/fileapi/isolated_mount_point_provider.h
+++ b/webkit/fileapi/isolated_mount_point_provider.h
@@ -36,9 +36,7 @@ class IsolatedMountPointProvider : public FileSystemMountPointProvider {
bool create,
const ValidateFileSystemCallback& callback) OVERRIDE;
virtual FilePath GetFileSystemRootPathOnFileThread(
- const GURL& origin_url,
- FileSystemType type,
- const FilePath& virtual_path,
+ const FileSystemURL& url,
bool create) OVERRIDE;
virtual bool IsAccessAllowed(const FileSystemURL& url) OVERRIDE;
virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;
diff --git a/webkit/fileapi/local_file_system_test_helper.cc b/webkit/fileapi/local_file_system_test_helper.cc
index 1983c1e..59a7d25 100644
--- a/webkit/fileapi/local_file_system_test_helper.cc
+++ b/webkit/fileapi/local_file_system_test_helper.cc
@@ -11,6 +11,7 @@
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation_context.h"
#include "webkit/fileapi/file_system_task_runners.h"
+#include "webkit/fileapi/file_system_url.h"
#include "webkit/fileapi/file_system_usage_cache.h"
#include "webkit/fileapi/file_system_util.h"
#include "webkit/fileapi/file_util_helper.h"
@@ -52,7 +53,7 @@ void LocalFileSystemTestOriginHelper::SetUp(
// Prepare the origin's root directory.
file_system_context_->GetMountPointProvider(type_)->
GetFileSystemRootPathOnFileThread(
- origin_, type_, FilePath(), true /* create */);
+ FileSystemURL(origin_, type_, FilePath()), true /* create */);
// Initialize the usage cache file.
FilePath usage_cache_path = GetUsageCachePath();
@@ -87,7 +88,7 @@ void LocalFileSystemTestOriginHelper::SetUp(
FileSystemMountPointProvider* mount_point_provider =
file_system_context_->GetMountPointProvider(type_);
mount_point_provider->GetFileSystemRootPathOnFileThread(
- origin_, type_, FilePath(), true /* create */);
+ FileSystemURL(origin_, type_, FilePath()), true /* create */);
if (file_util)
file_util_ = file_util;
@@ -110,7 +111,7 @@ void LocalFileSystemTestOriginHelper::TearDown() {
FilePath LocalFileSystemTestOriginHelper::GetOriginRootPath() const {
return file_system_context_->GetMountPointProvider(type_)->
GetFileSystemRootPathOnFileThread(
- origin_, type_, FilePath(), false);
+ FileSystemURL(origin_, type_, FilePath()), false);
}
FilePath LocalFileSystemTestOriginHelper::GetLocalPath(const FilePath& path) {
diff --git a/webkit/fileapi/local_file_util.cc b/webkit/fileapi/local_file_util.cc
index 35f7110..58cb991 100644
--- a/webkit/fileapi/local_file_util.cc
+++ b/webkit/fileapi/local_file_util.cc
@@ -159,8 +159,7 @@ PlatformFileError LocalFileUtil::GetLocalFilePath(
FileSystemMountPointProvider* provider =
context->file_system_context()->GetMountPointProvider(url.type());
DCHECK(provider);
- FilePath root = provider->GetFileSystemRootPathOnFileThread(
- url.origin(), url.type(), url.path(), false);
+ FilePath root = provider->GetFileSystemRootPathOnFileThread(url, false);
if (root.empty())
return base::PLATFORM_FILE_ERROR_NOT_FOUND;
*local_file_path = root.Append(url.path());
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc
index 5d38081..8ffd144 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -210,16 +210,16 @@ void SandboxMountPointProvider::ValidateFileSystemRoot(
FilePath
SandboxMountPointProvider::GetFileSystemRootPathOnFileThread(
- const GURL& origin_url, FileSystemType type, const FilePath& unused,
+ const FileSystemURL& url,
bool create) {
if (file_system_options_.is_incognito())
// TODO(kinuko): return an isolated temporary directory.
return FilePath();
- if (!IsAllowedScheme(origin_url))
+ if (!IsAllowedScheme(url.origin()))
return FilePath();
- return GetBaseDirectoryForOriginAndType(origin_url, type, create);
+ return GetBaseDirectoryForOriginAndType(url.origin(), url.type(), create);
}
bool SandboxMountPointProvider::IsAccessAllowed(const FileSystemURL& url) {
diff --git a/webkit/fileapi/sandbox_mount_point_provider.h b/webkit/fileapi/sandbox_mount_point_provider.h
index 7b0eb51..5082a19 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.h
+++ b/webkit/fileapi/sandbox_mount_point_provider.h
@@ -81,9 +81,7 @@ class WEBKIT_STORAGE_EXPORT SandboxMountPointProvider
bool create,
const ValidateFileSystemCallback& callback) OVERRIDE;
virtual FilePath GetFileSystemRootPathOnFileThread(
- const GURL& origin_url,
- FileSystemType type,
- const FilePath& virtual_path,
+ const FileSystemURL& url,
bool create) OVERRIDE;
virtual bool IsAccessAllowed(const FileSystemURL& url) OVERRIDE;
virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;
diff --git a/webkit/fileapi/test_mount_point_provider.cc b/webkit/fileapi/test_mount_point_provider.cc
index 8e3e6b1..3cc3804 100644
--- a/webkit/fileapi/test_mount_point_provider.cc
+++ b/webkit/fileapi/test_mount_point_provider.cc
@@ -90,11 +90,9 @@ void TestMountPointProvider::ValidateFileSystemRoot(
}
FilePath TestMountPointProvider::GetFileSystemRootPathOnFileThread(
- const GURL& origin_url,
- FileSystemType type,
- const FilePath& virtual_path,
+ const FileSystemURL& url,
bool create) {
- DCHECK_EQ(kFileSystemTypeTest, type);
+ DCHECK_EQ(kFileSystemTypeTest, url.type());
bool success = true;
if (create)
success = file_util::CreateDirectory(base_path_);
diff --git a/webkit/fileapi/test_mount_point_provider.h b/webkit/fileapi/test_mount_point_provider.h
index a883a99..04ebef0 100644
--- a/webkit/fileapi/test_mount_point_provider.h
+++ b/webkit/fileapi/test_mount_point_provider.h
@@ -42,9 +42,7 @@ class WEBKIT_STORAGE_EXPORT_PRIVATE TestMountPointProvider
bool create,
const ValidateFileSystemCallback& callback) OVERRIDE;
virtual FilePath GetFileSystemRootPathOnFileThread(
- const GURL& origin_url,
- FileSystemType type,
- const FilePath& virtual_path,
+ const FileSystemURL& url,
bool create) OVERRIDE;
virtual bool IsAccessAllowed(const FileSystemURL& url) OVERRIDE;
virtual bool IsRestrictedFileName(const FilePath& filename) const OVERRIDE;