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

Unified Diff: chrome/browser/browsing_data/browsing_data_file_system_helper.cc

Issue 10909182: Make FileSystemContext respect StoragePartitions. filesystem:// urls will be properly isolated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: stupid regexp Created 8 years, 3 months 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/browsing_data/browsing_data_file_system_helper.cc
diff --git a/chrome/browser/browsing_data/browsing_data_file_system_helper.cc b/chrome/browser/browsing_data/browsing_data_file_system_helper.cc
index c1bd4320bee3a93aca0f305def8aee0ff78dc2fe..beac7dbbed8abde00068a67ae89c19bc0b242e5c 100644
--- a/chrome/browser/browsing_data/browsing_data_file_system_helper.cc
+++ b/chrome/browser/browsing_data/browsing_data_file_system_helper.cc
@@ -12,25 +12,28 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
-#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_quota_util.h"
#include "webkit/fileapi/file_system_types.h"
#include "webkit/fileapi/sandbox_mount_point_provider.h"
-using content::BrowserContext;
using content::BrowserThread;
+namespace fileapi {
+class FileSystemContext;
+}
+
namespace {
// An implementation of the BrowsingDataFileSystemHelper interface that pulls
-// data from a given |profile| and returns a list of FileSystemInfo items to a
-// client.
+// data from a given |filesystem_context| and returns a list of FileSystemInfo
+// items to a client.
class BrowsingDataFileSystemHelperImpl : public BrowsingDataFileSystemHelper {
public:
// BrowsingDataFileSystemHelper implementation
- explicit BrowsingDataFileSystemHelperImpl(Profile* profile);
+ explicit BrowsingDataFileSystemHelperImpl(
+ fileapi::FileSystemContext* filesystem_context);
virtual void StartFetching(const base::Callback<
void(const std::list<FileSystemInfo>&)>& callback) OVERRIDE;
virtual void DeleteFileSystemOrigin(const GURL& origin) OVERRIDE;
@@ -77,8 +80,8 @@ class BrowsingDataFileSystemHelperImpl : public BrowsingDataFileSystemHelper {
};
BrowsingDataFileSystemHelperImpl::BrowsingDataFileSystemHelperImpl(
- Profile* profile)
- : filesystem_context_(BrowserContext::GetFileSystemContext(profile)),
+ fileapi::FileSystemContext* filesystem_context)
+ : filesystem_context_(filesystem_context),
is_fetching_(false) {
DCHECK(filesystem_context_);
}
@@ -184,8 +187,8 @@ BrowsingDataFileSystemHelper::FileSystemInfo::~FileSystemInfo() {}
// static
BrowsingDataFileSystemHelper* BrowsingDataFileSystemHelper::Create(
- Profile* profile) {
- return new BrowsingDataFileSystemHelperImpl(profile);
+ fileapi::FileSystemContext* filesystem_context) {
+ return new BrowsingDataFileSystemHelperImpl(filesystem_context);
}
CannedBrowsingDataFileSystemHelper::CannedBrowsingDataFileSystemHelper(
@@ -219,16 +222,16 @@ void CannedBrowsingDataFileSystemHelper::AddFileSystem(
// we should think about reworking the implementation.
bool duplicate_origin = false;
for (std::list<FileSystemInfo>::iterator
- file_system = file_system_info_.begin();
- file_system != file_system_info_.end();
- ++file_system) {
- if (file_system->origin == origin) {
+ filesystem = file_system_info_.begin();
Charlie Reis 2012/09/17 22:51:12 Ok, but why? (Was this another regexp victim? Ma
awong 2012/09/17 23:10:20 reverted.
+ filesystem != file_system_info_.end();
+ ++filesystem) {
+ if (filesystem->origin == origin) {
if (type == fileapi::kFileSystemTypePersistent) {
- file_system->has_persistent = true;
- file_system->usage_persistent = size;
+ filesystem->has_persistent = true;
+ filesystem->usage_persistent = size;
} else {
- file_system->has_temporary = true;
- file_system->usage_temporary = size;
+ filesystem->has_temporary = true;
+ filesystem->usage_temporary = size;
}
duplicate_origin = true;
break;

Powered by Google App Engine
This is Rietveld 408576698