summaryrefslogtreecommitdiffstats
path: root/chrome/browser/file_system
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/file_system')
-rw-r--r--chrome/browser/file_system/file_system_host_context.cc15
-rw-r--r--chrome/browser/file_system/file_system_host_context.h5
2 files changed, 13 insertions, 7 deletions
diff --git a/chrome/browser/file_system/file_system_host_context.cc b/chrome/browser/file_system/file_system_host_context.cc
index e94c326..54f8056 100644
--- a/chrome/browser/file_system/file_system_host_context.cc
+++ b/chrome/browser/file_system/file_system_host_context.cc
@@ -15,19 +15,24 @@
FileSystemHostContext::FileSystemHostContext(
const FilePath& data_path, bool is_incognito)
- : allow_file_access_from_files_(CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAllowFileAccessFromFiles)),
- quota_manager_(new fileapi::FileSystemQuota()),
+ : quota_manager_(new fileapi::FileSystemQuota()),
path_manager_(new fileapi::FileSystemPathManager(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
data_path, is_incognito, allow_file_access_from_files_)) {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ allow_file_access_from_files_ =
+ command_line->HasSwitch(switches::kAllowFileAccessFromFiles);
+ unlimited_quota_ =
+ command_line->HasSwitch(switches::kUnlimitedQuotaForFiles);
}
bool FileSystemHostContext::CheckOriginQuota(const GURL& url, int64 growth) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
// If allow-file-access-from-files flag is explicitly given and the scheme
- // is file, always return true.
- if (url.SchemeIsFile() && allow_file_access_from_files_)
+ // is file, or if unlimited quota for this process was explicitly requested,
+ // return true.
+ if (unlimited_quota_ ||
+ (url.SchemeIsFile() && allow_file_access_from_files_))
return true;
return quota_manager_->CheckOriginQuota(url, growth);
}
diff --git a/chrome/browser/file_system/file_system_host_context.h b/chrome/browser/file_system/file_system_host_context.h
index 1575c97..ddb0bf2 100644
--- a/chrome/browser/file_system/file_system_host_context.h
+++ b/chrome/browser/file_system/file_system_host_context.h
@@ -32,11 +32,12 @@ class FileSystemHostContext
fileapi::FileSystemPathManager* path_manager() { return path_manager_.get(); }
private:
- bool allow_file_access_from_files_;
-
scoped_ptr<fileapi::FileSystemQuota> quota_manager_;
scoped_ptr<fileapi::FileSystemPathManager> path_manager_;
+ bool allow_file_access_from_files_;
+ bool unlimited_quota_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemHostContext);
};