summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 00:24:46 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 00:24:46 +0000
commiteff5e88804ca872d3603a5123cd90164bb68a5dd (patch)
treeca61b4adb481419d81b641fbbbabb859ca6e98f8 /chrome/browser
parentb4d13c652373433d8f6b755bc68f670f187d2157 (diff)
downloadchromium_src-eff5e88804ca872d3603a5123cd90164bb68a5dd.zip
chromium_src-eff5e88804ca872d3603a5123cd90164bb68a5dd.tar.gz
chromium_src-eff5e88804ca872d3603a5123cd90164bb68a5dd.tar.bz2
Add a switch to grant unlimited file storage when running Pepper tests.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3853001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-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);
};