diff options
author | pilgrim@chromium.org <pilgrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-22 19:58:31 +0000 |
---|---|---|
committer | pilgrim@chromium.org <pilgrim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-22 20:01:57 +0000 |
commit | cd501a7565dd6054a120fbfe62d45b2299cfcc3b (patch) | |
tree | efe35c31d00f40b2fa9e6dbafd5f9f694f47367e /chrome/browser/browsing_data | |
parent | 604e202d3548b701900c3771f9517103bb91486c (diff) | |
download | chromium_src-cd501a7565dd6054a120fbfe62d45b2299cfcc3b.zip chromium_src-cd501a7565dd6054a120fbfe62d45b2299cfcc3b.tar.gz chromium_src-cd501a7565dd6054a120fbfe62d45b2299cfcc3b.tar.bz2 |
Collapse fileapi, webkit_blob, webkit_database, quota, and webkit_common namespaces into single storage namespace
As discussed here:
https://groups.google.com/a/chromium.org/forum/#!topic/storage-dev/aQall8GOrS4
BUG=338338
TBR=cevans
NOTRY=true
Review URL: https://codereview.chromium.org/492873002
Cr-Commit-Position: refs/heads/master@{#291485}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data')
18 files changed, 125 insertions, 121 deletions
diff --git a/chrome/browser/browsing_data/browsing_data_database_helper.cc b/chrome/browser/browsing_data/browsing_data_database_helper.cc index aba40de..c54bd12 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper.cc @@ -20,7 +20,7 @@ using content::BrowserContext; using content::BrowserThread; -using webkit_database::DatabaseIdentifier; +using storage::DatabaseIdentifier; BrowsingDataDatabaseHelper::DatabaseInfo::DatabaseInfo( const DatabaseIdentifier& identifier, @@ -72,10 +72,12 @@ void BrowsingDataDatabaseHelper::DeleteDatabase(const std::string& origin, void BrowsingDataDatabaseHelper::FetchDatabaseInfoOnFileThread() { DCHECK_CURRENTLY_ON(BrowserThread::FILE); - std::vector<webkit_database::OriginInfo> origins_info; + std::vector<storage::OriginInfo> origins_info; if (tracker_.get() && tracker_->GetAllOriginsInfo(&origins_info)) { - for (std::vector<webkit_database::OriginInfo>::const_iterator ori = - origins_info.begin(); ori != origins_info.end(); ++ori) { + for (std::vector<storage::OriginInfo>::const_iterator ori = + origins_info.begin(); + ori != origins_info.end(); + ++ori) { DatabaseIdentifier identifier = DatabaseIdentifier::Parse(ori->GetOriginIdentifier()); if (!BrowsingDataHelper::HasWebScheme(identifier.ToOrigin())) { @@ -217,7 +219,7 @@ void CannedBrowsingDataDatabaseHelper::DeleteDatabase( const std::string& origin_identifier, const std::string& name) { GURL origin = - webkit_database::DatabaseIdentifier::Parse(origin_identifier).ToOrigin(); + storage::DatabaseIdentifier::Parse(origin_identifier).ToOrigin(); for (std::set<PendingDatabaseInfo>::iterator it = pending_database_info_.begin(); it != pending_database_info_.end(); diff --git a/chrome/browser/browsing_data/browsing_data_database_helper.h b/chrome/browser/browsing_data/browsing_data_database_helper.h index 6c5086d..b714f01 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper.h +++ b/chrome/browser/browsing_data/browsing_data_database_helper.h @@ -30,14 +30,14 @@ class BrowsingDataDatabaseHelper public: // Contains detailed information about a web database. struct DatabaseInfo { - DatabaseInfo(const webkit_database::DatabaseIdentifier& identifier, + DatabaseInfo(const storage::DatabaseIdentifier& identifier, const std::string& database_name, const std::string& description, int64 size, base::Time last_modified); ~DatabaseInfo(); - webkit_database::DatabaseIdentifier identifier; + storage::DatabaseIdentifier identifier; std::string database_name; std::string description; int64 size; @@ -89,7 +89,7 @@ class BrowsingDataDatabaseHelper void DeleteDatabaseOnFileThread(const std::string& origin, const std::string& name); - scoped_refptr<webkit_database::DatabaseTracker> tracker_; + scoped_refptr<storage::DatabaseTracker> tracker_; DISALLOW_COPY_AND_ASSIGN(BrowsingDataDatabaseHelper); }; diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc index bbec15d..9eeb1b7 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc @@ -30,9 +30,9 @@ const char kTestIdentifierExtension[] = class BrowsingDataDatabaseHelperTest : public InProcessBrowserTest { public: virtual void CreateDatabases() { - webkit_database::DatabaseTracker* db_tracker = - BrowserContext::GetDefaultStoragePartition(browser()->profile())-> - GetDatabaseTracker(); + storage::DatabaseTracker* db_tracker = + BrowserContext::GetDefaultStoragePartition(browser()->profile()) + ->GetDatabaseTracker(); base::string16 db_name = base::ASCIIToUTF16("db"); base::string16 description = base::ASCIIToUTF16("db_description"); int64 size; @@ -50,7 +50,7 @@ class BrowsingDataDatabaseHelperTest : public InProcessBrowserTest { db_tracker->GetFullDBFilePath(kTestIdentifierExtension, db_name); base::CreateDirectory(db_path2.DirName()); ASSERT_EQ(0, base::WriteFile(db_path2, NULL, 0)); - std::vector<webkit_database::OriginInfo> origins; + std::vector<storage::OriginInfo> origins; db_tracker->GetAllOriginsInfo(&origins); ASSERT_EQ(2U, origins.size()); } diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc index 0663ee0..01812f9 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc @@ -11,7 +11,7 @@ namespace { -using webkit_database::DatabaseIdentifier; +using storage::DatabaseIdentifier; class CannedBrowsingDataDatabaseHelperTest : public testing::Test { content::TestBrowserThreadBundle thread_bundle_; 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 14ccbbc..f89c795 100644 --- a/chrome/browser/browsing_data/browsing_data_file_system_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_file_system_helper.cc @@ -20,7 +20,7 @@ using content::BrowserThread; -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -33,7 +33,7 @@ class BrowsingDataFileSystemHelperImpl : public BrowsingDataFileSystemHelper { public: // BrowsingDataFileSystemHelper implementation explicit BrowsingDataFileSystemHelperImpl( - fileapi::FileSystemContext* filesystem_context); + storage::FileSystemContext* filesystem_context); virtual void StartFetching(const base::Callback< void(const std::list<FileSystemInfo>&)>& callback) OVERRIDE; virtual void DeleteFileSystemOrigin(const GURL& origin) OVERRIDE; @@ -61,7 +61,7 @@ class BrowsingDataFileSystemHelperImpl : public BrowsingDataFileSystemHelper { // Keep a reference to the FileSystemContext object for the current profile // for use on the file task runner. - scoped_refptr<fileapi::FileSystemContext> filesystem_context_; + scoped_refptr<storage::FileSystemContext> filesystem_context_; // Holds the current list of file systems returned to the client after // StartFetching is called. Access to |file_system_info_| is triggered @@ -86,9 +86,8 @@ class BrowsingDataFileSystemHelperImpl : public BrowsingDataFileSystemHelper { }; BrowsingDataFileSystemHelperImpl::BrowsingDataFileSystemHelperImpl( - fileapi::FileSystemContext* filesystem_context) - : filesystem_context_(filesystem_context), - is_fetching_(false) { + storage::FileSystemContext* filesystem_context) + : filesystem_context_(filesystem_context), is_fetching_(false) { DCHECK(filesystem_context_.get()); } @@ -123,20 +122,20 @@ void BrowsingDataFileSystemHelperImpl::FetchFileSystemInfoInFileThread() { DCHECK(file_task_runner()->RunsTasksOnCurrentThread()); // We check usage for these filesystem types. - const fileapi::FileSystemType types[] = { - fileapi::kFileSystemTypeTemporary, - fileapi::kFileSystemTypePersistent, + const storage::FileSystemType types[] = { + storage::kFileSystemTypeTemporary, + storage::kFileSystemTypePersistent, #if defined(ENABLE_EXTENSIONS) - fileapi::kFileSystemTypeSyncable, + storage::kFileSystemTypeSyncable, #endif }; typedef std::map<GURL, FileSystemInfo> OriginInfoMap; OriginInfoMap file_system_info_map; for (size_t i = 0; i < arraysize(types); ++i) { - fileapi::FileSystemType type = types[i]; - fileapi::FileSystemQuotaUtil* quota_util = - filesystem_context_->GetQuotaUtil(type); + storage::FileSystemType type = types[i]; + storage::FileSystemQuotaUtil* quota_util = + filesystem_context_->GetQuotaUtil(type); DCHECK(quota_util); std::set<GURL> origins; quota_util->GetOriginsForTypeOnFileTaskRunner(type, &origins); @@ -187,7 +186,7 @@ BrowsingDataFileSystemHelper::FileSystemInfo::~FileSystemInfo() {} // static BrowsingDataFileSystemHelper* BrowsingDataFileSystemHelper::Create( - fileapi::FileSystemContext* filesystem_context) { + storage::FileSystemContext* filesystem_context) { return new BrowsingDataFileSystemHelperImpl(filesystem_context); } @@ -212,7 +211,9 @@ CannedBrowsingDataFileSystemHelper* } void CannedBrowsingDataFileSystemHelper::AddFileSystem( - const GURL& origin, const fileapi::FileSystemType type, const int64 size) { + const GURL& origin, + const storage::FileSystemType type, + const int64 size) { DCHECK_CURRENTLY_ON(BrowserThread::UI); // This canned implementation of AddFileSystem uses an O(n^2) algorithm; which // is fine, as it isn't meant for use in a high-volume context. If it turns diff --git a/chrome/browser/browsing_data/browsing_data_file_system_helper.h b/chrome/browser/browsing_data/browsing_data_file_system_helper.h index 97e223f..21a23af 100644 --- a/chrome/browser/browsing_data/browsing_data_file_system_helper.h +++ b/chrome/browser/browsing_data/browsing_data_file_system_helper.h @@ -18,7 +18,7 @@ #include "url/gurl.h" #include "webkit/common/fileapi/file_system_types.h" -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -52,7 +52,7 @@ class BrowsingDataFileSystemHelper // The origin for which the information is relevant. GURL origin; // FileSystemType to usage (in bytes) map. - std::map<fileapi::FileSystemType, int64> usage_map; + std::map<storage::FileSystemType, int64> usage_map; }; // Creates a BrowsingDataFileSystemHelper instance for the file systems @@ -63,7 +63,7 @@ class BrowsingDataFileSystemHelper // The BrowsingDataFileSystemHelper will not change the profile itself, but // can modify data it contains (by removing file systems). static BrowsingDataFileSystemHelper* Create( - fileapi::FileSystemContext* file_system_context); + storage::FileSystemContext* file_system_context); // Starts the process of fetching file system data, which will call |callback| // upon completion, passing it a constant list of FileSystemInfo objects. @@ -112,7 +112,7 @@ class CannedBrowsingDataFileSystemHelper // and a persistent filesystem, AddFileSystem must be called twice (once for // each file system type). void AddFileSystem(const GURL& origin, - fileapi::FileSystemType type, + storage::FileSystemType type, int64 size); // Clear this helper's list of canned filesystems. diff --git a/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc index bbc9486..d22f6f8 100644 --- a/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc @@ -24,9 +24,9 @@ using content::BrowserThread; namespace { -// Shorter names for fileapi::* constants. -const fileapi::FileSystemType kTemporary = fileapi::kFileSystemTypeTemporary; -const fileapi::FileSystemType kPersistent = fileapi::kFileSystemTypePersistent; +// Shorter names for storage::* constants. +const storage::FileSystemType kTemporary = storage::kFileSystemTypeTemporary; +const storage::FileSystemType kPersistent = storage::kFileSystemTypePersistent; // We'll use these three distinct origins for testing, both as strings and as // GURLs in appropriate contexts. @@ -92,7 +92,7 @@ class BrowsingDataFileSystemHelperTest : public testing::Test { } // Callback that should be executed in response to - // fileapi::FileSystemContext::OpenFileSystem. + // storage::FileSystemContext::OpenFileSystem. void OpenFileSystemCallback(const GURL& root, const std::string& name, base::File::Error error) { @@ -101,8 +101,8 @@ class BrowsingDataFileSystemHelperTest : public testing::Test { } bool OpenFileSystem(const GURL& origin, - fileapi::FileSystemType type, - fileapi::OpenFileSystemMode open_mode) { + storage::FileSystemType type, + storage::OpenFileSystemMode open_mode) { BrowserContext::GetDefaultStoragePartition(profile_.get())-> GetFileSystemContext()->OpenFileSystem( origin, type, open_mode, @@ -113,15 +113,15 @@ class BrowsingDataFileSystemHelperTest : public testing::Test { return open_file_system_result_ == base::File::FILE_OK; } - // Calls fileapi::FileSystemContext::OpenFileSystem with + // Calls storage::FileSystemContext::OpenFileSystem with // OPEN_FILE_SYSTEM_FAIL_IF_NONEXISTENT flag // to verify the existence of a file system for a specified type and origin, // blocks until a response is available, then returns the result // synchronously to it's caller. bool FileSystemContainsOriginAndType(const GURL& origin, - fileapi::FileSystemType type) { - return OpenFileSystem(origin, type, - fileapi::OPEN_FILE_SYSTEM_FAIL_IF_NONEXISTENT); + storage::FileSystemType type) { + return OpenFileSystem( + origin, type, storage::OPEN_FILE_SYSTEM_FAIL_IF_NONEXISTENT); } // Callback that should be executed in response to StartFetching(), and stores @@ -172,9 +172,9 @@ class BrowsingDataFileSystemHelperTest : public testing::Test { // Calls OpenFileSystem with OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT // to create a filesystem of a given type for a specified origin. void CreateDirectoryForOriginAndType(const GURL& origin, - fileapi::FileSystemType type) { - OpenFileSystem(origin, type, - fileapi::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT); + storage::FileSystemType type) { + OpenFileSystem( + origin, type, storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT); EXPECT_EQ(base::File::FILE_OK, open_file_system_result_); } @@ -219,7 +219,7 @@ TEST_F(BrowsingDataFileSystemHelperTest, FetchData) { EXPECT_FALSE(ContainsKey(info->usage_map, kPersistent)); EXPECT_TRUE(ContainsKey(info->usage_map, kTemporary)); EXPECT_EQ(kEmptyFileSystemSize, - info->usage_map[fileapi::kFileSystemTypeTemporary]); + info->usage_map[storage::kFileSystemTypeTemporary]); } else if (info->origin == kOrigin2) { EXPECT_FALSE(test_hosts_found[1]); test_hosts_found[1] = true; diff --git a/chrome/browser/browsing_data/browsing_data_helper.cc b/chrome/browser/browsing_data/browsing_data_helper.cc index 839a5d8..f7f02f7 100644 --- a/chrome/browser/browsing_data/browsing_data_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_helper.cc @@ -47,8 +47,10 @@ bool BrowsingDataHelper::HasExtensionScheme(const GURL& origin) { } // Static -bool BrowsingDataHelper::DoesOriginMatchMask(const GURL& origin, - int origin_set_mask, quota::SpecialStoragePolicy* policy) { +bool BrowsingDataHelper::DoesOriginMatchMask( + const GURL& origin, + int origin_set_mask, + storage::SpecialStoragePolicy* policy) { // Packaged apps and extensions match iff EXTENSION. if (BrowsingDataHelper::HasExtensionScheme(origin.GetOrigin()) && origin_set_mask & EXTENSION) diff --git a/chrome/browser/browsing_data/browsing_data_helper.h b/chrome/browser/browsing_data/browsing_data_helper.h index 353b873..0fc107b 100644 --- a/chrome/browser/browsing_data/browsing_data_helper.h +++ b/chrome/browser/browsing_data/browsing_data_helper.h @@ -11,7 +11,7 @@ #include "base/basictypes.h" -namespace quota { +namespace storage { class SpecialStoragePolicy; } @@ -41,7 +41,7 @@ class BrowsingDataHelper { // Returns true if the provided origin matches the provided mask. static bool DoesOriginMatchMask(const GURL& origin, int origin_set_mask, - quota::SpecialStoragePolicy* policy); + storage::SpecialStoragePolicy* policy); private: DISALLOW_IMPLICIT_CONSTRUCTORS(BrowsingDataHelper); diff --git a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc index 853940e..d5cecde 100644 --- a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc @@ -52,7 +52,7 @@ class BrowsingDataHelperTest : public testing::Test { bool Match(const GURL& origin, int mask, - quota::SpecialStoragePolicy* policy) { + storage::SpecialStoragePolicy* policy) { return BrowsingDataHelper::DoesOriginMatchMask(origin, mask, policy); } diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc index ec870d7..1c6d01b 100644 --- a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc +++ b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc @@ -57,7 +57,7 @@ void BrowsingDataQuotaHelperImpl::RevokeHostQuota(const std::string& host) { BrowsingDataQuotaHelperImpl::BrowsingDataQuotaHelperImpl( base::MessageLoopProxy* ui_thread, base::MessageLoopProxy* io_thread, - quota::QuotaManager* quota_manager) + storage::QuotaManager* quota_manager) : BrowsingDataQuotaHelper(io_thread), quota_manager_(quota_manager), is_fetching_(false), @@ -78,39 +78,39 @@ void BrowsingDataQuotaHelperImpl::FetchQuotaInfo() { } quota_manager_->GetOriginsModifiedSince( - quota::kStorageTypeTemporary, + storage::kStorageTypeTemporary, base::Time(), base::Bind(&BrowsingDataQuotaHelperImpl::GotOrigins, weak_factory_.GetWeakPtr())); } -void BrowsingDataQuotaHelperImpl::GotOrigins( - const std::set<GURL>& origins, quota::StorageType type) { +void BrowsingDataQuotaHelperImpl::GotOrigins(const std::set<GURL>& origins, + storage::StorageType type) { for (std::set<GURL>::const_iterator itr = origins.begin(); itr != origins.end(); ++itr) if (BrowsingDataHelper::HasWebScheme(*itr)) pending_hosts_.insert(std::make_pair(itr->host(), type)); - DCHECK(type == quota::kStorageTypeTemporary || - type == quota::kStorageTypePersistent || - type == quota::kStorageTypeSyncable); + DCHECK(type == storage::kStorageTypeTemporary || + type == storage::kStorageTypePersistent || + type == storage::kStorageTypeSyncable); // Calling GetOriginsModifiedSince() for all types by chaining callbacks. - if (type == quota::kStorageTypeTemporary) { + if (type == storage::kStorageTypeTemporary) { quota_manager_->GetOriginsModifiedSince( - quota::kStorageTypePersistent, + storage::kStorageTypePersistent, base::Time(), base::Bind(&BrowsingDataQuotaHelperImpl::GotOrigins, weak_factory_.GetWeakPtr())); - } else if (type == quota::kStorageTypePersistent) { + } else if (type == storage::kStorageTypePersistent) { quota_manager_->GetOriginsModifiedSince( - quota::kStorageTypeSyncable, + storage::kStorageTypeSyncable, base::Time(), base::Bind(&BrowsingDataQuotaHelperImpl::GotOrigins, weak_factory_.GetWeakPtr())); } else { - DCHECK(type == quota::kStorageTypeSyncable); + DCHECK(type == storage::kStorageTypeSyncable); ProcessPendingHosts(); } } @@ -123,13 +123,13 @@ void BrowsingDataQuotaHelperImpl::ProcessPendingHosts() { PendingHosts::iterator itr = pending_hosts_.begin(); std::string host = itr->first; - quota::StorageType type = itr->second; + storage::StorageType type = itr->second; pending_hosts_.erase(itr); GetHostUsage(host, type); } void BrowsingDataQuotaHelperImpl::GetHostUsage(const std::string& host, - quota::StorageType type) { + storage::StorageType type) { DCHECK(quota_manager_.get()); quota_manager_->GetHostUsage( host, type, @@ -138,16 +138,16 @@ void BrowsingDataQuotaHelperImpl::GetHostUsage(const std::string& host, } void BrowsingDataQuotaHelperImpl::GotHostUsage(const std::string& host, - quota::StorageType type, + storage::StorageType type, int64 usage) { switch (type) { - case quota::kStorageTypeTemporary: + case storage::kStorageTypeTemporary: quota_info_[host].temporary_usage = usage; break; - case quota::kStorageTypePersistent: + case storage::kStorageTypePersistent: quota_info_[host].persistent_usage = usage; break; - case quota::kStorageTypeSyncable: + case storage::kStorageTypeSyncable: quota_info_[host].syncable_usage = usage; break; default: @@ -187,6 +187,6 @@ void BrowsingDataQuotaHelperImpl::OnComplete() { } void BrowsingDataQuotaHelperImpl::DidRevokeHostQuota( - quota::QuotaStatusCode status_unused, + storage::QuotaStatusCode status_unused, int64 quota_unused) { } diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.h b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.h index fce734c..94301bd 100644 --- a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.h +++ b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.h @@ -18,7 +18,7 @@ class GURL; -namespace quota { +namespace storage { class QuotaManager; } @@ -33,29 +33,29 @@ class BrowsingDataQuotaHelperImpl : public BrowsingDataQuotaHelper { private: BrowsingDataQuotaHelperImpl(base::MessageLoopProxy* ui_thread, base::MessageLoopProxy* io_thread, - quota::QuotaManager* quota_manager); + storage::QuotaManager* quota_manager); virtual ~BrowsingDataQuotaHelperImpl(); void FetchQuotaInfo(); // Callback function for GetOriginModifiedSince. - void GotOrigins(const std::set<GURL>& origins, quota::StorageType type); + void GotOrigins(const std::set<GURL>& origins, storage::StorageType type); void ProcessPendingHosts(); - void GetHostUsage(const std::string& host, quota::StorageType type); + void GetHostUsage(const std::string& host, storage::StorageType type); // Callback function for GetHostUsage. void GotHostUsage(const std::string& host, - quota::StorageType type, + storage::StorageType type, int64 usage); void OnComplete(); - void DidRevokeHostQuota(quota::QuotaStatusCode status, int64 quota); + void DidRevokeHostQuota(storage::QuotaStatusCode status, int64 quota); - scoped_refptr<quota::QuotaManager> quota_manager_; + scoped_refptr<storage::QuotaManager> quota_manager_; FetchResultCallback callback_; - typedef std::set<std::pair<std::string, quota::StorageType> > PendingHosts; + typedef std::set<std::pair<std::string, storage::StorageType> > PendingHosts; PendingHosts pending_hosts_; std::map<std::string, QuotaInfo> quota_info_; diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc index 585593a..151d62a 100644 --- a/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc @@ -34,7 +34,7 @@ class BrowsingDataQuotaHelperTest : public testing::Test { virtual void SetUp() OVERRIDE { EXPECT_TRUE(dir_.CreateUniqueTempDir()); - quota_manager_ = new quota::QuotaManager( + quota_manager_ = new storage::QuotaManager( false, dir_.path(), BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO).get(), @@ -71,9 +71,10 @@ class BrowsingDataQuotaHelperTest : public testing::Test { void RegisterClient(const MockOriginData* data, std::size_t data_len) { MockStorageClient* client = - new MockStorageClient( - quota_manager_->proxy(), data, quota::QuotaClient::kFileSystem, - data_len); + new MockStorageClient(quota_manager_->proxy(), + data, + storage::QuotaClient::kFileSystem, + data_len); quota_manager_->proxy()->RegisterClient(client); client->TouchAllOriginsAndNotify(); } @@ -94,9 +95,8 @@ class BrowsingDataQuotaHelperTest : public testing::Test { weak_factory_.GetWeakPtr())); } - void GotPersistentHostQuota(quota::QuotaStatusCode status, - int64 quota) { - EXPECT_EQ(quota::kQuotaStatusOk, status); + void GotPersistentHostQuota(storage::QuotaStatusCode status, int64 quota) { + EXPECT_EQ(storage::kQuotaStatusOk, status); quota_ = quota; } @@ -115,7 +115,7 @@ class BrowsingDataQuotaHelperTest : public testing::Test { } content::TestBrowserThreadBundle thread_bundle_; - scoped_refptr<quota::QuotaManager> quota_manager_; + scoped_refptr<storage::QuotaManager> quota_manager_; base::ScopedTempDir dir_; scoped_refptr<BrowsingDataQuotaHelper> helper_; @@ -137,11 +137,11 @@ TEST_F(BrowsingDataQuotaHelperTest, Empty) { TEST_F(BrowsingDataQuotaHelperTest, FetchData) { const MockOriginData kOrigins[] = { - {"http://example.com/", quota::kStorageTypeTemporary, 1}, - {"https://example.com/", quota::kStorageTypeTemporary, 10}, - {"http://example.com/", quota::kStorageTypePersistent, 100}, - {"https://example.com/", quota::kStorageTypeSyncable, 1}, - {"http://example2.com/", quota::kStorageTypeTemporary, 1000}, + {"http://example.com/", storage::kStorageTypeTemporary, 1}, + {"https://example.com/", storage::kStorageTypeTemporary, 10}, + {"http://example.com/", storage::kStorageTypePersistent, 100}, + {"https://example.com/", storage::kStorageTypeSyncable, 1}, + {"http://example2.com/", storage::kStorageTypeTemporary, 1000}, }; RegisterClient(kOrigins, arraysize(kOrigins)); @@ -158,19 +158,19 @@ TEST_F(BrowsingDataQuotaHelperTest, FetchData) { TEST_F(BrowsingDataQuotaHelperTest, IgnoreExtensionsAndDevTools) { const MockOriginData kOrigins[] = { - {"http://example.com/", quota::kStorageTypeTemporary, 1}, - {"https://example.com/", quota::kStorageTypeTemporary, 10}, - {"http://example.com/", quota::kStorageTypePersistent, 100}, - {"https://example.com/", quota::kStorageTypeSyncable, 1}, - {"http://example2.com/", quota::kStorageTypeTemporary, 1000}, - {"chrome-extension://abcdefghijklmnopqrstuvwxyz/", - quota::kStorageTypeTemporary, 10000}, - {"chrome-extension://abcdefghijklmnopqrstuvwxyz/", - quota::kStorageTypePersistent, 100000}, - {"chrome-devtools://abcdefghijklmnopqrstuvwxyz/", - quota::kStorageTypeTemporary, 10000}, - {"chrome-devtools://abcdefghijklmnopqrstuvwxyz/", - quota::kStorageTypePersistent, 100000}, + {"http://example.com/", storage::kStorageTypeTemporary, 1}, + {"https://example.com/", storage::kStorageTypeTemporary, 10}, + {"http://example.com/", storage::kStorageTypePersistent, 100}, + {"https://example.com/", storage::kStorageTypeSyncable, 1}, + {"http://example2.com/", storage::kStorageTypeTemporary, 1000}, + {"chrome-extension://abcdefghijklmnopqrstuvwxyz/", + storage::kStorageTypeTemporary, 10000}, + {"chrome-extension://abcdefghijklmnopqrstuvwxyz/", + storage::kStorageTypePersistent, 100000}, + {"chrome-devtools://abcdefghijklmnopqrstuvwxyz/", + storage::kStorageTypeTemporary, 10000}, + {"chrome-devtools://abcdefghijklmnopqrstuvwxyz/", + storage::kStorageTypePersistent, 100000}, }; RegisterClient(kOrigins, arraysize(kOrigins)); diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc index 86db7fb..1ca88b8 100644 --- a/chrome/browser/browsing_data/browsing_data_remover.cc +++ b/chrome/browser/browsing_data/browsing_data_remover.cc @@ -106,9 +106,10 @@ BrowsingDataRemover::CompletionInhibitor* // Helper to create callback for BrowsingDataRemover::DoesOriginMatchMask. // Static. -bool DoesOriginMatchMask(int origin_set_mask, - const GURL& origin, - quota::SpecialStoragePolicy* special_storage_policy) { +bool DoesOriginMatchMask( + int origin_set_mask, + const GURL& origin, + storage::SpecialStoragePolicy* special_storage_policy) { return BrowsingDataHelper::DoesOriginMatchMask( origin, origin_set_mask, special_storage_policy); } diff --git a/chrome/browser/browsing_data/browsing_data_remover.h b/chrome/browser/browsing_data/browsing_data_remover.h index 61ab417..6c7f9bf 100644 --- a/chrome/browser/browsing_data/browsing_data_remover.h +++ b/chrome/browser/browsing_data/browsing_data_remover.h @@ -44,7 +44,7 @@ namespace net { class URLRequestContextGetter; } -namespace quota { +namespace storage { class QuotaManager; } diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc index 15c5b01..a5ec397 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc @@ -144,16 +144,14 @@ class TestStoragePartition : public StoragePartition { virtual net::URLRequestContextGetter* GetMediaURLRequestContext() OVERRIDE { return NULL; } - virtual quota::QuotaManager* GetQuotaManager() OVERRIDE { - return NULL; - } + virtual storage::QuotaManager* GetQuotaManager() OVERRIDE { return NULL; } virtual content::AppCacheService* GetAppCacheService() OVERRIDE { return NULL; } - virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE { + virtual storage::FileSystemContext* GetFileSystemContext() OVERRIDE { return NULL; } - virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE { + virtual storage::DatabaseTracker* GetDatabaseTracker() OVERRIDE { return NULL; } virtual content::DOMStorageContext* GetDOMStorageContext() OVERRIDE { @@ -827,7 +825,7 @@ class BrowsingDataRemoverTest : public testing::Test, #endif } - quota::SpecialStoragePolicy* mock_policy() { + storage::SpecialStoragePolicy* mock_policy() { #if defined(ENABLE_EXTENSIONS) return mock_policy_; #else diff --git a/chrome/browser/browsing_data/mock_browsing_data_database_helper.cc b/chrome/browser/browsing_data/mock_browsing_data_database_helper.cc index dc82758..e645d03 100644 --- a/chrome/browser/browsing_data/mock_browsing_data_database_helper.cc +++ b/chrome/browser/browsing_data/mock_browsing_data_database_helper.cc @@ -34,13 +34,13 @@ void MockBrowsingDataDatabaseHelper::DeleteDatabase( } void MockBrowsingDataDatabaseHelper::AddDatabaseSamples() { - webkit_database::DatabaseIdentifier id1 = - webkit_database::DatabaseIdentifier::Parse("http_gdbhost1_1"); + storage::DatabaseIdentifier id1 = + storage::DatabaseIdentifier::Parse("http_gdbhost1_1"); response_.push_back(BrowsingDataDatabaseHelper::DatabaseInfo( id1, "db1", "description 1", 1, base::Time())); databases_["http_gdbhost1_1:db1"] = true; - webkit_database::DatabaseIdentifier id2 = - webkit_database::DatabaseIdentifier::Parse("http_gdbhost2_2"); + storage::DatabaseIdentifier id2 = + storage::DatabaseIdentifier::Parse("http_gdbhost2_2"); response_.push_back(BrowsingDataDatabaseHelper::DatabaseInfo( id2, "db2", "description 2", 2, base::Time())); databases_["http_gdbhost2_2:db2"] = true; diff --git a/chrome/browser/browsing_data/mock_browsing_data_file_system_helper.cc b/chrome/browser/browsing_data/mock_browsing_data_file_system_helper.cc index 759ad05..f8eecb4 100644 --- a/chrome/browser/browsing_data/mock_browsing_data_file_system_helper.cc +++ b/chrome/browser/browsing_data/mock_browsing_data_file_system_helper.cc @@ -36,11 +36,11 @@ void MockBrowsingDataFileSystemHelper::AddFileSystem( bool has_syncable) { BrowsingDataFileSystemHelper::FileSystemInfo info(origin); if (has_persistent) - info.usage_map[fileapi::kFileSystemTypePersistent] = 0; + info.usage_map[storage::kFileSystemTypePersistent] = 0; if (has_temporary) - info.usage_map[fileapi::kFileSystemTypeTemporary] = 0; + info.usage_map[storage::kFileSystemTypeTemporary] = 0; if (has_syncable) - info.usage_map[fileapi::kFileSystemTypeSyncable] = 0; + info.usage_map[storage::kFileSystemTypeSyncable] = 0; response_.push_back(info); file_systems_[origin.spec()] = true; } |