Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5165)

Unified Diff: chrome/browser/file_system/browser_file_system_context.cc

Issue 4054003: FileSystem code cleanup 2nd cut - introduce SandboxedFileSystemOperation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/file_system/browser_file_system_context.cc
diff --git a/chrome/browser/file_system/browser_file_system_context.cc b/chrome/browser/file_system/browser_file_system_context.cc
index 26428cbfad9e89010058b0fc20856fbbced701cd..bbc4806afdb25d3bde493c63766ea7cbbbaf4f73 100644
--- a/chrome/browser/file_system/browser_file_system_context.cc
+++ b/chrome/browser/file_system/browser_file_system_context.cc
@@ -7,41 +7,28 @@
#include "base/file_path.h"
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
-#include "webkit/fileapi/file_system_path_manager.h"
#include "webkit/fileapi/file_system_quota_manager.h"
-static inline bool GetAllowFileAccessFromFiles() {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAllowFileAccessFromFiles);
-}
-
BrowserFileSystemContext::BrowserFileSystemContext(
- const FilePath& data_path, bool is_incognito) {
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- bool allow_file_access_from_files =
- command_line->HasSwitch(switches::kAllowFileAccessFromFiles);
- bool unlimited_quota =
- command_line->HasSwitch(switches::kUnlimitedQuotaForFiles);
- quota_manager_.reset(new fileapi::FileSystemQuotaManager(
- allow_file_access_from_files, unlimited_quota));
- path_manager_.reset(new fileapi::FileSystemPathManager(
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
- data_path, is_incognito, allow_file_access_from_files));
-}
-
-bool BrowserFileSystemContext::CheckOriginQuota(const GURL& url, int64 growth) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- return quota_manager_->CheckOriginQuota(url, growth);
+ const FilePath& profile_path, bool is_incognito)
+ : fileapi::SandboxedFileSystemContext(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
+ profile_path,
+ is_incognito,
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAllowFileAccessFromFiles),
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUnlimitedQuotaForFiles)) {
}
void BrowserFileSystemContext::SetOriginQuotaUnlimited(const GURL& url) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- quota_manager_->SetOriginQuotaUnlimited(url);
+ quota_manager()->SetOriginQuotaUnlimited(url);
}
void BrowserFileSystemContext::ResetOriginQuotaUnlimited(const GURL& url) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- quota_manager_->ResetOriginQuotaUnlimited(url);
+ quota_manager()->ResetOriginQuotaUnlimited(url);
}
BrowserFileSystemContext::~BrowserFileSystemContext() {}
« no previous file with comments | « chrome/browser/file_system/browser_file_system_context.h ('k') | chrome/browser/file_system/file_system_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698