summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi
diff options
context:
space:
mode:
authordpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 13:54:13 +0000
committerdpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 13:54:13 +0000
commit9cf2d7c7142dea5f267dc106d4eea927b93c2c69 (patch)
tree27fe6b28d50f4a647e3694d3e18484bf57600cee /webkit/fileapi
parent724627096557e1a93ae8fea1e8dc601a854dab48 (diff)
downloadchromium_src-9cf2d7c7142dea5f267dc106d4eea927b93c2c69.zip
chromium_src-9cf2d7c7142dea5f267dc106d4eea927b93c2c69.tar.gz
chromium_src-9cf2d7c7142dea5f267dc106d4eea927b93c2c69.tar.bz2
Enable HTML5 temporary file system for Quickoffice component extension
Alternative solution instead of https://codereview.chromium.org/13850003/ BUG=225350 TEST=manual Review URL: https://codereview.chromium.org/13951004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r--webkit/fileapi/sandbox_mount_point_provider.cc10
-rw-r--r--webkit/fileapi/sandbox_mount_point_provider.h5
2 files changed, 13 insertions, 2 deletions
diff --git a/webkit/fileapi/sandbox_mount_point_provider.cc b/webkit/fileapi/sandbox_mount_point_provider.cc
index 9d65b49..5180a05 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.cc
+++ b/webkit/fileapi/sandbox_mount_point_provider.cc
@@ -145,6 +145,7 @@ SandboxMountPointProvider::SandboxMountPointProvider(
: file_task_runner_(file_task_runner),
profile_path_(profile_path),
file_system_options_(file_system_options),
+ enable_temporary_file_system_in_incognito_(false),
sandbox_file_util_(
new AsyncFileUtilAdapter(
new ObfuscatedFileUtil(
@@ -195,7 +196,9 @@ bool SandboxMountPointProvider::CanHandleType(FileSystemType type) const {
void SandboxMountPointProvider::ValidateFileSystemRoot(
const GURL& origin_url, fileapi::FileSystemType type, bool create,
const ValidateFileSystemCallback& callback) {
- if (file_system_options_.is_incognito()) {
+ if (file_system_options_.is_incognito() &&
+ !(type == kFileSystemTypeTemporary &&
+ enable_temporary_file_system_in_incognito_)) {
// TODO(kinuko): return an isolated temporary directory.
callback.Run(base::PLATFORM_FILE_ERROR_SECURITY);
UMA_HISTOGRAM_ENUMERATION(kOpenFileSystemLabel,
@@ -239,9 +242,12 @@ base::FilePath
SandboxMountPointProvider::GetFileSystemRootPathOnFileThread(
const FileSystemURL& url,
bool create) {
- if (file_system_options_.is_incognito())
+ if (file_system_options_.is_incognito() &&
+ !(enable_temporary_file_system_in_incognito_ &&
+ url.type() == kFileSystemTypeTemporary)) {
// TODO(kinuko): return an isolated temporary directory.
return base::FilePath();
+ }
if (!IsAllowedScheme(url.origin()))
return base::FilePath();
diff --git a/webkit/fileapi/sandbox_mount_point_provider.h b/webkit/fileapi/sandbox_mount_point_provider.h
index dd7c38d..8456879 100644
--- a/webkit/fileapi/sandbox_mount_point_provider.h
+++ b/webkit/fileapi/sandbox_mount_point_provider.h
@@ -173,6 +173,10 @@ class WEBKIT_STORAGE_EXPORT SandboxMountPointProvider
LocalFileSystemOperation* CreateFileSystemOperationForSync(
FileSystemContext* file_system_context);
+ void set_enable_temporary_file_system_in_incognito(bool enable) {
+ enable_temporary_file_system_in_incognito_ = enable;
+ }
+
private:
friend class SandboxQuotaObserver;
friend class LocalFileSystemTestOriginHelper;
@@ -212,6 +216,7 @@ class WEBKIT_STORAGE_EXPORT SandboxMountPointProvider
const base::FilePath profile_path_;
FileSystemOptions file_system_options_;
+ bool enable_temporary_file_system_in_incognito_;
scoped_ptr<AsyncFileUtilAdapter> sandbox_file_util_;