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 | |
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')
287 files changed, 2935 insertions, 2945 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; } diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 48dd95b..5c89f1b 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -2354,7 +2354,7 @@ void ChromeContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( } void ChromeContentBrowserClient::GetURLRequestAutoMountHandlers( - std::vector<fileapi::URLRequestAutoMountHandler>* handlers) { + std::vector<storage::URLRequestAutoMountHandler>* handlers) { for (size_t i = 0; i < extra_parts_.size(); ++i) extra_parts_[i]->GetURLRequestAutoMountHandlers(handlers); } @@ -2362,9 +2362,9 @@ void ChromeContentBrowserClient::GetURLRequestAutoMountHandlers( void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( content::BrowserContext* browser_context, const base::FilePath& storage_partition_path, - ScopedVector<fileapi::FileSystemBackend>* additional_backends) { + ScopedVector<storage::FileSystemBackend>* additional_backends) { #if defined(OS_CHROMEOS) - fileapi::ExternalMountPoints* external_mount_points = + storage::ExternalMountPoints* external_mount_points = content::BrowserContext::GetMountPoints(browser_context); DCHECK(external_mount_points); chromeos::FileSystemBackend* backend = new chromeos::FileSystemBackend( @@ -2373,19 +2373,17 @@ void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( new chromeos::MTPFileSystemBackendDelegate(storage_partition_path), browser_context->GetSpecialStoragePolicy(), external_mount_points, - fileapi::ExternalMountPoints::GetSystemInstance()); + storage::ExternalMountPoints::GetSystemInstance()); backend->AddSystemMountPoints(); - DCHECK(backend->CanHandleType(fileapi::kFileSystemTypeExternal)); + DCHECK(backend->CanHandleType(storage::kFileSystemTypeExternal)); additional_backends->push_back(backend); #endif #if defined(ENABLE_SERVICE_DISCOVERY) if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnablePrivetStorage)) { - additional_backends->push_back( - new local_discovery::PrivetFileSystemBackend( - fileapi::ExternalMountPoints::GetSystemInstance(), - browser_context)); + additional_backends->push_back(new local_discovery::PrivetFileSystemBackend( + storage::ExternalMountPoints::GetSystemInstance(), browser_context)); } #endif diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 6ba5f96..85a1b65 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h @@ -262,11 +262,11 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { virtual void GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_schemes) OVERRIDE; virtual void GetURLRequestAutoMountHandlers( - std::vector<fileapi::URLRequestAutoMountHandler>* handlers) OVERRIDE; + std::vector<storage::URLRequestAutoMountHandler>* handlers) OVERRIDE; virtual void GetAdditionalFileSystemBackends( content::BrowserContext* browser_context, const base::FilePath& storage_partition_path, - ScopedVector<fileapi::FileSystemBackend>* additional_backends) OVERRIDE; + ScopedVector<storage::FileSystemBackend>* additional_backends) OVERRIDE; virtual content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() OVERRIDE; virtual bool IsPluginAllowedToCallRequestOSFileHandle( diff --git a/chrome/browser/chrome_content_browser_client_parts.h b/chrome/browser/chrome_content_browser_client_parts.h index def457f..a8d13e9 100644 --- a/chrome/browser/chrome_content_browser_client_parts.h +++ b/chrome/browser/chrome_content_browser_client_parts.h @@ -25,7 +25,7 @@ class SiteInstance; struct WebPreferences; } -namespace fileapi { +namespace storage { class FileSystemBackend; } @@ -49,11 +49,11 @@ class ChromeContentBrowserClientParts { virtual void GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_allowed_schemes) {} virtual void GetURLRequestAutoMountHandlers( - std::vector<fileapi::URLRequestAutoMountHandler>* handlers) {} + std::vector<storage::URLRequestAutoMountHandler>* handlers) {} virtual void GetAdditionalFileSystemBackends( content::BrowserContext* browser_context, const base::FilePath& storage_partition_path, - ScopedVector<fileapi::FileSystemBackend>* additional_backends) {} + ScopedVector<storage::FileSystemBackend>* additional_backends) {} // Append extra switches to |command_line| for |process|. If |process| is not // NULL, then neither is |profile|. diff --git a/chrome/browser/chrome_quota_permission_context.cc b/chrome/browser/chrome_quota_permission_context.cc index d3bdd7f..9762003 100644 --- a/chrome/browser/chrome_quota_permission_context.cc +++ b/chrome/browser/chrome_quota_permission_context.cc @@ -255,7 +255,7 @@ void ChromeQuotaPermissionContext::RequestQuotaPermission( const content::StorageQuotaParams& params, int render_process_id, const PermissionCallback& callback) { - if (params.storage_type != quota::kStorageTypePersistent) { + if (params.storage_type != storage::kStorageTypePersistent) { // For now we only support requesting quota with this interface // for Persistent storage type. callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc index e3cfb48..65bc5f5 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service.cc +++ b/chrome/browser/chromeos/drive/drive_integration_service.cc @@ -354,8 +354,8 @@ bool DriveIntegrationService::IsMounted() const { // Look up the registered path, and just discard it. // GetRegisteredPath() returns true if the path is available. base::FilePath unused; - fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); DCHECK(mount_points); return mount_points->GetRegisteredPath(mount_point_name_, &unused); } @@ -434,15 +434,15 @@ void DriveIntegrationService::AddDriveMountPoint() { util::GetDriveMountPointPath(profile_); if (mount_point_name_.empty()) mount_point_name_ = drive_mount_point.BaseName().AsUTF8Unsafe(); - fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); DCHECK(mount_points); - bool success = mount_points->RegisterFileSystem( - mount_point_name_, - fileapi::kFileSystemTypeDrive, - fileapi::FileSystemMountOption(), - drive_mount_point); + bool success = + mount_points->RegisterFileSystem(mount_point_name_, + storage::kFileSystemTypeDrive, + storage::FileSystemMountOption(), + drive_mount_point); if (success) { logger_->Log(logging::LOG_INFO, "Drive mount point is added"); @@ -460,8 +460,8 @@ void DriveIntegrationService::RemoveDriveMountPoint() { FOR_EACH_OBSERVER(DriveIntegrationServiceObserver, observers_, OnFileSystemBeingUnmounted()); - fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); DCHECK(mount_points); mount_points->RevokeFileSystem(mount_point_name_); diff --git a/chrome/browser/chromeos/drive/file_system_util.cc b/chrome/browser/chromeos/drive/file_system_util.cc index db8043c..5ff93f2 100644 --- a/chrome/browser/chromeos/drive/file_system_util.cc +++ b/chrome/browser/chromeos/drive/file_system_util.cc @@ -237,8 +237,8 @@ Profile* ExtractProfileFromPath(const base::FilePath& path) { } base::FilePath ExtractDrivePathFromFileSystemUrl( - const fileapi::FileSystemURL& url) { - if (!url.is_valid() || url.type() != fileapi::kFileSystemTypeDrive) + const storage::FileSystemURL& url) { + if (!url.is_valid() || url.type() != storage::kFileSystemTypeDrive) return base::FilePath(); return ExtractDrivePath(url.path()); } diff --git a/chrome/browser/chromeos/drive/file_system_util.h b/chrome/browser/chromeos/drive/file_system_util.h index 260f6df..fdc29b9 100644 --- a/chrome/browser/chromeos/drive/file_system_util.h +++ b/chrome/browser/chromeos/drive/file_system_util.h @@ -14,7 +14,7 @@ class Profile; -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -110,7 +110,7 @@ Profile* ExtractProfileFromPath(const base::FilePath& path); // Extracts the Drive path (e.g., "drive/foo.txt") from the filesystem URL. // Returns an empty path if |url| does not point under Drive mount point. base::FilePath ExtractDrivePathFromFileSystemUrl( - const fileapi::FileSystemURL& url); + const storage::FileSystemURL& url); // Escapes a file name in Drive cache. // Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex) diff --git a/chrome/browser/chromeos/drive/file_system_util_unittest.cc b/chrome/browser/chromeos/drive/file_system_util_unittest.cc index b5873f8..dda5280 100644 --- a/chrome/browser/chromeos/drive/file_system_util_unittest.cc +++ b/chrome/browser/chromeos/drive/file_system_util_unittest.cc @@ -143,28 +143,27 @@ TEST(FileSystemUtilTest, ExtractDrivePathFromFileSystemUrl) { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); base::MessageLoop message_loop; - scoped_refptr<fileapi::ExternalMountPoints> mount_points = - fileapi::ExternalMountPoints::CreateRefCounted(); - scoped_refptr<fileapi::FileSystemContext> context( - new fileapi::FileSystemContext( + scoped_refptr<storage::ExternalMountPoints> mount_points = + storage::ExternalMountPoints::CreateRefCounted(); + scoped_refptr<storage::FileSystemContext> context( + new storage::FileSystemContext( base::MessageLoopProxy::current().get(), base::MessageLoopProxy::current().get(), mount_points.get(), NULL, // special_storage_policy NULL, // quota_manager_proxy, - ScopedVector<fileapi::FileSystemBackend>(), - std::vector<fileapi::URLRequestAutoMountHandler>(), + ScopedVector<storage::FileSystemBackend>(), + std::vector<storage::URLRequestAutoMountHandler>(), temp_dir_.path(), // partition_path content::CreateAllowFileAccessOptions())); // Type:"external" + virtual_path:"drive/foo/bar" resolves to "drive/foo/bar". const std::string& drive_mount_name = GetDriveMountPointPath(&profile).BaseName().AsUTF8Unsafe(); - mount_points->RegisterFileSystem( - drive_mount_name, - fileapi::kFileSystemTypeDrive, - fileapi::FileSystemMountOption(), - GetDriveMountPointPath(&profile)); + mount_points->RegisterFileSystem(drive_mount_name, + storage::kFileSystemTypeDrive, + storage::FileSystemMountOption(), + GetDriveMountPointPath(&profile)); EXPECT_EQ( base::FilePath::FromUTF8Unsafe("drive/foo/bar"), ExtractDrivePathFromFileSystemUrl(context->CrackURL(GURL( @@ -173,22 +172,20 @@ TEST(FileSystemUtilTest, ExtractDrivePathFromFileSystemUrl) { // Virtual mount name should not affect the extracted path. mount_points->RevokeFileSystem(drive_mount_name); - mount_points->RegisterFileSystem( - "drive2", - fileapi::kFileSystemTypeDrive, - fileapi::FileSystemMountOption(), - GetDriveMountPointPath(&profile)); + mount_points->RegisterFileSystem("drive2", + storage::kFileSystemTypeDrive, + storage::FileSystemMountOption(), + GetDriveMountPointPath(&profile)); EXPECT_EQ( base::FilePath::FromUTF8Unsafe("drive/foo/bar"), ExtractDrivePathFromFileSystemUrl(context->CrackURL(GURL( "filesystem:chrome-extension://dummy-id/external/drive2/foo/bar")))); // Type:"external" + virtual_path:"Downloads/foo" is not a Drive path. - mount_points->RegisterFileSystem( - "Downloads", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), - temp_dir_.path()); + mount_points->RegisterFileSystem("Downloads", + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), + temp_dir_.path()); EXPECT_EQ( base::FilePath(), ExtractDrivePathFromFileSystemUrl(context->CrackURL(GURL( @@ -197,8 +194,8 @@ TEST(FileSystemUtilTest, ExtractDrivePathFromFileSystemUrl) { // Type:"isolated" + virtual_path:"isolated_id/name" mapped on a Drive path. std::string isolated_name; std::string isolated_id = - fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForPath( - fileapi::kFileSystemTypeNativeForPlatformApp, + storage::IsolatedContext::GetInstance()->RegisterFileSystemForPath( + storage::kFileSystemTypeNativeForPlatformApp, std::string(), GetDriveMountPointPath(&profile).AppendASCII("bar/buz"), &isolated_name); diff --git a/chrome/browser/chromeos/drive/file_task_executor.cc b/chrome/browser/chromeos/drive/file_task_executor.cc index cfb96c1..5a68994 100644 --- a/chrome/browser/chromeos/drive/file_task_executor.cc +++ b/chrome/browser/chromeos/drive/file_task_executor.cc @@ -21,7 +21,7 @@ #include "content/public/browser/browser_thread.h" #include "webkit/browser/fileapi/file_system_url.h" -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace drive { diff --git a/chrome/browser/chromeos/drive/file_task_executor.h b/chrome/browser/chromeos/drive/file_task_executor.h index 951b1a3..56f1d73 100644 --- a/chrome/browser/chromeos/drive/file_task_executor.h +++ b/chrome/browser/chromeos/drive/file_task_executor.h @@ -46,7 +46,7 @@ class FileTaskExecutor { const std::string& app_id); // Executes file tasks, runs |done| and deletes |this|. - void Execute(const std::vector<fileapi::FileSystemURL>& file_urls, + void Execute(const std::vector<storage::FileSystemURL>& file_urls, const file_manager::file_tasks::FileTaskFinishedCallback& done); private: diff --git a/chrome/browser/chromeos/drive/file_task_executor_unittest.cc b/chrome/browser/chromeos/drive/file_task_executor_unittest.cc index bd2538d..9537ab4 100644 --- a/chrome/browser/chromeos/drive/file_task_executor_unittest.cc +++ b/chrome/browser/chromeos/drive/file_task_executor_unittest.cc @@ -99,14 +99,14 @@ TEST(FileTaskExecutorTest, DriveAppOpenSuccess) { FileTaskExecutor* const executor = new FileTaskExecutor( scoped_ptr<FileTaskExecutorDelegate>(delegate_ptr), "test-app-id"); - std::vector<fileapi::FileSystemURL> urls; - urls.push_back(fileapi::FileSystemURL::CreateForTest( + std::vector<storage::FileSystemURL> urls; + urls.push_back(storage::FileSystemURL::CreateForTest( GURL("http://origin/"), - fileapi::kFileSystemTypeDrive, + storage::kFileSystemTypeDrive, base::FilePath::FromUTF8Unsafe("/special/drive/root/file1.txt"))); - urls.push_back(fileapi::FileSystemURL::CreateForTest( + urls.push_back(storage::FileSystemURL::CreateForTest( GURL("http://origin/"), - fileapi::kFileSystemTypeDrive, + storage::kFileSystemTypeDrive, base::FilePath::FromUTF8Unsafe("/special/drive/root/file2.txt"))); extensions::api::file_browser_private::TaskResult result = @@ -133,10 +133,10 @@ TEST(FileTaskExecutorTest, DriveAppOpenFailForNonExistingFile) { FileTaskExecutor* const executor = new FileTaskExecutor( scoped_ptr<FileTaskExecutorDelegate>(delegate_ptr), "test-app-id"); - std::vector<fileapi::FileSystemURL> urls; - urls.push_back(fileapi::FileSystemURL::CreateForTest( + std::vector<storage::FileSystemURL> urls; + urls.push_back(storage::FileSystemURL::CreateForTest( GURL("http://origin/"), - fileapi::kFileSystemTypeDrive, + storage::kFileSystemTypeDrive, base::FilePath::FromUTF8Unsafe("/special/drive/root/not-exist.txt"))); extensions::api::file_browser_private::TaskResult result = diff --git a/chrome/browser/chromeos/drive/fileapi/async_file_util.cc b/chrome/browser/chromeos/drive/fileapi/async_file_util.cc index 9a47bfc..c3781f9 100644 --- a/chrome/browser/chromeos/drive/fileapi/async_file_util.cc +++ b/chrome/browser/chromeos/drive/fileapi/async_file_util.cc @@ -108,17 +108,15 @@ void RunCreateSnapshotFileCallback( base::File::Error error, const base::File::Info& file_info, const base::FilePath& local_path, - webkit_blob::ScopedFile::ScopeOutPolicy scope_out_policy) { + storage::ScopedFile::ScopeOutPolicy scope_out_policy) { // ShareableFileReference is thread *unsafe* class. So it is necessary to // create the instance (by invoking GetOrCreate) on IO thread, though // most drive file system related operations run on UI thread. DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - scoped_refptr<webkit_blob::ShareableFileReference> file_reference = - webkit_blob::ShareableFileReference::GetOrCreate(webkit_blob::ScopedFile( - local_path, - scope_out_policy, - BrowserThread::GetBlockingPool())); + scoped_refptr<storage::ShareableFileReference> file_reference = + storage::ShareableFileReference::GetOrCreate(storage::ScopedFile( + local_path, scope_out_policy, BrowserThread::GetBlockingPool())); callback.Run(error, file_info, local_path, file_reference); } @@ -131,8 +129,8 @@ AsyncFileUtil::~AsyncFileUtil() { } void AsyncFileUtil::CreateOrOpen( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -156,8 +154,8 @@ void AsyncFileUtil::CreateOrOpen( } void AsyncFileUtil::EnsureFileExists( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const EnsureFileExistsCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -177,8 +175,8 @@ void AsyncFileUtil::EnsureFileExists( } void AsyncFileUtil::CreateDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) { @@ -199,8 +197,8 @@ void AsyncFileUtil::CreateDirectory( } void AsyncFileUtil::GetFileInfo( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -219,8 +217,8 @@ void AsyncFileUtil::GetFileInfo( } void AsyncFileUtil::ReadDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -239,8 +237,8 @@ void AsyncFileUtil::ReadDirectory( } void AsyncFileUtil::Touch( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time, const StatusCallback& callback) { @@ -261,8 +259,8 @@ void AsyncFileUtil::Touch( } void AsyncFileUtil::Truncate( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int64 length, const StatusCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -281,9 +279,9 @@ void AsyncFileUtil::Truncate( } void AsyncFileUtil::CopyFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) { @@ -306,16 +304,17 @@ void AsyncFileUtil::CopyFileLocal( base::Bind(&fileapi_internal::GetFileSystemFromUrl, dest_url), base::Bind( &fileapi_internal::Copy, - src_path, dest_path, - option == fileapi::FileSystemOperation::OPTION_PRESERVE_LAST_MODIFIED, + src_path, + dest_path, + option == storage::FileSystemOperation::OPTION_PRESERVE_LAST_MODIFIED, google_apis::CreateRelayCallback(callback)), base::Bind(callback, base::File::FILE_ERROR_FAILED)); } void AsyncFileUtil::MoveFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -339,9 +338,9 @@ void AsyncFileUtil::MoveFileLocal( } void AsyncFileUtil::CopyInForeignFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -360,8 +359,8 @@ void AsyncFileUtil::CopyInForeignFile( } void AsyncFileUtil::DeleteFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -380,8 +379,8 @@ void AsyncFileUtil::DeleteFile( } void AsyncFileUtil::DeleteDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -400,8 +399,8 @@ void AsyncFileUtil::DeleteDirectory( } void AsyncFileUtil::DeleteRecursively( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -420,8 +419,8 @@ void AsyncFileUtil::DeleteRecursively( } void AsyncFileUtil::CreateSnapshotFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -430,7 +429,7 @@ void AsyncFileUtil::CreateSnapshotFile( callback.Run(base::File::FILE_ERROR_NOT_FOUND, base::File::Info(), base::FilePath(), - scoped_refptr<webkit_blob::ShareableFileReference>()); + scoped_refptr<storage::ShareableFileReference>()); return; } @@ -444,7 +443,7 @@ void AsyncFileUtil::CreateSnapshotFile( base::File::FILE_ERROR_FAILED, base::File::Info(), base::FilePath(), - scoped_refptr<webkit_blob::ShareableFileReference>())); + scoped_refptr<storage::ShareableFileReference>())); } } // namespace internal diff --git a/chrome/browser/chromeos/drive/fileapi/async_file_util.h b/chrome/browser/chromeos/drive/fileapi/async_file_util.h index 607758b..b408a336 100644 --- a/chrome/browser/chromeos/drive/fileapi/async_file_util.h +++ b/chrome/browser/chromeos/drive/fileapi/async_file_util.h @@ -15,80 +15,78 @@ class FileSystemInterface; namespace internal { -// The implementation of fileapi::AsyncFileUtil for Drive File System. -class AsyncFileUtil : public fileapi::AsyncFileUtil { +// The implementation of storage::AsyncFileUtil for Drive File System. +class AsyncFileUtil : public storage::AsyncFileUtil { public: AsyncFileUtil(); virtual ~AsyncFileUtil(); - // fileapi::AsyncFileUtil overrides. + // storage::AsyncFileUtil overrides. virtual void CreateOrOpen( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) OVERRIDE; virtual void EnsureFileExists( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const EnsureFileExistsCallback& callback) OVERRIDE; virtual void CreateDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) OVERRIDE; virtual void GetFileInfo( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) OVERRIDE; virtual void ReadDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; - virtual void Touch( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - const base::Time& last_access_time, - const base::Time& last_modified_time, - const StatusCallback& callback) OVERRIDE; - virtual void Truncate( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - int64 length, - const StatusCallback& callback) OVERRIDE; + virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + const base::Time& last_access_time, + const base::Time& last_modified_time, + const StatusCallback& callback) OVERRIDE; + virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + int64 length, + const StatusCallback& callback) OVERRIDE; virtual void CopyFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) OVERRIDE; virtual void MoveFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) OVERRIDE; virtual void CopyInForeignFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) OVERRIDE; virtual void DeleteFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteRecursively( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void CreateSnapshotFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) OVERRIDE; private: diff --git a/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.cc b/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.cc index 9e7cfe4..e71688d 100644 --- a/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.cc +++ b/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.cc @@ -30,50 +30,54 @@ FileSystemBackendDelegate::FileSystemBackendDelegate() FileSystemBackendDelegate::~FileSystemBackendDelegate() { } -fileapi::AsyncFileUtil* FileSystemBackendDelegate::GetAsyncFileUtil( - fileapi::FileSystemType type) { +storage::AsyncFileUtil* FileSystemBackendDelegate::GetAsyncFileUtil( + storage::FileSystemType type) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DCHECK_EQ(fileapi::kFileSystemTypeDrive, type); + DCHECK_EQ(storage::kFileSystemTypeDrive, type); return async_file_util_.get(); } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> FileSystemBackendDelegate::CreateFileStreamReader( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) { + storage::FileSystemContext* context) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DCHECK_EQ(fileapi::kFileSystemTypeDrive, url.type()); + DCHECK_EQ(storage::kFileSystemTypeDrive, url.type()); base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url); if (file_path.empty()) - return scoped_ptr<webkit_blob::FileStreamReader>(); + return scoped_ptr<storage::FileStreamReader>(); - return scoped_ptr<webkit_blob::FileStreamReader>( + return scoped_ptr<storage::FileStreamReader>( new internal::WebkitFileStreamReaderImpl( base::Bind(&fileapi_internal::GetFileSystemFromUrl, url), context->default_file_task_runner(), - file_path, offset, expected_modification_time)); + file_path, + offset, + expected_modification_time)); } -scoped_ptr<fileapi::FileStreamWriter> +scoped_ptr<storage::FileStreamWriter> FileSystemBackendDelegate::CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) { + storage::FileSystemContext* context) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DCHECK_EQ(fileapi::kFileSystemTypeDrive, url.type()); + DCHECK_EQ(storage::kFileSystemTypeDrive, url.type()); base::FilePath file_path = util::ExtractDrivePathFromFileSystemUrl(url); // Hosted documents don't support stream writer. if (file_path.empty() || util::HasHostedDocumentExtension(file_path)) - return scoped_ptr<fileapi::FileStreamWriter>(); + return scoped_ptr<storage::FileStreamWriter>(); - return scoped_ptr<fileapi::FileStreamWriter>( + return scoped_ptr<storage::FileStreamWriter>( new internal::WebkitFileStreamWriterImpl( base::Bind(&fileapi_internal::GetFileSystemFromUrl, url), - context->default_file_task_runner(),file_path, offset)); + context->default_file_task_runner(), + file_path, + offset)); } } // namespace drive diff --git a/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.h b/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.h index 0d859c97..dae45ff 100644 --- a/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.h +++ b/chrome/browser/chromeos/drive/fileapi/file_system_backend_delegate.h @@ -9,9 +9,9 @@ #include "base/memory/scoped_ptr.h" #include "chrome/browser/chromeos/fileapi/file_system_backend_delegate.h" -namespace fileapi { +namespace storage { class AsyncFileUtil; -} // namespace fileapi +} // namespace storage namespace drive { @@ -23,20 +23,20 @@ class FileSystemBackendDelegate : public chromeos::FileSystemBackendDelegate { virtual ~FileSystemBackendDelegate(); // FileSystemBackend::Delegate overrides. - virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( - fileapi::FileSystemType type) OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( - const fileapi::FileSystemURL& url, + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE; + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) OVERRIDE; - virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + storage::FileSystemContext* context) OVERRIDE; + virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) OVERRIDE; + storage::FileSystemContext* context) OVERRIDE; private: - scoped_ptr<fileapi::AsyncFileUtil> async_file_util_; + scoped_ptr<storage::AsyncFileUtil> async_file_util_; DISALLOW_COPY_AND_ASSIGN(FileSystemBackendDelegate); }; diff --git a/chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc b/chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc index 29657e0..7c0e0dc 100644 --- a/chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc +++ b/chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc @@ -71,12 +71,12 @@ void RunReadDirectoryCallbackWithEntries( scoped_ptr<ResourceEntryVector> resource_entries) { DCHECK(resource_entries); - std::vector<fileapi::DirectoryEntry> entries; + std::vector<storage::DirectoryEntry> entries; // Convert drive files to File API's directory entry. entries.reserve(resource_entries->size()); for (size_t i = 0; i < resource_entries->size(); ++i) { const ResourceEntry& resource_entry = (*resource_entries)[i]; - fileapi::DirectoryEntry entry; + storage::DirectoryEntry entry; entry.name = resource_entry.base_name(); const PlatformFileInfoProto& file_info = resource_entry.file_info(); @@ -94,7 +94,8 @@ void RunReadDirectoryCallbackWithEntries( void RunReadDirectoryCallbackOnCompletion(const ReadDirectoryCallback& callback, FileError error) { callback.Run(FileErrorToBaseFileError(error), - std::vector<fileapi::DirectoryEntry>(), false /*has_more*/); + std::vector<storage::DirectoryEntry>(), + false /*has_more*/); } // Runs |callback| with arguments based on |error|, |local_path| and |entry|. @@ -103,10 +104,10 @@ void RunCreateSnapshotFileCallback(const CreateSnapshotFileCallback& callback, const base::FilePath& local_path, scoped_ptr<ResourceEntry> entry) { if (error != FILE_ERROR_OK) { - callback.Run( - FileErrorToBaseFileError(error), - base::File::Info(), base::FilePath(), - webkit_blob::ScopedFile::ScopeOutPolicy()); + callback.Run(FileErrorToBaseFileError(error), + base::File::Info(), + base::FilePath(), + storage::ScopedFile::ScopeOutPolicy()); return; } @@ -125,10 +126,10 @@ void RunCreateSnapshotFileCallback(const CreateSnapshotFileCallback& callback, // If the file is a hosted document, a temporary JSON file is created to // represent the document. The JSON file is not cached and its lifetime // is managed by ShareableFileReference. - webkit_blob::ScopedFile::ScopeOutPolicy scope_out_policy = - entry->file_specific_info().is_hosted_document() ? - webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT : - webkit_blob::ScopedFile::DONT_DELETE_ON_SCOPE_OUT; + storage::ScopedFile::ScopeOutPolicy scope_out_policy = + entry->file_specific_info().is_hosted_document() + ? storage::ScopedFile::DELETE_ON_SCOPE_OUT + : storage::ScopedFile::DONT_DELETE_ON_SCOPE_OUT; callback.Run(base::File::FILE_OK, file_info, local_path, scope_out_policy); } @@ -192,7 +193,7 @@ void OpenFileAfterFileSystemOpenFile(int file_flags, } // namespace -FileSystemInterface* GetFileSystemFromUrl(const fileapi::FileSystemURL& url) { +FileSystemInterface* GetFileSystemFromUrl(const storage::FileSystemURL& url) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); Profile* profile = util::ExtractProfileFromPath(url.path()); diff --git a/chrome/browser/chromeos/drive/fileapi/fileapi_worker.h b/chrome/browser/chromeos/drive/fileapi/fileapi_worker.h index 6894279..3949d36 100644 --- a/chrome/browser/chromeos/drive/fileapi/fileapi_worker.h +++ b/chrome/browser/chromeos/drive/fileapi/fileapi_worker.h @@ -31,10 +31,10 @@ namespace base { class FilePath; } // namespace base -namespace fileapi { +namespace storage { struct DirectoryEntry; class FileSystemURL; -} // namespace fileapi +} // namespace storage namespace drive { @@ -51,14 +51,13 @@ typedef base::Callback< const base::File::Info& file_info)> GetFileInfoCallback; typedef base::Callback< void(base::File::Error result, - const std::vector<fileapi::DirectoryEntry>& file_list, + const std::vector<storage::DirectoryEntry>& file_list, bool has_more)> ReadDirectoryCallback; -typedef base::Callback< - void(base::File::Error result, - const base::File::Info& file_info, - const base::FilePath& snapshot_file_path, - webkit_blob::ScopedFile::ScopeOutPolicy scope_out_policy)> - CreateSnapshotFileCallback; +typedef base::Callback<void(base::File::Error result, + const base::File::Info& file_info, + const base::FilePath& snapshot_file_path, + storage::ScopedFile::ScopeOutPolicy + scope_out_policy)> CreateSnapshotFileCallback; typedef base::Callback< void(base::File::Error result, const base::FilePath& snapshot_file_path, @@ -71,7 +70,7 @@ typedef base::Callback< // Gets the profile of the Drive entry pointed by |url|. Used as // FileSystemGetter callback by binding an URL on the IO thread and passing to // the UI thread. -FileSystemInterface* GetFileSystemFromUrl(const fileapi::FileSystemURL& url); +FileSystemInterface* GetFileSystemFromUrl(const storage::FileSystemURL& url); // Runs |file_system_getter| to obtain the instance of FileSystemInstance, // and then runs |callback| with it. diff --git a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl.h b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl.h index ddf4845..6b3e21b 100644 --- a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl.h +++ b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_reader_impl.h @@ -25,12 +25,12 @@ class ResourceEntry; namespace internal { -// The implementation of webkit_blob::FileStreamReader for drive file system. -// webkit_blob::FileStreamReader does not provide a way for explicit +// The implementation of storage::FileStreamReader for drive file system. +// storage::FileStreamReader does not provide a way for explicit // initialization, hence the initialization of this class will be done lazily. // Note that when crbug.com/225339 is resolved, this class will be also // initialized explicitly. -class WebkitFileStreamReaderImpl : public webkit_blob::FileStreamReader { +class WebkitFileStreamReaderImpl : public storage::FileStreamReader { public: WebkitFileStreamReaderImpl( const DriveFileStreamReader::FileSystemGetter& file_system_getter, @@ -40,7 +40,7 @@ class WebkitFileStreamReaderImpl : public webkit_blob::FileStreamReader { const base::Time& expected_modification_time); virtual ~WebkitFileStreamReaderImpl(); - // webkit_blob::FileStreamReader override. + // storage::FileStreamReader override. virtual int Read(net::IOBuffer* buffer, int buffer_length, const net::CompletionCallback& callback) OVERRIDE; diff --git a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_writer_impl.cc b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_writer_impl.cc index 63df4d1..486f814 100644 --- a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_writer_impl.cc +++ b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_writer_impl.cc @@ -168,9 +168,11 @@ void WebkitFileStreamWriterImpl::WriteAfterCreateWritableSnapshotFile( // Keep |close_callback| to close the file when the stream is destructed. DCHECK(!close_callback_on_ui_thread.is_null()); close_callback_on_ui_thread_ = close_callback_on_ui_thread; - local_file_writer_.reset(fileapi::FileStreamWriter::CreateForLocalFile( - file_task_runner_.get(), local_path, offset_, - fileapi::FileStreamWriter::OPEN_EXISTING_FILE)); + local_file_writer_.reset(storage::FileStreamWriter::CreateForLocalFile( + file_task_runner_.get(), + local_path, + offset_, + storage::FileStreamWriter::OPEN_EXISTING_FILE)); int result = local_file_writer_->Write(buf, buf_len, callback); if (result != net::ERR_IO_PENDING) callback.Run(result); diff --git a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_writer_impl.h b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_writer_impl.h index f4d5d40..5a6f95f 100644 --- a/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_writer_impl.h +++ b/chrome/browser/chromeos/drive/fileapi/webkit_file_stream_writer_impl.h @@ -27,8 +27,8 @@ class FileSystemInterface; namespace internal { -// The implementation of fileapi::FileStreamWriter for the Drive File System. -class WebkitFileStreamWriterImpl : public fileapi::FileStreamWriter { +// The implementation of storage::FileStreamWriter for the Drive File System. +class WebkitFileStreamWriterImpl : public storage::FileStreamWriter { public: // Callback to return the FileSystemInterface instance. This is an // injecting point for testing. @@ -66,7 +66,7 @@ class WebkitFileStreamWriterImpl : public fileapi::FileStreamWriter { const base::FilePath file_path_; const int64 offset_; - scoped_ptr<fileapi::FileStreamWriter> local_file_writer_; + scoped_ptr<storage::FileStreamWriter> local_file_writer_; base::Closure close_callback_on_ui_thread_; net::CompletionCallback pending_write_callback_; net::CompletionCallback pending_cancel_callback_; diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.cc b/chrome/browser/chromeos/extensions/file_manager/event_router.cc index a668c70..32e99b0 100644 --- a/chrome/browser/chromeos/extensions/file_manager/event_router.cc +++ b/chrome/browser/chromeos/extensions/file_manager/event_router.cc @@ -195,13 +195,13 @@ MountErrorToMountCompletedStatus(chromeos::MountError error) { file_browser_private::CopyProgressStatusType CopyProgressTypeToCopyProgressStatusType( - fileapi::FileSystemOperation::CopyProgressType type) { + storage::FileSystemOperation::CopyProgressType type) { switch (type) { - case fileapi::FileSystemOperation::BEGIN_COPY_ENTRY: + case storage::FileSystemOperation::BEGIN_COPY_ENTRY: return file_browser_private::COPY_PROGRESS_STATUS_TYPE_BEGIN_COPY_ENTRY; - case fileapi::FileSystemOperation::END_COPY_ENTRY: + case storage::FileSystemOperation::END_COPY_ENTRY: return file_browser_private::COPY_PROGRESS_STATUS_TYPE_END_COPY_ENTRY; - case fileapi::FileSystemOperation::PROGRESS: + case storage::FileSystemOperation::PROGRESS: return file_browser_private::COPY_PROGRESS_STATUS_TYPE_PROGRESS; } NOTREACHED(); @@ -527,7 +527,7 @@ void EventRouter::OnCopyCompleted(int copy_id, void EventRouter::OnCopyProgress( int copy_id, - fileapi::FileSystemOperation::CopyProgressType type, + storage::FileSystemOperation::CopyProgressType type, const GURL& source_url, const GURL& destination_url, int64 size) { @@ -536,9 +536,9 @@ void EventRouter::OnCopyProgress( file_browser_private::CopyProgressStatus status; status.type = CopyProgressTypeToCopyProgressStatusType(type); status.source_url.reset(new std::string(source_url.spec())); - if (type == fileapi::FileSystemOperation::END_COPY_ENTRY) + if (type == storage::FileSystemOperation::END_COPY_ENTRY) status.destination_url.reset(new std::string(destination_url.spec())); - if (type == fileapi::FileSystemOperation::PROGRESS) + if (type == storage::FileSystemOperation::PROGRESS) status.size.reset(new double(size)); // Should not skip events other than TYPE_PROGRESS. diff --git a/chrome/browser/chromeos/extensions/file_manager/event_router.h b/chrome/browser/chromeos/extensions/file_manager/event_router.h index 7a90bcd..30cc623 100644 --- a/chrome/browser/chromeos/extensions/file_manager/event_router.h +++ b/chrome/browser/chromeos/extensions/file_manager/event_router.h @@ -90,7 +90,7 @@ class EventRouter // Called when a copy task progress is updated. void OnCopyProgress(int copy_id, - fileapi::FileSystemOperation::CopyProgressType type, + storage::FileSystemOperation::CopyProgressType type, const GURL& source_url, const GURL& destination_url, int64 size); diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc index bd84982..5cf8cdf 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc @@ -315,7 +315,7 @@ void FileBrowserHandlerInternalSelectFileFunction::OnFilePathSelected( return; } - fileapi::ExternalFileSystemBackend* external_backend = + storage::ExternalFileSystemBackend* external_backend = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host())->external_backend(); DCHECK(external_backend); diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api_test.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api_test.cc index 7a87e3d..56dc1a3 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api_test.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api_test.cc @@ -171,11 +171,11 @@ class FileBrowserHandlerExtensionTest : public ExtensionApiTest { // Creates new, test mount point. void AddTmpMountPoint(const std::string& extension_id) { - BrowserContext::GetMountPoints(browser()->profile())->RegisterFileSystem( - "tmp", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), - tmp_mount_point_); + BrowserContext::GetMountPoints(browser()->profile()) + ->RegisterFileSystem("tmp", + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), + tmp_mount_point_); } base::FilePath GetFullPathOnTmpMountPoint( diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc index aa25486..51c13c6 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc @@ -43,7 +43,7 @@ using content::BrowserThread; using content::ChildProcessSecurityPolicy; using file_manager::util::EntryDefinition; using file_manager::util::FileDefinition; -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace extensions { namespace { @@ -88,8 +88,8 @@ file_manager::EventRouter* GetEventRouterByProfileId(void* profile_id) { // Notifies the copy progress to extensions via event router. void NotifyCopyProgress( void* profile_id, - fileapi::FileSystemOperationRunner::OperationID operation_id, - fileapi::FileSystemOperation::CopyProgressType type, + storage::FileSystemOperationRunner::OperationID operation_id, + storage::FileSystemOperation::CopyProgressType type, const FileSystemURL& source_url, const FileSystemURL& destination_url, int64 size) { @@ -107,8 +107,8 @@ void NotifyCopyProgress( // Callback invoked periodically on progress update of Copy(). void OnCopyProgress( void* profile_id, - fileapi::FileSystemOperationRunner::OperationID* operation_id, - fileapi::FileSystemOperation::CopyProgressType type, + storage::FileSystemOperationRunner::OperationID* operation_id, + storage::FileSystemOperation::CopyProgressType type, const FileSystemURL& source_url, const FileSystemURL& destination_url, int64 size) { @@ -124,7 +124,7 @@ void OnCopyProgress( // Notifies the copy completion to extensions via event router. void NotifyCopyCompletion( void* profile_id, - fileapi::FileSystemOperationRunner::OperationID operation_id, + storage::FileSystemOperationRunner::OperationID operation_id, const FileSystemURL& source_url, const FileSystemURL& destination_url, base::File::Error error) { @@ -142,7 +142,7 @@ void NotifyCopyCompletion( // failed). void OnCopyCompleted( void* profile_id, - fileapi::FileSystemOperationRunner::OperationID* operation_id, + storage::FileSystemOperationRunner::OperationID* operation_id, const FileSystemURL& source_url, const FileSystemURL& destination_url, base::File::Error error) { @@ -156,9 +156,9 @@ void OnCopyCompleted( } // Starts the copy operation via FileSystemOperationRunner. -fileapi::FileSystemOperationRunner::OperationID StartCopyOnIOThread( +storage::FileSystemOperationRunner::OperationID StartCopyOnIOThread( void* profile_id, - scoped_refptr<fileapi::FileSystemContext> file_system_context, + scoped_refptr<storage::FileSystemContext> file_system_context, const FileSystemURL& source_url, const FileSystemURL& destination_url) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -166,16 +166,18 @@ fileapi::FileSystemOperationRunner::OperationID StartCopyOnIOThread( // Note: |operation_id| is owned by the callback for // FileSystemOperationRunner::Copy(). It is always called in the next message // loop or later, so at least during this invocation it should alive. - fileapi::FileSystemOperationRunner::OperationID* operation_id = - new fileapi::FileSystemOperationRunner::OperationID; + storage::FileSystemOperationRunner::OperationID* operation_id = + new storage::FileSystemOperationRunner::OperationID; *operation_id = file_system_context->operation_runner()->Copy( - source_url, destination_url, - fileapi::FileSystemOperation::OPTION_PRESERVE_LAST_MODIFIED, - base::Bind(&OnCopyProgress, - profile_id, base::Unretained(operation_id)), + source_url, + destination_url, + storage::FileSystemOperation::OPTION_PRESERVE_LAST_MODIFIED, + base::Bind(&OnCopyProgress, profile_id, base::Unretained(operation_id)), base::Bind(&OnCopyCompleted, - profile_id, base::Owned(operation_id), - source_url, destination_url)); + profile_id, + base::Owned(operation_id), + source_url, + destination_url)); return *operation_id; } @@ -190,8 +192,8 @@ void OnCopyCancelled(base::File::Error error) { // Cancels the running copy operation identified by |operation_id|. void CancelCopyOnIOThread( - scoped_refptr<fileapi::FileSystemContext> file_system_context, - fileapi::FileSystemOperationRunner::OperationID operation_id) { + scoped_refptr<storage::FileSystemContext> file_system_context, + storage::FileSystemOperationRunner::OperationID operation_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); file_system_context->operation_runner()->Cancel( @@ -208,12 +210,12 @@ void FileBrowserPrivateRequestFileSystemFunction::DidFail( SendResponse(false); } -bool FileBrowserPrivateRequestFileSystemFunction:: - SetupFileSystemAccessPermissions( - scoped_refptr<fileapi::FileSystemContext> file_system_context, - int child_id, - Profile* profile, - scoped_refptr<const extensions::Extension> extension) { +bool +FileBrowserPrivateRequestFileSystemFunction::SetupFileSystemAccessPermissions( + scoped_refptr<storage::FileSystemContext> file_system_context, + int child_id, + Profile* profile, + scoped_refptr<const extensions::Extension> extension) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!extension.get()) @@ -227,7 +229,7 @@ bool FileBrowserPrivateRequestFileSystemFunction:: return false; } - fileapi::ExternalFileSystemBackend* backend = + storage::ExternalFileSystemBackend* backend = file_system_context->external_backend(); if (!backend) return false; @@ -282,7 +284,7 @@ bool FileBrowserPrivateRequestFileSystemFunction::RunAsync() { return false; } - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host()); @@ -355,7 +357,7 @@ bool FileWatchFunctionBase::RunAsync() { if (!args_->GetString(0, &url) || url.empty()) return false; - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host()); @@ -478,17 +480,17 @@ bool FileBrowserPrivateValidatePathNameLengthFunction::RunAsync() { const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host()); - fileapi::FileSystemURL filesystem_url( + storage::FileSystemURL filesystem_url( file_system_context->CrackURL(GURL(params->parent_directory_url))); if (!chromeos::FileSystemBackend::CanHandleURL(filesystem_url)) return false; // No explicit limit on the length of Drive file names. - if (filesystem_url.type() == fileapi::kFileSystemTypeDrive) { + if (filesystem_url.type() == storage::kFileSystemTypeDrive) { SetResult(new base::FundamentalValue(true)); SendResponse(true); return true; @@ -547,7 +549,7 @@ bool FileBrowserPrivateStartCopyFunction::RunAsync() { return false; } - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host()); @@ -557,9 +559,9 @@ bool FileBrowserPrivateStartCopyFunction::RunAsync() { destination_url_string += '/'; destination_url_string += net::EscapePath(params->new_name); - fileapi::FileSystemURL source_url( + storage::FileSystemURL source_url( file_system_context->CrackURL(GURL(params->source_url))); - fileapi::FileSystemURL destination_url( + storage::FileSystemURL destination_url( file_system_context->CrackURL(GURL(destination_url_string))); if (!source_url.is_valid() || !destination_url.is_valid()) { @@ -595,7 +597,7 @@ bool FileBrowserPrivateCancelCopyFunction::RunAsync() { const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host()); @@ -614,12 +616,12 @@ bool FileBrowserPrivateInternalResolveIsolatedEntriesFunction::RunAsync() { const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host()); DCHECK(file_system_context); - const fileapi::ExternalFileSystemBackend* external_backend = + const storage::ExternalFileSystemBackend* external_backend = file_system_context->external_backend(); DCHECK(external_backend); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h index 480b9cf..27375e2 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h @@ -18,7 +18,7 @@ namespace base { class FilePath; } -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -56,7 +56,7 @@ class FileBrowserPrivateRequestFileSystemFunction // Sets up file system access permissions to the extension identified by // |child_id|. bool SetupFileSystemAccessPermissions( - scoped_refptr<fileapi::FileSystemContext> file_system_context, + scoped_refptr<storage::FileSystemContext> file_system_context, int child_id, Profile* profile, scoped_refptr<const extensions::Extension> extension); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc index f1995ef..9f5b46a 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc @@ -19,7 +19,7 @@ #include "webkit/browser/fileapi/file_system_url.h" using content::BrowserThread; -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace extensions { namespace { @@ -31,7 +31,7 @@ const char kInvalidFileUrl[] = "Invalid file URL"; // Make a set of unique filename suffixes out of the list of file URLs. std::set<std::string> GetUniqueSuffixes( const std::vector<std::string>& file_url_list, - const fileapi::FileSystemContext* context) { + const storage::FileSystemContext* context) { std::set<std::string> suffixes; for (size_t i = 0; i < file_url_list.size(); ++i) { const FileSystemURL url = context->CrackURL(GURL(file_url_list[i])); @@ -79,7 +79,7 @@ bool FileBrowserPrivateExecuteTaskFunction::RunAsync() { return true; } - const scoped_refptr<fileapi::FileSystemContext> file_system_context = + const scoped_refptr<storage::FileSystemContext> file_system_context = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host()); @@ -134,7 +134,7 @@ bool FileBrowserPrivateGetFileTasksFunction::RunAsync() { if (params->file_urls.empty()) return false; - const scoped_refptr<fileapi::FileSystemContext> file_system_context = + const scoped_refptr<storage::FileSystemContext> file_system_context = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host()); @@ -142,7 +142,7 @@ bool FileBrowserPrivateGetFileTasksFunction::RunAsync() { // file paths. for (size_t i = 0; i < params->file_urls.size(); ++i) { const GURL file_url(params->file_urls[i]); - fileapi::FileSystemURL file_system_url( + storage::FileSystemURL file_system_url( file_system_context->CrackURL(file_url)); if (!chromeos::FileSystemBackend::CanHandleURL(file_system_url)) continue; @@ -199,7 +199,7 @@ bool FileBrowserPrivateSetDefaultTaskFunction::RunSync() { const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); - const scoped_refptr<fileapi::FileSystemContext> file_system_context = + const scoped_refptr<storage::FileSystemContext> file_system_context = file_manager::util::GetFileSystemContextForRenderViewHost( GetProfile(), render_view_host()); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_util.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_util.cc index 87fe9b4..4cae82a1 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_util.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_util.cc @@ -275,10 +275,10 @@ base::FilePath GetLocalPathFromURL(content::RenderViewHost* render_view_host, DCHECK(render_view_host); DCHECK(profile); - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = util::GetFileSystemContextForRenderViewHost(profile, render_view_host); - const fileapi::FileSystemURL filesystem_url( + const storage::FileSystemURL filesystem_url( file_system_context->CrackURL(url)); base::FilePath path; if (!chromeos::FileSystemBackend::CanHandleURL(filesystem_url)) diff --git a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc index ecdfb71..fc6330c 100644 --- a/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc +++ b/chrome/browser/chromeos/file_manager/external_filesystem_apitest.cc @@ -408,11 +408,11 @@ class LocalFileSystemExtensionApiTest : public FileSystemExtensionApiTestBase { // FileSystemExtensionApiTestBase OVERRIDE. virtual void AddTestMountPoint() OVERRIDE { - EXPECT_TRUE(content::BrowserContext::GetMountPoints(browser()->profile())-> - RegisterFileSystem(kLocalMountPointName, - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), - mount_point_dir_)); + EXPECT_TRUE(content::BrowserContext::GetMountPoints(browser()->profile()) + ->RegisterFileSystem(kLocalMountPointName, + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), + mount_point_dir_)); VolumeManager::Get(browser()->profile())->AddVolumeInfoForTesting( mount_point_dir_, VOLUME_TYPE_TESTING, chromeos::DEVICE_TYPE_UNKNOWN); } @@ -438,11 +438,12 @@ class RestrictedFileSystemExtensionApiTest // FileSystemExtensionApiTestBase OVERRIDE. virtual void AddTestMountPoint() OVERRIDE { - EXPECT_TRUE(content::BrowserContext::GetMountPoints(browser()->profile())-> - RegisterFileSystem(kRestrictedMountPointName, - fileapi::kFileSystemTypeRestrictedNativeLocal, - fileapi::FileSystemMountOption(), - mount_point_dir_)); + EXPECT_TRUE( + content::BrowserContext::GetMountPoints(browser()->profile()) + ->RegisterFileSystem(kRestrictedMountPointName, + storage::kFileSystemTypeRestrictedNativeLocal, + storage::FileSystemMountOption(), + mount_point_dir_)); VolumeManager::Get(browser()->profile())->AddVolumeInfoForTesting( mount_point_dir_, VOLUME_TYPE_TESTING, chromeos::DEVICE_TYPE_UNKNOWN); } @@ -627,8 +628,8 @@ class LocalAndDriveFileSystemExtensionApiTest virtual void AddTestMountPoint() OVERRIDE { EXPECT_TRUE(content::BrowserContext::GetMountPoints(browser()->profile()) ->RegisterFileSystem(kLocalMountPointName, - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), local_mount_point_dir_)); VolumeManager::Get(browser()->profile()) ->AddVolumeInfoForTesting(local_mount_point_dir_, diff --git a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc index de4a35a..92b9bd5 100644 --- a/chrome/browser/chromeos/file_manager/file_browser_handlers.cc +++ b/chrome/browser/chromeos/file_manager/file_browser_handlers.cc @@ -42,7 +42,7 @@ using content::ChildProcessSecurityPolicy; using content::SiteInstance; using content::WebContents; using extensions::Extension; -using fileapi::FileSystemURL; +using storage::FileSystemURL; using file_manager::util::EntryDefinition; using file_manager::util::EntryDefinitionList; using file_manager::util::FileDefinition; @@ -165,7 +165,7 @@ class FileBrowserHandlerExecutor { // Checks legitimacy of file url and grants file RO access permissions from // handler (target) extension and its renderer process. static scoped_ptr<FileDefinitionList> SetupFileAccessPermissions( - scoped_refptr<fileapi::FileSystemContext> file_system_context_handler, + scoped_refptr<storage::FileSystemContext> file_system_context_handler, const scoped_refptr<const Extension>& handler_extension, const std::vector<FileSystemURL>& file_urls); @@ -199,13 +199,13 @@ class FileBrowserHandlerExecutor { // static scoped_ptr<FileDefinitionList> FileBrowserHandlerExecutor::SetupFileAccessPermissions( - scoped_refptr<fileapi::FileSystemContext> file_system_context_handler, + scoped_refptr<storage::FileSystemContext> file_system_context_handler, const scoped_refptr<const Extension>& handler_extension, const std::vector<FileSystemURL>& file_urls) { DCHECK_CURRENTLY_ON(BrowserThread::FILE); DCHECK(handler_extension.get()); - fileapi::ExternalFileSystemBackend* backend = + storage::ExternalFileSystemBackend* backend = file_system_context_handler->external_backend(); scoped_ptr<FileDefinitionList> file_definition_list(new FileDefinitionList); @@ -218,12 +218,12 @@ FileBrowserHandlerExecutor::SetupFileAccessPermissions( base::FilePath local_path = url.path(); base::FilePath virtual_path = url.virtual_path(); - const bool is_drive_file = url.type() == fileapi::kFileSystemTypeDrive; + const bool is_drive_file = url.type() == storage::kFileSystemTypeDrive; DCHECK(!is_drive_file || drive::util::IsUnderDriveMountPoint(local_path)); const bool is_native_file = - url.type() == fileapi::kFileSystemTypeNativeLocal || - url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal; + url.type() == storage::kFileSystemTypeNativeLocal || + url.type() == storage::kFileSystemTypeRestrictedNativeLocal; // If the file is from a physical volume, actual file must be found. if (is_native_file) { @@ -270,9 +270,8 @@ void FileBrowserHandlerExecutor::Execute( // Get file system context for the extension to which onExecute event will be // sent. The file access permissions will be granted to the extension in the // file system context for the files in |file_urls|. - scoped_refptr<fileapi::FileSystemContext> file_system_context( - util::GetFileSystemContextForExtensionId( - profile_, extension_->id())); + scoped_refptr<storage::FileSystemContext> file_system_context( + util::GetFileSystemContextForExtensionId(profile_, extension_->id())); BrowserThread::PostTaskAndReplyWithResult( BrowserThread::FILE, diff --git a/chrome/browser/chromeos/file_manager/file_browser_handlers.h b/chrome/browser/chromeos/file_manager/file_browser_handlers.h index de45ee3..07ad9be 100644 --- a/chrome/browser/chromeos/file_manager/file_browser_handlers.h +++ b/chrome/browser/chromeos/file_manager/file_browser_handlers.h @@ -23,7 +23,7 @@ namespace extensions { class Extension; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -47,7 +47,7 @@ bool ExecuteFileBrowserHandler( Profile* profile, const extensions::Extension* extension, const std::string& action_id, - const std::vector<fileapi::FileSystemURL>& file_urls, + const std::vector<storage::FileSystemURL>& file_urls, const file_tasks::FileTaskFinishedCallback& done); } // namespace file_browser_handlers diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc index cbf1f45b..a85b0b7 100644 --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc @@ -312,15 +312,15 @@ class FakeTestVolume : public LocalTestVolume { virtual bool Mount(Profile* profile) OVERRIDE { if (!CreateRootDirectory(profile)) return false; - fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); // First revoke the existing mount point (if any). mount_points->RevokeFileSystem(name()); const bool result = mount_points->RegisterFileSystem(name(), - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), root_path()); if (!result) return false; diff --git a/chrome/browser/chromeos/file_manager/file_tasks.cc b/chrome/browser/chromeos/file_manager/file_tasks.cc index 6b0f7a1..a04a7d1 100644 --- a/chrome/browser/chromeos/file_manager/file_tasks.cc +++ b/chrome/browser/chromeos/file_manager/file_tasks.cc @@ -37,7 +37,7 @@ using extensions::Extension; using extensions::app_file_handler_util::FindFileHandlersForFiles; -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace file_manager { namespace file_tasks { diff --git a/chrome/browser/chromeos/file_manager/file_tasks.h b/chrome/browser/chromeos/file_manager/file_tasks.h index c7b5a3c..c5667c1 100644 --- a/chrome/browser/chromeos/file_manager/file_tasks.h +++ b/chrome/browser/chromeos/file_manager/file_tasks.h @@ -127,7 +127,7 @@ namespace drive { class DriveAppRegistry; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -241,7 +241,7 @@ typedef base::Callback<void(extensions::api::file_browser_private::TaskResult bool ExecuteFileTask(Profile* profile, const GURL& source_url, const TaskDescriptor& task, - const std::vector<fileapi::FileSystemURL>& file_urls, + const std::vector<storage::FileSystemURL>& file_urls, const FileTaskFinishedCallback& done); typedef extensions::app_file_handler_util::PathAndMimeTypeSet diff --git a/chrome/browser/chromeos/file_manager/fileapi_util.cc b/chrome/browser/chromeos/file_manager/fileapi_util.cc index e840832..1573e8f 100644 --- a/chrome/browser/chromeos/file_manager/fileapi_util.cc +++ b/chrome/browser/chromeos/file_manager/fileapi_util.cc @@ -31,9 +31,9 @@ namespace { GURL ConvertRelativeFilePathToFileSystemUrl(const base::FilePath& relative_path, const std::string& extension_id) { - GURL base_url = fileapi::GetFileSystemRootURI( + GURL base_url = storage::GetFileSystemRootURI( extensions::Extension::GetBaseURLFromExtensionId(extension_id), - fileapi::kFileSystemTypeExternal); + storage::kFileSystemTypeExternal); return GURL(base_url.spec() + net::EscapeUrlEncodedData(relative_path.AsUTF8Unsafe(), false)); // Space to %20 instead of +. @@ -74,9 +74,9 @@ class FileDefinitionListConverter { void OnResolvedURL(scoped_ptr<FileDefinitionListConverter> self_deleter, FileDefinitionList::const_iterator iterator, base::File::Error error, - const fileapi::FileSystemInfo& info, + const storage::FileSystemInfo& info, const base::FilePath& file_path, - fileapi::FileSystemContext::ResolvedEntryType type); + storage::FileSystemContext::ResolvedEntryType type); // Called when the iterator is converted. Adds the |entry_definition| to // |results_| and calls ConvertNextIterator() for the next element. @@ -84,7 +84,7 @@ class FileDefinitionListConverter { FileDefinitionList::const_iterator iterator, const EntryDefinition& entry_definition); - scoped_refptr<fileapi::FileSystemContext> file_system_context_; + scoped_refptr<storage::FileSystemContext> file_system_context_; const std::string extension_id_; const FileDefinitionList file_definition_list_; const EntryDefinitionListCallback callback_; @@ -135,9 +135,9 @@ void FileDefinitionListConverter::ConvertNextIterator( return; } - fileapi::FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( + storage::FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL( extensions::Extension::GetBaseURLFromExtensionId(extension_id_), - fileapi::kFileSystemTypeExternal, + storage::kFileSystemTypeExternal, iterator->virtual_path); DCHECK(url.is_valid()); @@ -155,9 +155,9 @@ void FileDefinitionListConverter::OnResolvedURL( scoped_ptr<FileDefinitionListConverter> self_deleter, FileDefinitionList::const_iterator iterator, base::File::Error error, - const fileapi::FileSystemInfo& info, + const storage::FileSystemInfo& info, const base::FilePath& file_path, - fileapi::FileSystemContext::ResolvedEntryType type) { + storage::FileSystemContext::ResolvedEntryType type) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (error != base::File::FILE_OK) { @@ -171,13 +171,13 @@ void FileDefinitionListConverter::OnResolvedURL( entry_definition.file_system_root_url = info.root_url.spec(); entry_definition.file_system_name = info.name; switch (type) { - case fileapi::FileSystemContext::RESOLVED_ENTRY_FILE: + case storage::FileSystemContext::RESOLVED_ENTRY_FILE: entry_definition.is_directory = false; break; - case fileapi::FileSystemContext::RESOLVED_ENTRY_DIRECTORY: + case storage::FileSystemContext::RESOLVED_ENTRY_DIRECTORY: entry_definition.is_directory = true; break; - case fileapi::FileSystemContext::RESOLVED_ENTRY_NOT_FOUND: + case storage::FileSystemContext::RESOLVED_ENTRY_NOT_FOUND: entry_definition.is_directory = iterator->is_directory; break; } @@ -215,12 +215,12 @@ void OnConvertFileDefinitionDone( // Used to implement CheckIfDirectoryExists(). void CheckIfDirectoryExistsOnIOThread( - scoped_refptr<fileapi::FileSystemContext> file_system_context, + scoped_refptr<storage::FileSystemContext> file_system_context, const GURL& url, - const fileapi::FileSystemOperationRunner::StatusCallback& callback) { + const storage::FileSystemOperationRunner::StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - fileapi::FileSystemURL file_system_url = file_system_context->CrackURL(url); + storage::FileSystemURL file_system_url = file_system_context->CrackURL(url); file_system_context->operation_runner()->DirectoryExists( file_system_url, callback); } @@ -233,7 +233,7 @@ EntryDefinition::EntryDefinition() { EntryDefinition::~EntryDefinition() { } -fileapi::FileSystemContext* GetFileSystemContextForExtensionId( +storage::FileSystemContext* GetFileSystemContextForExtensionId( Profile* profile, const std::string& extension_id) { GURL site = extensions::util::GetSiteForExtensionId(extension_id, profile); @@ -241,7 +241,7 @@ fileapi::FileSystemContext* GetFileSystemContextForExtensionId( GetFileSystemContext(); } -fileapi::FileSystemContext* GetFileSystemContextForRenderViewHost( +storage::FileSystemContext* GetFileSystemContextForRenderViewHost( Profile* profile, content::RenderViewHost* render_view_host) { content::SiteInstance* site_instance = render_view_host->GetSiteInstance(); @@ -301,9 +301,10 @@ bool ConvertAbsoluteFilePathToRelativeFileSystemPath( // extension's site is the one in whose file system context the virtual path // should be found. GURL site = extensions::util::GetSiteForExtensionId(extension_id, profile); - fileapi::ExternalFileSystemBackend* backend = - content::BrowserContext::GetStoragePartitionForSite(profile, site)-> - GetFileSystemContext()->external_backend(); + storage::ExternalFileSystemBackend* backend = + content::BrowserContext::GetStoragePartitionForSite(profile, site) + ->GetFileSystemContext() + ->external_backend(); if (!backend) return false; @@ -343,14 +344,14 @@ void ConvertFileDefinitionToEntryDefinition( } void CheckIfDirectoryExists( - scoped_refptr<fileapi::FileSystemContext> file_system_context, + scoped_refptr<storage::FileSystemContext> file_system_context, const GURL& url, - const fileapi::FileSystemOperationRunner::StatusCallback& callback) { + const storage::FileSystemOperationRunner::StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); // Check the existence of directory using file system API implementation on // behalf of the file manager app. We need to grant access beforehand. - fileapi::ExternalFileSystemBackend* backend = + storage::ExternalFileSystemBackend* backend = file_system_context->external_backend(); DCHECK(backend); backend->GrantFullAccessToExtension(kFileManagerAppId); diff --git a/chrome/browser/chromeos/file_manager/fileapi_util.h b/chrome/browser/chromeos/file_manager/fileapi_util.h index fe9c52f..13d37c1 100644 --- a/chrome/browser/chromeos/file_manager/fileapi_util.h +++ b/chrome/browser/chromeos/file_manager/fileapi_util.h @@ -21,7 +21,7 @@ namespace content { class RenderViewHost; } -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -65,13 +65,13 @@ typedef base::Callback<void(scoped_ptr< // Returns a file system context associated with the given profile and the // extension ID. -fileapi::FileSystemContext* GetFileSystemContextForExtensionId( +storage::FileSystemContext* GetFileSystemContextForExtensionId( Profile* profile, const std::string& extension_id); // Returns a file system context associated with the given profile and the // render view host. -fileapi::FileSystemContext* GetFileSystemContextForRenderViewHost( +storage::FileSystemContext* GetFileSystemContextForRenderViewHost( Profile* profile, content::RenderViewHost* render_view_host); @@ -127,9 +127,9 @@ void ConvertFileDefinitionListToEntryDefinitionList( // Checks if a directory exists at |url|. void CheckIfDirectoryExists( - scoped_refptr<fileapi::FileSystemContext> file_system_context, + scoped_refptr<storage::FileSystemContext> file_system_context, const GURL& url, - const fileapi::FileSystemOperationRunner::StatusCallback& callback); + const storage::FileSystemOperationRunner::StatusCallback& callback); } // namespace util } // namespace file_manager diff --git a/chrome/browser/chromeos/file_manager/filesystem_api_util.cc b/chrome/browser/chromeos/file_manager/filesystem_api_util.cc index 34bfb97f..259384e 100644 --- a/chrome/browser/chromeos/file_manager/filesystem_api_util.cc +++ b/chrome/browser/chromeos/file_manager/filesystem_api_util.cc @@ -68,9 +68,9 @@ void BoolCallbackAsFileErrorCallback( // Part of PrepareFileOnIOThread. It tries to create a new file if the given // |url| is not already inhabited. void PrepareFileAfterCheckExistOnIOThread( - scoped_refptr<fileapi::FileSystemContext> file_system_context, - const fileapi::FileSystemURL& url, - const fileapi::FileSystemOperation::StatusCallback& callback, + scoped_refptr<storage::FileSystemContext> file_system_context, + const storage::FileSystemURL& url, + const storage::FileSystemOperation::StatusCallback& callback, base::File::Error error) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); @@ -91,8 +91,8 @@ void PrepareFileAfterCheckExistOnIOThread( // Checks whether a file exists at the given |url|, and try creating it if it // is not already there. void PrepareFileOnIOThread( - scoped_refptr<fileapi::FileSystemContext> file_system_context, - const fileapi::FileSystemURL& url, + scoped_refptr<storage::FileSystemContext> file_system_context, + const storage::FileSystemURL& url, const base::Callback<void(bool)>& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); @@ -116,15 +116,15 @@ bool IsUnderNonNativeLocalPath(Profile* profile, return false; } - fileapi::FileSystemURL filesystem_url = - GetFileSystemContextForExtensionId(profile, - kFileManagerAppId)->CrackURL(url); + storage::FileSystemURL filesystem_url = + GetFileSystemContextForExtensionId(profile, kFileManagerAppId) + ->CrackURL(url); if (!filesystem_url.is_valid()) return false; switch (filesystem_url.type()) { - case fileapi::kFileSystemTypeNativeLocal: - case fileapi::kFileSystemTypeRestrictedNativeLocal: + case storage::kFileSystemTypeNativeLocal: + case storage::kFileSystemTypeRestrictedNativeLocal: return false; default: // The path indeed corresponds to a mount point not associated with a @@ -224,7 +224,7 @@ void PrepareNonNativeLocalFileForWritableApp( return; } - fileapi::FileSystemContext* const context = + storage::FileSystemContext* const context = GetFileSystemContextForExtensionId(profile, kFileManagerAppId); DCHECK(context); diff --git a/chrome/browser/chromeos/file_manager/filesystem_api_util.h b/chrome/browser/chromeos/file_manager/filesystem_api_util.h index bd8424f..4ca549b 100644 --- a/chrome/browser/chromeos/file_manager/filesystem_api_util.h +++ b/chrome/browser/chromeos/file_manager/filesystem_api_util.h @@ -20,9 +20,9 @@ namespace base { class FilePath; } // namespace base -namespace fileapi { +namespace storage { class FileSystemURL; -} // namespace fileapi +} // namespace storage namespace file_manager { namespace util { diff --git a/chrome/browser/chromeos/file_manager/open_util.cc b/chrome/browser/chromeos/file_manager/open_util.cc index cd042e0..dbe75cc 100644 --- a/chrome/browser/chromeos/file_manager/open_util.cc +++ b/chrome/browser/chromeos/file_manager/open_util.cc @@ -29,7 +29,7 @@ #include "webkit/browser/fileapi/file_system_url.h" using content::BrowserThread; -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace file_manager { namespace util { @@ -54,7 +54,7 @@ void ShowWarningMessageBox(Profile* profile, void ExecuteFileTaskForUrl(Profile* profile, const file_tasks::TaskDescriptor& task, const GURL& url) { - fileapi::FileSystemContext* file_system_context = + storage::FileSystemContext* file_system_context = GetFileSystemContextForExtensionId(profile, kFileManagerAppId); file_tasks::ExecuteFileTask( diff --git a/chrome/browser/chromeos/file_manager/snapshot_manager.cc b/chrome/browser/chromeos/file_manager/snapshot_manager.cc index b5a33e8..1564c7c 100644 --- a/chrome/browser/chromeos/file_manager/snapshot_manager.cc +++ b/chrome/browser/chromeos/file_manager/snapshot_manager.cc @@ -56,8 +56,8 @@ void ComputeSpaceNeedToBeFreedAfterGetMetadata( // Part of ComputeSpaceNeedToBeFreed. void GetMetadataOnIOThread(const base::FilePath& path, - scoped_refptr<fileapi::FileSystemContext> context, - const fileapi::FileSystemURL& url, + scoped_refptr<storage::FileSystemContext> context, + const storage::FileSystemURL& url, const GetNecessaryFreeSpaceCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); context->operation_runner()->GetMetadata( @@ -70,8 +70,8 @@ void GetMetadataOnIOThread(const base::FilePath& path, // Returns 0 if no additional space is required, or -1 in the case of an error. void ComputeSpaceNeedToBeFreed( Profile* profile, - scoped_refptr<fileapi::FileSystemContext> context, - const fileapi::FileSystemURL& url, + scoped_refptr<storage::FileSystemContext> context, + const storage::FileSystemURL& url, const GetNecessaryFreeSpaceCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::BrowserThread::PostTask( @@ -83,9 +83,9 @@ void ComputeSpaceNeedToBeFreed( // Part of CreateManagedSnapshot. Runs CreateSnapshotFile method of fileapi. void CreateSnapshotFileOnIOThread( - scoped_refptr<fileapi::FileSystemContext> context, - const fileapi::FileSystemURL& url, - const fileapi::FileSystemOperation::SnapshotFileCallback& callback) { + scoped_refptr<storage::FileSystemContext> context, + const storage::FileSystemURL& url, + const storage::FileSystemOperation::SnapshotFileCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); context->operation_runner()->CreateSnapshotFile(url, callback); } @@ -101,8 +101,9 @@ void FreeReferenceOnIOThread( } // namespace SnapshotManager::FileReferenceWithSizeInfo::FileReferenceWithSizeInfo( - scoped_refptr<webkit_blob::ShareableFileReference> ref, - int64 size) : file_ref(ref), file_size(size) { + scoped_refptr<storage::ShareableFileReference> ref, + int64 size) + : file_ref(ref), file_size(size) { } SnapshotManager::FileReferenceWithSizeInfo::~FileReferenceWithSizeInfo() { @@ -125,7 +126,7 @@ SnapshotManager::~SnapshotManager() { void SnapshotManager::CreateManagedSnapshot( const base::FilePath& absolute_file_path, const LocalPathCallback& callback) { - scoped_refptr<fileapi::FileSystemContext> context( + scoped_refptr<storage::FileSystemContext> context( util::GetFileSystemContextForExtensionId(profile_, kFileManagerAppId)); DCHECK(context); @@ -135,7 +136,7 @@ void SnapshotManager::CreateManagedSnapshot( callback.Run(base::FilePath()); return; } - fileapi::FileSystemURL filesystem_url = context->CrackURL(url); + storage::FileSystemURL filesystem_url = context->CrackURL(url); ComputeSpaceNeedToBeFreed(profile_, context, filesystem_url, base::Bind(&SnapshotManager::CreateManagedSnapshotAfterSpaceComputed, @@ -145,10 +146,10 @@ void SnapshotManager::CreateManagedSnapshot( } void SnapshotManager::CreateManagedSnapshotAfterSpaceComputed( - const fileapi::FileSystemURL& filesystem_url, + const storage::FileSystemURL& filesystem_url, const LocalPathCallback& callback, int64 needed_space) { - scoped_refptr<fileapi::FileSystemContext> context( + scoped_refptr<storage::FileSystemContext> context( util::GetFileSystemContextForExtensionId(profile_, kFileManagerAppId)); DCHECK(context); @@ -196,7 +197,7 @@ void SnapshotManager::OnCreateSnapshotFile( base::File::Error result, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + const scoped_refptr<storage::ShareableFileReference>& file_ref) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (result != base::File::FILE_OK) { diff --git a/chrome/browser/chromeos/file_manager/snapshot_manager.h b/chrome/browser/chromeos/file_manager/snapshot_manager.h index 157a600..bf6486e 100644 --- a/chrome/browser/chromeos/file_manager/snapshot_manager.h +++ b/chrome/browser/chromeos/file_manager/snapshot_manager.h @@ -18,13 +18,13 @@ namespace base { class FilePath; } // namespace base -namespace fileapi { +namespace storage { class FileSystemURL; -} // namespace fileapi +} // namespace storage -namespace webkit_blob { +namespace storage { class ShareableFileReference; -} // namespace webkit_blob +} // namespace storage namespace file_manager { @@ -49,17 +49,17 @@ class SnapshotManager { // computing the necessity of clean up. struct FileReferenceWithSizeInfo { FileReferenceWithSizeInfo( - scoped_refptr<webkit_blob::ShareableFileReference> ref, + scoped_refptr<storage::ShareableFileReference> ref, int64 size); ~FileReferenceWithSizeInfo(); - scoped_refptr<webkit_blob::ShareableFileReference> file_ref; + scoped_refptr<storage::ShareableFileReference> file_ref; int64 file_size; }; private: // Part of CreateManagedSnapshot. void CreateManagedSnapshotAfterSpaceComputed( - const fileapi::FileSystemURL& filesystem_url, + const storage::FileSystemURL& filesystem_url, const LocalPathCallback& callback, int64 needed_space); @@ -69,7 +69,7 @@ class SnapshotManager { base::File::Error result, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); + const scoped_refptr<storage::ShareableFileReference>& file_ref); Profile* profile_; std::deque<FileReferenceWithSizeInfo> file_refs_; diff --git a/chrome/browser/chromeos/file_manager/volume_manager.cc b/chrome/browser/chromeos/file_manager/volume_manager.cc index 63473d5..c60ba71 100644 --- a/chrome/browser/chromeos/file_manager/volume_manager.cc +++ b/chrome/browser/chromeos/file_manager/volume_manager.cc @@ -53,15 +53,16 @@ bool RegisterDownloadsMountPoint(Profile* profile, const base::FilePath& path) { // For this reason, we need to register to the global GetSystemInstance(). const std::string mount_point_name = file_manager::util::GetDownloadsMountPointName(profile); - fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); // In some tests we want to override existing Downloads mount point, so we // first revoke the existing mount point (if any). mount_points->RevokeFileSystem(mount_point_name); - return mount_points->RegisterFileSystem( - mount_point_name, fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), path); + return mount_points->RegisterFileSystem(mount_point_name, + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), + path); } // Finds the path register as the "Downloads" folder to FileSystem API backend. @@ -69,8 +70,8 @@ bool RegisterDownloadsMountPoint(Profile* profile, const base::FilePath& path) { bool FindDownloadsMountPointPath(Profile* profile, base::FilePath* path) { const std::string mount_point_name = util::GetDownloadsMountPointName(profile); - fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); return mount_points->GetRegisteredPath(mount_point_name, path); } @@ -696,9 +697,11 @@ void VolumeManager::OnRemovableStorageAttached( label = base_name + base::StringPrintf(" (%d)", i); bool result = - fileapi::ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( - fsid, fileapi::kFileSystemTypeDeviceMediaAsFileStorage, - fileapi::FileSystemMountOption(), path); + storage::ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( + fsid, + storage::kFileSystemTypeDeviceMediaAsFileStorage, + storage::FileSystemMountOption(), + path); DCHECK(result); content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, base::Bind( @@ -730,8 +733,7 @@ void VolumeManager::OnRemovableStorageDetached( DoUnmountEvent(chromeos::MOUNT_ERROR_NONE, VolumeInfo(it->second)); const std::string fsid = GetMountPointNameForMediaStorage(info); - fileapi::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( - fsid); + storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(fsid); content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, base::Bind( &MTPDeviceMapService::RevokeMTPFileSystem, diff --git a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc index d43bbac..70f1aa3 100644 --- a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc +++ b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc @@ -75,7 +75,7 @@ bool FakeProvidedFileSystem::GetEntry(const base::FilePath& entry_path, ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::RequestUnmount( - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); } @@ -96,18 +96,18 @@ ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::GetMetadata( ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::ReadDirectory( const base::FilePath& directory_path, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) { - fileapi::AsyncFileUtil::EntryList entry_list; + const storage::AsyncFileUtil::ReadDirectoryCallback& callback) { + storage::AsyncFileUtil::EntryList entry_list; for (Entries::const_iterator it = entries_.begin(); it != entries_.end(); ++it) { const base::FilePath file_path = it->first; if (file_path == directory_path || directory_path.IsParent(file_path)) { const EntryMetadata& metadata = it->second.metadata; - entry_list.push_back(fileapi::DirectoryEntry( + entry_list.push_back(storage::DirectoryEntry( metadata.name, - metadata.is_directory ? fileapi::DirectoryEntry::DIRECTORY - : fileapi::DirectoryEntry::FILE, + metadata.is_directory ? storage::DirectoryEntry::DIRECTORY + : storage::DirectoryEntry::FILE, metadata.size, metadata.modification_time)); } @@ -136,7 +136,7 @@ ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::OpenFile( ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::CloseFile( int file_handle, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const OpenedFilesMap::iterator opened_file_it = opened_files_.find(file_handle); @@ -215,7 +215,7 @@ FakeProvidedFileSystem::CreateDirectory( const base::FilePath& directory_path, bool exclusive, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { // TODO(mtomasz): Implement it once needed. return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); } @@ -223,14 +223,14 @@ FakeProvidedFileSystem::CreateDirectory( ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::DeleteEntry( const base::FilePath& entry_path, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { // TODO(mtomasz): Implement it once needed. return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); } ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::CreateFile( const base::FilePath& file_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const base::File::Error result = file_path.AsUTF8Unsafe() != kFakeFilePath ? base::File::FILE_ERROR_EXISTS : base::File::FILE_OK; @@ -241,7 +241,7 @@ ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::CreateFile( ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::CopyEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { // TODO(mtomasz): Implement it once needed. return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); } @@ -249,7 +249,7 @@ ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::CopyEntry( ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::MoveEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { // TODO(mtomasz): Implement it once needed. return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); } @@ -257,7 +257,7 @@ ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::MoveEntry( ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::Truncate( const base::FilePath& file_path, int64 length, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { // TODO(mtomasz): Implement it once needed. return PostAbortableTask(base::Bind(callback, base::File::FILE_OK)); } @@ -267,7 +267,7 @@ ProvidedFileSystemInterface::AbortCallback FakeProvidedFileSystem::WriteFile( net::IOBuffer* buffer, int64 offset, int length, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const OpenedFilesMap::iterator opened_file_it = opened_files_.find(file_handle); @@ -331,14 +331,14 @@ FakeProvidedFileSystem::PostAbortableTask(const base::Closure& callback) { void FakeProvidedFileSystem::Abort( int task_id, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { tracker_.TryCancel(task_id); callback.Run(base::File::FILE_OK); } void FakeProvidedFileSystem::AbortMany( const std::vector<int>& task_ids, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { for (size_t i = 0; i < task_ids.size(); ++i) { tracker_.TryCancel(task_ids[i]); } diff --git a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h index 5ce3547..cf2a02a 100644 --- a/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h +++ b/chrome/browser/chromeos/file_system_provider/fake_provided_file_system.h @@ -71,20 +71,20 @@ class FakeProvidedFileSystem : public ProvidedFileSystemInterface { // ProvidedFileSystemInterface overrides. virtual AbortCallback RequestUnmount( - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback GetMetadata( const base::FilePath& entry_path, const ProvidedFileSystemInterface::GetMetadataCallback& callback) OVERRIDE; virtual AbortCallback ReadDirectory( const base::FilePath& directory_path, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; virtual AbortCallback OpenFile(const base::FilePath& file_path, OpenFileMode mode, const OpenFileCallback& callback) OVERRIDE; virtual AbortCallback CloseFile( int file_handle, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback ReadFile( int file_handle, net::IOBuffer* buffer, @@ -95,32 +95,32 @@ class FakeProvidedFileSystem : public ProvidedFileSystemInterface { const base::FilePath& directory_path, bool exclusive, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback DeleteEntry( const base::FilePath& entry_path, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback CreateFile( const base::FilePath& file_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback CopyEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback MoveEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback Truncate( const base::FilePath& file_path, int64 length, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback WriteFile( int file_handle, net::IOBuffer* buffer, int64 offset, int length, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; virtual RequestManager* GetRequestManager() OVERRIDE; virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; @@ -142,13 +142,13 @@ class FakeProvidedFileSystem : public ProvidedFileSystemInterface { // Aborts a request. |task_id| refers to a posted callback returning a // response for the operation, which will be cancelled, hence not called. void Abort(int task_id, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); // Aborts a request. |task_ids| refers to a vector of posted callbacks // returning a response for the operation, which will be cancelled, hence not // called. void AbortMany(const std::vector<int>& task_ids, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); ProvidedFileSystemInfo file_system_info_; Entries entries_; diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.cc b/chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.cc index 31c7250..5cd5e30 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.cc +++ b/chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.cc @@ -31,37 +31,35 @@ BackendDelegate::BackendDelegate() BackendDelegate::~BackendDelegate() {} -fileapi::AsyncFileUtil* BackendDelegate::GetAsyncFileUtil( - fileapi::FileSystemType type) { +storage::AsyncFileUtil* BackendDelegate::GetAsyncFileUtil( + storage::FileSystemType type) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_EQ(fileapi::kFileSystemTypeProvided, type); + DCHECK_EQ(storage::kFileSystemTypeProvided, type); return async_file_util_.get(); } -scoped_ptr<webkit_blob::FileStreamReader> -BackendDelegate::CreateFileStreamReader( - const fileapi::FileSystemURL& url, +scoped_ptr<storage::FileStreamReader> BackendDelegate::CreateFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) { + storage::FileSystemContext* context) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type()); + DCHECK_EQ(storage::kFileSystemTypeProvided, url.type()); - return scoped_ptr<webkit_blob::FileStreamReader>( - new BufferingFileStreamReader( - scoped_ptr<webkit_blob::FileStreamReader>(new FileStreamReader( - context, url, offset, expected_modification_time)), - kReaderBufferSize)); + return scoped_ptr<storage::FileStreamReader>(new BufferingFileStreamReader( + scoped_ptr<storage::FileStreamReader>(new FileStreamReader( + context, url, offset, expected_modification_time)), + kReaderBufferSize)); } -scoped_ptr<fileapi::FileStreamWriter> BackendDelegate::CreateFileStreamWriter( - const fileapi::FileSystemURL& url, +scoped_ptr<storage::FileStreamWriter> BackendDelegate::CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) { + storage::FileSystemContext* context) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK_EQ(fileapi::kFileSystemTypeProvided, url.type()); + DCHECK_EQ(storage::kFileSystemTypeProvided, url.type()); - return scoped_ptr<fileapi::FileStreamWriter>( + return scoped_ptr<storage::FileStreamWriter>( new FileStreamWriter(url, offset)); } diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.h b/chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.h index c4794486..2362eaa 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.h +++ b/chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate.h @@ -9,9 +9,9 @@ #include "base/memory/scoped_ptr.h" #include "chrome/browser/chromeos/fileapi/file_system_backend_delegate.h" -namespace fileapi { +namespace storage { class AsyncFileUtil; -} // namespace fileapi +} // namespace storage namespace chromeos { namespace file_system_provider { @@ -24,20 +24,20 @@ class BackendDelegate : public chromeos::FileSystemBackendDelegate { virtual ~BackendDelegate(); // FileSystemBackend::Delegate overrides. - virtual fileapi::AsyncFileUtil* GetAsyncFileUtil(fileapi::FileSystemType type) - OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( - const fileapi::FileSystemURL& url, + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE; + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) OVERRIDE; - virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + storage::FileSystemContext* context) OVERRIDE; + virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) OVERRIDE; + storage::FileSystemContext* context) OVERRIDE; private: - scoped_ptr<fileapi::AsyncFileUtil> async_file_util_; + scoped_ptr<storage::AsyncFileUtil> async_file_util_; DISALLOW_COPY_AND_ASSIGN(BackendDelegate); }; diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader.cc b/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader.cc index edd8545..831d65f 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader.cc +++ b/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader.cc @@ -13,7 +13,7 @@ namespace chromeos { namespace file_system_provider { BufferingFileStreamReader::BufferingFileStreamReader( - scoped_ptr<webkit_blob::FileStreamReader> file_stream_reader, + scoped_ptr<storage::FileStreamReader> file_stream_reader, int buffer_size) : file_stream_reader_(file_stream_reader.Pass()), buffer_size_(buffer_size), diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader.h b/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader.h index 5a7ac2f..e0e4ecc 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader.h +++ b/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader.h @@ -25,15 +25,15 @@ namespace file_system_provider { // The underlying inner file stream reader *must not* return any values // synchronously. Instead, results must be returned by a callback, including // errors. -class BufferingFileStreamReader : public webkit_blob::FileStreamReader { +class BufferingFileStreamReader : public storage::FileStreamReader { public: BufferingFileStreamReader( - scoped_ptr<webkit_blob::FileStreamReader> file_stream_reader, + scoped_ptr<storage::FileStreamReader> file_stream_reader, int buffer_size); virtual ~BufferingFileStreamReader(); - // webkit_blob::FileStreamReader overrides. + // storage::FileStreamReader overrides. virtual int Read(net::IOBuffer* buf, int buf_len, const net::CompletionCallback& callback) OVERRIDE; @@ -56,7 +56,7 @@ class BufferingFileStreamReader : public webkit_blob::FileStreamReader { const net::CompletionCallback& callback, int result); - scoped_ptr<webkit_blob::FileStreamReader> file_stream_reader_; + scoped_ptr<storage::FileStreamReader> file_stream_reader_; int buffer_size_; scoped_refptr<net::IOBuffer> preloading_buffer_; int preloading_buffer_offset_; diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader_unittest.cc b/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader_unittest.cc index 001f3f5..d69a0c7 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader_unittest.cc +++ b/chrome/browser/chromeos/file_system_provider/fileapi/buffering_file_stream_reader_unittest.cc @@ -35,13 +35,13 @@ void LogValue(std::vector<T>* log, T value) { } // Fake internal file stream reader. -class FakeFileStreamReader : public webkit_blob::FileStreamReader { +class FakeFileStreamReader : public storage::FileStreamReader { public: FakeFileStreamReader(std::vector<int>* log, net::Error return_error) : log_(log), return_error_(return_error) {} virtual ~FakeFileStreamReader() {} - // webkit_blob::FileStreamReader overrides. + // storage::FileStreamReader overrides. virtual int Read(net::IOBuffer* buf, int buf_len, const net::CompletionCallback& callback) OVERRIDE { @@ -89,7 +89,7 @@ class FileSystemProviderBufferingFileStreamReaderTest : public testing::Test { TEST_F(FileSystemProviderBufferingFileStreamReaderTest, Read) { std::vector<int> inner_read_log; BufferingFileStreamReader reader( - scoped_ptr<webkit_blob::FileStreamReader>( + scoped_ptr<storage::FileStreamReader>( new FakeFileStreamReader(&inner_read_log, net::OK)), kBufferSize); @@ -162,7 +162,7 @@ TEST_F(FileSystemProviderBufferingFileStreamReaderTest, Read) { TEST_F(FileSystemProviderBufferingFileStreamReaderTest, Read_Directly) { std::vector<int> inner_read_log; BufferingFileStreamReader reader( - scoped_ptr<webkit_blob::FileStreamReader>( + scoped_ptr<storage::FileStreamReader>( new FakeFileStreamReader(&inner_read_log, net::OK)), kBufferSize); @@ -222,7 +222,7 @@ TEST_F(FileSystemProviderBufferingFileStreamReaderTest, Read_MoreThanBufferSize) { std::vector<int> inner_read_log; BufferingFileStreamReader reader( - scoped_ptr<webkit_blob::FileStreamReader>( + scoped_ptr<storage::FileStreamReader>( new FakeFileStreamReader(&inner_read_log, net::OK)), kBufferSize); // First read couple of bytes, so the internal buffer is filled out. @@ -261,7 +261,7 @@ TEST_F(FileSystemProviderBufferingFileStreamReaderTest, TEST_F(FileSystemProviderBufferingFileStreamReaderTest, Read_WithError) { std::vector<int> inner_read_log; BufferingFileStreamReader reader( - scoped_ptr<webkit_blob::FileStreamReader>( + scoped_ptr<storage::FileStreamReader>( new FakeFileStreamReader(&inner_read_log, net::ERR_ACCESS_DENIED)), kBufferSize); @@ -279,7 +279,7 @@ TEST_F(FileSystemProviderBufferingFileStreamReaderTest, Read_WithError) { } TEST_F(FileSystemProviderBufferingFileStreamReaderTest, GetLength) { - BufferingFileStreamReader reader(scoped_ptr<webkit_blob::FileStreamReader>( + BufferingFileStreamReader reader(scoped_ptr<storage::FileStreamReader>( new FakeFileStreamReader(NULL, net::OK)), kBufferSize); diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc index b15314a..70bd4c0 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc +++ b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.cc @@ -33,7 +33,7 @@ void Int64ToIntCompletionCallback(net::CompletionCallback callback, // Opens a file for reading and calls the completion callback. Must be called // on UI thread. void OpenFileOnUIThread( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileStreamReader::OpenFileCompletedCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -141,8 +141,8 @@ void OnGetMetadataReceivedOnUIThread( } // namespace -FileStreamReader::FileStreamReader(fileapi::FileSystemContext* context, - const fileapi::FileSystemURL& url, +FileStreamReader::FileStreamReader(storage::FileSystemContext* context, + const storage::FileSystemURL& url, int64 initial_offset, const base::Time& expected_modification_time) : url_(url), diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h index 133317a..8b4375a 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h +++ b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader.h @@ -20,7 +20,7 @@ class ProvidedFileSystemInterface; // Implements a streamed file reader. It is lazily initialized by the first call // to Read(). -class FileStreamReader : public webkit_blob::FileStreamReader { +class FileStreamReader : public storage::FileStreamReader { public: typedef base::Callback< void(base::WeakPtr<ProvidedFileSystemInterface> file_system, @@ -28,14 +28,14 @@ class FileStreamReader : public webkit_blob::FileStreamReader { int file_handle, base::File::Error result)> OpenFileCompletedCallback; - FileStreamReader(fileapi::FileSystemContext* context, - const fileapi::FileSystemURL& url, + FileStreamReader(storage::FileSystemContext* context, + const storage::FileSystemURL& url, int64 initial_offset, const base::Time& expected_modification_time); virtual ~FileStreamReader(); - // webkit_blob::FileStreamReader overrides. + // storage::FileStreamReader overrides. virtual int Read(net::IOBuffer* buf, int buf_len, const net::CompletionCallback& callback) OVERRIDE; @@ -94,7 +94,7 @@ class FileStreamReader : public webkit_blob::FileStreamReader { // Same as GetLength(), but called after initializing is completed. void GetLengthAfterInitialized(const net::Int64CompletionCallback& callback); - fileapi::FileSystemURL url_; + storage::FileSystemURL url_; int64 current_offset_; int64 current_length_; base::Time expected_modification_time_; diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc index 0e3bf22..70f16fa 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc +++ b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_reader_unittest.cc @@ -59,14 +59,14 @@ class EventLogger { }; // Creates a cracked FileSystemURL for tests. -fileapi::FileSystemURL CreateFileSystemURL(const std::string& mount_point_name, +storage::FileSystemURL CreateFileSystemURL(const std::string& mount_point_name, const base::FilePath& file_path) { const std::string origin = std::string("chrome-extension://") + kExtensionId; - const fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + const storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); return mount_points->CreateCrackedFileSystemURL( GURL(origin), - fileapi::kFileSystemTypeExternal, + storage::kFileSystemTypeExternal, base::FilePath::FromUTF8Unsafe(mount_point_name).Append(file_path)); } @@ -132,8 +132,8 @@ class FileSystemProviderFileStreamReader : public testing::Test { scoped_ptr<TestingProfileManager> profile_manager_; TestingProfile* profile_; // Owned by TestingProfileManager. FakeEntry fake_file_; - fileapi::FileSystemURL file_url_; - fileapi::FileSystemURL wrong_file_url_; + storage::FileSystemURL file_url_; + storage::FileSystemURL wrong_file_url_; }; TEST_F(FileSystemProviderFileStreamReader, Read_AllAtOnce) { diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc index 51f1dac..3b22b83 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc +++ b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc @@ -33,8 +33,8 @@ class FileStreamWriter::OperationRunner // Opens a file for writing and calls the completion callback. Must be called // on UI thread. void OpenFileOnUIThread( - const fileapi::FileSystemURL& url, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::FileSystemURL& url, + const storage::AsyncFileUtil::StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); util::FileSystemURLParser parser(url); @@ -72,7 +72,7 @@ class FileStreamWriter::OperationRunner scoped_refptr<net::IOBuffer> buffer, int64 offset, int length, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); // If the file system got unmounted, then abort the writing operation. @@ -94,7 +94,7 @@ class FileStreamWriter::OperationRunner } // Aborts the most recent operation (if exists), and calls the callback. - void AbortOnUIThread(const fileapi::AsyncFileUtil::StatusCallback& callback) { + void AbortOnUIThread(const storage::AsyncFileUtil::StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (abort_callback_.is_null()) { @@ -121,7 +121,7 @@ class FileStreamWriter::OperationRunner // Remembers a file handle for further operations and forwards the result to // the IO thread. void OnOpenFileCompletedOnUIThread( - const fileapi::AsyncFileUtil::StatusCallback& callback, + const storage::AsyncFileUtil::StatusCallback& callback, int file_handle, base::File::Error result) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -133,7 +133,7 @@ class FileStreamWriter::OperationRunner // Forwards a response of writing to a file to the IO thread. void OnWriteFileCompletedOnUIThread( - const fileapi::AsyncFileUtil::StatusCallback& callback, + const storage::AsyncFileUtil::StatusCallback& callback, base::File::Error result) { DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( @@ -142,7 +142,7 @@ class FileStreamWriter::OperationRunner // Forwards a response of aborting an operation to the IO thread. void OnAbortCompletedOnUIThread( - const fileapi::AsyncFileUtil::StatusCallback& callback, + const storage::AsyncFileUtil::StatusCallback& callback, base::File::Error result) { DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserThread::PostTask( @@ -156,7 +156,7 @@ class FileStreamWriter::OperationRunner DISALLOW_COPY_AND_ASSIGN(OperationRunner); }; -FileStreamWriter::FileStreamWriter(const fileapi::FileSystemURL& url, +FileStreamWriter::FileStreamWriter(const storage::FileSystemURL& url, int64 initial_offset) : url_(url), current_offset_(initial_offset), diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.h b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.h index e21e12a..bcff670 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.h +++ b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.h @@ -20,13 +20,13 @@ class ProvidedFileSystemInterface; // Implements a streamed file writer. It is lazily initialized by the first call // to Write(). -class FileStreamWriter : public fileapi::FileStreamWriter { +class FileStreamWriter : public storage::FileStreamWriter { public: - FileStreamWriter(const fileapi::FileSystemURL& url, int64 initial_offset); + FileStreamWriter(const storage::FileSystemURL& url, int64 initial_offset); virtual ~FileStreamWriter(); - // fileapi::FileStreamWriter overrides. + // storage::FileStreamWriter overrides. virtual int Write(net::IOBuffer* buf, int buf_len, const net::CompletionCallback& callback) OVERRIDE; @@ -72,7 +72,7 @@ class FileStreamWriter : public fileapi::FileStreamWriter { int buffer_length, const net::CompletionCallback& callback); - fileapi::FileSystemURL url_; + storage::FileSystemURL url_; int64 current_offset_; scoped_refptr<OperationRunner> runner_; State state_; diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer_unittest.cc b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer_unittest.cc index 48b3adb..c1bf2aa 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer_unittest.cc +++ b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer_unittest.cc @@ -43,14 +43,14 @@ void LogValue(std::vector<int>* log, int value) { } // Creates a cracked FileSystemURL for tests. -fileapi::FileSystemURL CreateFileSystemURL(const std::string& mount_point_name, +storage::FileSystemURL CreateFileSystemURL(const std::string& mount_point_name, const base::FilePath& file_path) { const std::string origin = std::string("chrome-extension://") + kExtensionId; - const fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + const storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); return mount_points->CreateCrackedFileSystemURL( GURL(origin), - fileapi::kFileSystemTypeExternal, + storage::kFileSystemTypeExternal, base::FilePath::FromUTF8Unsafe(mount_point_name).Append(file_path)); } @@ -112,8 +112,8 @@ class FileSystemProviderFileStreamWriter : public testing::Test { scoped_ptr<TestingProfileManager> profile_manager_; TestingProfile* profile_; // Owned by TestingProfileManager. FakeProvidedFileSystem* provided_file_system_; // Owned by Service. - fileapi::FileSystemURL file_url_; - fileapi::FileSystemURL wrong_file_url_; + storage::FileSystemURL file_url_; + storage::FileSystemURL wrong_file_url_; }; TEST_F(FileSystemProviderFileStreamWriter, Write) { diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.cc b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.cc index b1a5f56..0c886c9 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.cc +++ b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.cc @@ -24,8 +24,8 @@ namespace { // Executes GetFileInfo on the UI thread. void GetFileInfoOnUIThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ProvidedFileSystemInterface::GetMetadataCallback& callback) { util::FileSystemURLParser parser(url); if (!parser.Parse()) { @@ -38,7 +38,7 @@ void GetFileInfoOnUIThread( // Routes the response of GetFileInfo back to the IO thread with a type // conversion. -void OnGetFileInfo(const fileapi::AsyncFileUtil::GetFileInfoCallback& callback, +void OnGetFileInfo(const storage::AsyncFileUtil::GetFileInfoCallback& callback, const EntryMetadata& metadata, base::File::Error result) { base::File::Info file_info; @@ -58,13 +58,13 @@ void OnGetFileInfo(const fileapi::AsyncFileUtil::GetFileInfoCallback& callback, // Executes ReadDirectory on the UI thread. void ReadDirectoryOnUIThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) { + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + const storage::AsyncFileUtil::ReadDirectoryCallback& callback) { util::FileSystemURLParser parser(url); if (!parser.Parse()) { callback.Run(base::File::FILE_ERROR_INVALID_OPERATION, - fileapi::AsyncFileUtil::EntryList(), + storage::AsyncFileUtil::EntryList(), false /* has_more */); return; } @@ -74,9 +74,9 @@ void ReadDirectoryOnUIThread( // Routes the response of ReadDirectory back to the IO thread. void OnReadDirectory( - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback, + const storage::AsyncFileUtil::ReadDirectoryCallback& callback, base::File::Error result, - const fileapi::AsyncFileUtil::EntryList& entry_list, + const storage::AsyncFileUtil::EntryList& entry_list, bool has_more) { BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, @@ -85,11 +85,11 @@ void OnReadDirectory( // Executes CreateDirectory on the UI thread. void CreateDirectoryOnUIThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { util::FileSystemURLParser parser(url); if (!parser.Parse()) { callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); @@ -101,7 +101,7 @@ void CreateDirectoryOnUIThread( } // Routes the response of CreateDirectory back to the IO thread. -void OnCreateDirectory(const fileapi::AsyncFileUtil::StatusCallback& callback, +void OnCreateDirectory(const storage::AsyncFileUtil::StatusCallback& callback, base::File::Error result) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(callback, result)); @@ -109,10 +109,10 @@ void OnCreateDirectory(const fileapi::AsyncFileUtil::StatusCallback& callback, // Executes DeleteEntry on the UI thread. void DeleteEntryOnUIThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { util::FileSystemURLParser parser(url); if (!parser.Parse()) { callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); @@ -123,7 +123,7 @@ void DeleteEntryOnUIThread( } // Routes the response of DeleteEntry back to the IO thread. -void OnDeleteEntry(const fileapi::AsyncFileUtil::StatusCallback& callback, +void OnDeleteEntry(const storage::AsyncFileUtil::StatusCallback& callback, base::File::Error result) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(callback, result)); @@ -131,9 +131,9 @@ void OnDeleteEntry(const fileapi::AsyncFileUtil::StatusCallback& callback, // Executes CreateFile on the UI thread. void CreateFileOnUIThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + const storage::AsyncFileUtil::StatusCallback& callback) { util::FileSystemURLParser parser(url); if (!parser.Parse()) { callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); @@ -146,7 +146,7 @@ void CreateFileOnUIThread( // Routes the response of CreateFile to a callback of EnsureFileExists() on the // IO thread. void OnCreateFileForEnsureFileExists( - const fileapi::AsyncFileUtil::EnsureFileExistsCallback& callback, + const storage::AsyncFileUtil::EnsureFileExistsCallback& callback, base::File::Error result) { const bool created = result == base::File::FILE_OK; @@ -161,10 +161,10 @@ void OnCreateFileForEnsureFileExists( // Executes CopyEntry on the UI thread. void CopyEntryOnUIThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& source_url, - const fileapi::FileSystemURL& target_url, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& source_url, + const storage::FileSystemURL& target_url, + const storage::AsyncFileUtil::StatusCallback& callback) { util::FileSystemURLParser source_parser(source_url); util::FileSystemURLParser target_parser(target_url); @@ -180,7 +180,7 @@ void CopyEntryOnUIThread( // Routes the response of CopyEntry to a callback of CopyLocalFile() on the // IO thread. -void OnCopyEntry(const fileapi::AsyncFileUtil::StatusCallback& callback, +void OnCopyEntry(const storage::AsyncFileUtil::StatusCallback& callback, base::File::Error result) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(callback, result)); @@ -188,10 +188,10 @@ void OnCopyEntry(const fileapi::AsyncFileUtil::StatusCallback& callback, // Executes MoveEntry on the UI thread. void MoveEntryOnUIThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& source_url, - const fileapi::FileSystemURL& target_url, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& source_url, + const storage::FileSystemURL& target_url, + const storage::AsyncFileUtil::StatusCallback& callback) { util::FileSystemURLParser source_parser(source_url); util::FileSystemURLParser target_parser(target_url); @@ -207,7 +207,7 @@ void MoveEntryOnUIThread( // Routes the response of CopyEntry to a callback of MoveLocalFile() on the // IO thread. -void OnMoveEntry(const fileapi::AsyncFileUtil::StatusCallback& callback, +void OnMoveEntry(const storage::AsyncFileUtil::StatusCallback& callback, base::File::Error result) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(callback, result)); @@ -215,10 +215,10 @@ void OnMoveEntry(const fileapi::AsyncFileUtil::StatusCallback& callback, // Executes Truncate on the UI thread. void TruncateOnUIThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int64 length, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { util::FileSystemURLParser parser(url); if (!parser.Parse()) { callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); @@ -229,7 +229,7 @@ void TruncateOnUIThread( } // Routes the response of Truncate back to the IO thread. -void OnTruncate(const fileapi::AsyncFileUtil::StatusCallback& callback, +void OnTruncate(const storage::AsyncFileUtil::StatusCallback& callback, base::File::Error result) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(callback, result)); @@ -242,8 +242,8 @@ ProviderAsyncFileUtil::ProviderAsyncFileUtil() {} ProviderAsyncFileUtil::~ProviderAsyncFileUtil() {} void ProviderAsyncFileUtil::CreateOrOpen( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -262,8 +262,8 @@ void ProviderAsyncFileUtil::CreateOrOpen( } void ProviderAsyncFileUtil::EnsureFileExists( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const EnsureFileExistsCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserThread::PostTask( @@ -276,8 +276,8 @@ void ProviderAsyncFileUtil::EnsureFileExists( } void ProviderAsyncFileUtil::CreateDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) { @@ -293,8 +293,8 @@ void ProviderAsyncFileUtil::CreateDirectory( } void ProviderAsyncFileUtil::GetFileInfo( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserThread::PostTask(BrowserThread::UI, @@ -306,8 +306,8 @@ void ProviderAsyncFileUtil::GetFileInfo( } void ProviderAsyncFileUtil::ReadDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserThread::PostTask(BrowserThread::UI, @@ -319,8 +319,8 @@ void ProviderAsyncFileUtil::ReadDirectory( } void ProviderAsyncFileUtil::Touch( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time, const StatusCallback& callback) { @@ -329,8 +329,8 @@ void ProviderAsyncFileUtil::Touch( } void ProviderAsyncFileUtil::Truncate( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int64 length, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -344,9 +344,9 @@ void ProviderAsyncFileUtil::Truncate( } void ProviderAsyncFileUtil::CopyFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) { @@ -363,9 +363,9 @@ void ProviderAsyncFileUtil::CopyFileLocal( } void ProviderAsyncFileUtil::MoveFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -381,17 +381,17 @@ void ProviderAsyncFileUtil::MoveFileLocal( } void ProviderAsyncFileUtil::CopyInForeignFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); callback.Run(base::File::FILE_ERROR_ACCESS_DENIED); } void ProviderAsyncFileUtil::DeleteFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserThread::PostTask(BrowserThread::UI, @@ -404,8 +404,8 @@ void ProviderAsyncFileUtil::DeleteFile( } void ProviderAsyncFileUtil::DeleteDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserThread::PostTask(BrowserThread::UI, @@ -418,8 +418,8 @@ void ProviderAsyncFileUtil::DeleteDirectory( } void ProviderAsyncFileUtil::DeleteRecursively( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); BrowserThread::PostTask(BrowserThread::UI, @@ -432,15 +432,15 @@ void ProviderAsyncFileUtil::DeleteRecursively( } void ProviderAsyncFileUtil::CreateSnapshotFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); NOTIMPLEMENTED(); callback.Run(base::File::FILE_ERROR_INVALID_OPERATION, base::File::Info(), base::FilePath(), - scoped_refptr<webkit_blob::ShareableFileReference>()); + scoped_refptr<storage::ShareableFileReference>()); } } // namespace internal diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.h b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.h index a60df56..90c875f 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.h +++ b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util.h @@ -16,7 +16,7 @@ class FileSystemInterface; namespace internal { -// The implementation of fileapi::AsyncFileUtil for provided file systems. It is +// The implementation of storage::AsyncFileUtil for provided file systems. It is // created one per Chrome process. It is responsible for routing calls to the // correct profile, and then to the correct profided file system. // @@ -26,77 +26,77 @@ namespace internal { // See: https://code.google.com/p/gyp/issues/detail?id=384 // // All of the methods should be called on the IO thread. -class ProviderAsyncFileUtil : public fileapi::AsyncFileUtil { +class ProviderAsyncFileUtil : public storage::AsyncFileUtil { public: ProviderAsyncFileUtil(); virtual ~ProviderAsyncFileUtil(); - // fileapi::AsyncFileUtil overrides. + // storage::AsyncFileUtil overrides. virtual void CreateOrOpen( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) OVERRIDE; virtual void EnsureFileExists( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const EnsureFileExistsCallback& callback) OVERRIDE; virtual void CreateDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) OVERRIDE; virtual void GetFileInfo( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) OVERRIDE; virtual void ReadDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; - virtual void Touch(scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time, const StatusCallback& callback) OVERRIDE; - virtual void Truncate(scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int64 length, const StatusCallback& callback) OVERRIDE; virtual void CopyFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) OVERRIDE; virtual void MoveFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) OVERRIDE; virtual void CopyInForeignFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) OVERRIDE; virtual void DeleteFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteRecursively( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void CreateSnapshotFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) OVERRIDE; private: diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util_unittest.cc b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util_unittest.cc index 48f19be..5a27683 100644 --- a/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util_unittest.cc +++ b/chrome/browser/chromeos/file_system_provider/fileapi/provider_async_file_util_unittest.cc @@ -66,7 +66,7 @@ class EventLogger { } void OnReadDirectory(base::File::Error error, - const fileapi::AsyncFileUtil::EntryList& file_list, + const storage::AsyncFileUtil::EntryList& file_list, bool has_more) { result_.reset(new base::File::Error(error)); } @@ -75,7 +75,7 @@ class EventLogger { base::File::Error error, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + const scoped_refptr<storage::ShareableFileReference>& file_ref) { result_.reset(new base::File::Error(error)); } @@ -89,14 +89,14 @@ class EventLogger { }; // Creates a cracked FileSystemURL for tests. -fileapi::FileSystemURL CreateFileSystemURL(const std::string& mount_point_name, +storage::FileSystemURL CreateFileSystemURL(const std::string& mount_point_name, const base::FilePath& file_path) { const std::string origin = std::string("chrome-extension://") + kExtensionId; - const fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + const storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); return mount_points->CreateCrackedFileSystemURL( GURL(origin), - fileapi::kFileSystemTypeExternal, + storage::kFileSystemTypeExternal, base::FilePath::FromUTF8Unsafe(mount_point_name).Append(file_path)); } @@ -164,20 +164,20 @@ class FileSystemProviderProviderAsyncFileUtilTest : public testing::Test { ServiceFactory::GetInstance()->SetTestingFactory(profile_, NULL); } - scoped_ptr<fileapi::FileSystemOperationContext> CreateOperationContext() { + scoped_ptr<storage::FileSystemOperationContext> CreateOperationContext() { return make_scoped_ptr( - new fileapi::FileSystemOperationContext(file_system_context_.get())); + new storage::FileSystemOperationContext(file_system_context_.get())); } content::TestBrowserThreadBundle thread_bundle_; base::ScopedTempDir data_dir_; scoped_ptr<TestingProfileManager> profile_manager_; TestingProfile* profile_; // Owned by TestingProfileManager. - scoped_ptr<fileapi::AsyncFileUtil> async_file_util_; - scoped_refptr<fileapi::FileSystemContext> file_system_context_; - fileapi::FileSystemURL file_url_; - fileapi::FileSystemURL directory_url_; - fileapi::FileSystemURL root_url_; + scoped_ptr<storage::AsyncFileUtil> async_file_util_; + scoped_refptr<storage::FileSystemContext> file_system_context_; + storage::FileSystemURL file_url_; + storage::FileSystemURL directory_url_; + storage::FileSystemURL root_url_; }; TEST_F(FileSystemProviderProviderAsyncFileUtilTest, CreateOrOpen_Create) { @@ -335,7 +335,7 @@ TEST_F(FileSystemProviderProviderAsyncFileUtilTest, CopyFileLocal) { CreateOperationContext(), file_url_, // src_url file_url_, // dst_url - fileapi::FileSystemOperation::OPTION_NONE, + storage::FileSystemOperation::OPTION_NONE, base::Bind(&EventLogger::OnCopyFileProgress, base::Unretained(&logger)), base::Bind(&EventLogger::OnStatus, base::Unretained(&logger))); base::RunLoop().RunUntilIdle(); @@ -351,7 +351,7 @@ TEST_F(FileSystemProviderProviderAsyncFileUtilTest, MoveFileLocal) { CreateOperationContext(), file_url_, // src_url file_url_, // dst_url - fileapi::FileSystemOperation::OPTION_NONE, + storage::FileSystemOperation::OPTION_NONE, base::Bind(&EventLogger::OnStatus, base::Unretained(&logger))); base::RunLoop().RunUntilIdle(); diff --git a/chrome/browser/chromeos/file_system_provider/mount_path_util.cc b/chrome/browser/chromeos/file_system_provider/mount_path_util.cc index 19283e4..4cd273a 100644 --- a/chrome/browser/chromeos/file_system_provider/mount_path_util.cc +++ b/chrome/browser/chromeos/file_system_provider/mount_path_util.cc @@ -77,7 +77,7 @@ bool IsFileSystemProviderLocalPath(const base::FilePath& local_path) { return true; } -FileSystemURLParser::FileSystemURLParser(const fileapi::FileSystemURL& url) +FileSystemURLParser::FileSystemURLParser(const storage::FileSystemURL& url) : url_(url), file_system_(NULL) { } @@ -87,7 +87,7 @@ FileSystemURLParser::~FileSystemURLParser() { bool FileSystemURLParser::Parse() { DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (url_.type() != fileapi::kFileSystemTypeProvided) + if (url_.type() != storage::kFileSystemTypeProvided) return false; // First, find the service handling the mount point of the URL. diff --git a/chrome/browser/chromeos/file_system_provider/mount_path_util.h b/chrome/browser/chromeos/file_system_provider/mount_path_util.h index 37fd896..fe97bbf 100644 --- a/chrome/browser/chromeos/file_system_provider/mount_path_util.h +++ b/chrome/browser/chromeos/file_system_provider/mount_path_util.h @@ -32,7 +32,7 @@ bool IsFileSystemProviderLocalPath(const base::FilePath& local_path); // to be used by the file system operations. class FileSystemURLParser { public: - explicit FileSystemURLParser(const fileapi::FileSystemURL& url); + explicit FileSystemURLParser(const storage::FileSystemURL& url); virtual ~FileSystemURLParser(); // Parses the |url| passed to the constructor. If parsing succeeds, then @@ -43,7 +43,7 @@ class FileSystemURLParser { const base::FilePath& file_path() const { return file_path_; } private: - fileapi::FileSystemURL url_; + storage::FileSystemURL url_; ProvidedFileSystemInterface* file_system_; base::FilePath file_path_; diff --git a/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc b/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc index 788eeab..7bf9456 100644 --- a/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc +++ b/chrome/browser/chromeos/file_system_provider/mount_path_util_unittest.cc @@ -37,21 +37,21 @@ const char kFileSystemId[] = "File/System/Id"; const char kDisplayName[] = "Camera Pictures"; // Creates a FileSystemURL for tests. -fileapi::FileSystemURL CreateFileSystemURL( +storage::FileSystemURL CreateFileSystemURL( Profile* profile, const ProvidedFileSystemInfo& file_system_info, const base::FilePath& file_path) { const std::string origin = std::string("chrome-extension://") + file_system_info.extension_id(); const base::FilePath mount_path = file_system_info.mount_path(); - const fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + const storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); DCHECK(mount_points); DCHECK(file_path.IsAbsolute()); base::FilePath relative_path(file_path.value().substr(1)); return mount_points->CreateCrackedFileSystemURL( GURL(origin), - fileapi::kFileSystemTypeExternal, + storage::kFileSystemTypeExternal, base::FilePath(mount_path.BaseName().Append(relative_path))); } @@ -137,7 +137,7 @@ TEST_F(FileSystemProviderMountPathUtilTest, Parser) { const base::FilePath kFilePath = base::FilePath::FromUTF8Unsafe("/hello/world.txt"); - const fileapi::FileSystemURL url = + const storage::FileSystemURL url = CreateFileSystemURL(profile_, file_system_info, kFilePath); EXPECT_TRUE(url.is_valid()); @@ -160,7 +160,7 @@ TEST_F(FileSystemProviderMountPathUtilTest, Parser_RootPath) { ->GetFileSystemInfo(); const base::FilePath kFilePath = base::FilePath::FromUTF8Unsafe("/"); - const fileapi::FileSystemURL url = + const storage::FileSystemURL url = CreateFileSystemURL(profile_, file_system_info, kFilePath); EXPECT_TRUE(url.is_valid()); @@ -182,7 +182,7 @@ TEST_F(FileSystemProviderMountPathUtilTest, Parser_WrongUrl) { GetMountPath(profile_, kExtensionId, kFileSystemId)); const base::FilePath kFilePath = base::FilePath::FromUTF8Unsafe("/hello"); - const fileapi::FileSystemURL url = + const storage::FileSystemURL url = CreateFileSystemURL(profile_, file_system_info, kFilePath); // It is impossible to create a cracked URL for a mount point which doesn't // exist, therefore is will always be invalid, and empty. @@ -203,16 +203,16 @@ TEST_F(FileSystemProviderMountPathUtilTest, Parser_IsolatedURL) { const base::FilePath kFilePath = base::FilePath::FromUTF8Unsafe("/hello/world.txt"); - const fileapi::FileSystemURL url = + const storage::FileSystemURL url = CreateFileSystemURL(profile_, file_system_info, kFilePath); EXPECT_TRUE(url.is_valid()); // Create an isolated URL for the original one. - fileapi::IsolatedContext* const isolated_context = - fileapi::IsolatedContext::GetInstance(); + storage::IsolatedContext* const isolated_context = + storage::IsolatedContext::GetInstance(); const std::string isolated_file_system_id = isolated_context->RegisterFileSystemForPath( - fileapi::kFileSystemTypeProvided, + storage::kFileSystemTypeProvided, url.filesystem_id(), url.path(), NULL); @@ -221,10 +221,10 @@ TEST_F(FileSystemProviderMountPathUtilTest, Parser_IsolatedURL) { isolated_context->CreateVirtualRootPath(isolated_file_system_id) .Append(kFilePath.BaseName().value()); - const fileapi::FileSystemURL isolated_url = + const storage::FileSystemURL isolated_url = isolated_context->CreateCrackedFileSystemURL( url.origin(), - fileapi::kFileSystemTypeIsolated, + storage::kFileSystemTypeIsolated, isolated_virtual_path); EXPECT_TRUE(isolated_url.is_valid()); diff --git a/chrome/browser/chromeos/file_system_provider/operations/abort.cc b/chrome/browser/chromeos/file_system_provider/operations/abort.cc index 8c488f9..19db302 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/abort.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/abort.cc @@ -16,7 +16,7 @@ namespace operations { Abort::Abort(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, int operation_request_id, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), operation_request_id_(operation_request_id), callback_(callback) { diff --git a/chrome/browser/chromeos/file_system_provider/operations/abort.h b/chrome/browser/chromeos/file_system_provider/operations/abort.h index 9f7b2b2..050c7b2 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/abort.h +++ b/chrome/browser/chromeos/file_system_provider/operations/abort.h @@ -31,7 +31,7 @@ class Abort : public Operation { Abort(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, int operation_request_id, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~Abort(); // Operation overrides. @@ -45,7 +45,7 @@ class Abort : public Operation { private: int operation_request_id_; - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(Abort); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/close_file.cc b/chrome/browser/chromeos/file_system_provider/operations/close_file.cc index ad97736..a81f8fb 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/close_file.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/close_file.cc @@ -16,7 +16,7 @@ namespace operations { CloseFile::CloseFile(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, int open_request_id, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), open_request_id_(open_request_id), callback_(callback) { diff --git a/chrome/browser/chromeos/file_system_provider/operations/close_file.h b/chrome/browser/chromeos/file_system_provider/operations/close_file.h index 83bafff..4645b18 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/close_file.h +++ b/chrome/browser/chromeos/file_system_provider/operations/close_file.h @@ -26,14 +26,14 @@ namespace file_system_provider { namespace operations { // Opens a file for either read or write, with optionally creating the file -// first. Note, that this is part of fileapi::CreateOrOpen file, but it does +// first. Note, that this is part of storage::CreateOrOpen file, but it does // not download the file locally. Created per request. class CloseFile : public Operation { public: CloseFile(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, int open_request_id, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~CloseFile(); // Operation overrides. @@ -47,7 +47,7 @@ class CloseFile : public Operation { private: int open_request_id_; - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(CloseFile); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc b/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc index a89cfc6..22c6d9b 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/copy_entry.cc @@ -17,7 +17,7 @@ CopyEntry::CopyEntry(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), source_path_(source_path), target_path_(target_path), diff --git a/chrome/browser/chromeos/file_system_provider/operations/copy_entry.h b/chrome/browser/chromeos/file_system_provider/operations/copy_entry.h index b25a640..da0aac6 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/copy_entry.h +++ b/chrome/browser/chromeos/file_system_provider/operations/copy_entry.h @@ -32,7 +32,7 @@ class CopyEntry : public Operation { const ProvidedFileSystemInfo& file_system_info, const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~CopyEntry(); // Operation overrides. @@ -47,7 +47,7 @@ class CopyEntry : public Operation { private: base::FilePath source_path_; base::FilePath target_path_; - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(CopyEntry); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/create_directory.cc b/chrome/browser/chromeos/file_system_provider/operations/create_directory.cc index 77984af..c315234 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/create_directory.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/create_directory.cc @@ -19,7 +19,7 @@ CreateDirectory::CreateDirectory( const base::FilePath& directory_path, bool exclusive, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), directory_path_(directory_path), exclusive_(exclusive), diff --git a/chrome/browser/chromeos/file_system_provider/operations/create_directory.h b/chrome/browser/chromeos/file_system_provider/operations/create_directory.h index 0de1205..42c7f46 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/create_directory.h +++ b/chrome/browser/chromeos/file_system_provider/operations/create_directory.h @@ -35,7 +35,7 @@ class CreateDirectory : public Operation { const base::FilePath& directory_path, bool exclusive, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~CreateDirectory(); // Operation overrides. @@ -52,7 +52,7 @@ class CreateDirectory : public Operation { ProvidedFileSystemInterface::OpenFileMode mode_; bool exclusive_; bool recursive_; - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(CreateDirectory); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/create_file.cc b/chrome/browser/chromeos/file_system_provider/operations/create_file.cc index 27fb164..a13c9a9 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/create_file.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/create_file.cc @@ -16,7 +16,7 @@ namespace operations { CreateFile::CreateFile(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, const base::FilePath& file_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), file_path_(file_path), callback_(callback) { diff --git a/chrome/browser/chromeos/file_system_provider/operations/create_file.h b/chrome/browser/chromeos/file_system_provider/operations/create_file.h index 4c9af21..2e51bf2 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/create_file.h +++ b/chrome/browser/chromeos/file_system_provider/operations/create_file.h @@ -32,7 +32,7 @@ class CreateFile : public Operation { CreateFile(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, const base::FilePath& file_path, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~CreateFile(); // Operation overrides. @@ -46,7 +46,7 @@ class CreateFile : public Operation { private: base::FilePath file_path_; - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(CreateFile); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/delete_entry.cc b/chrome/browser/chromeos/file_system_provider/operations/delete_entry.cc index 513b3fd..cf77806 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/delete_entry.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/delete_entry.cc @@ -17,7 +17,7 @@ DeleteEntry::DeleteEntry(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, const base::FilePath& entry_path, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), entry_path_(entry_path), recursive_(recursive), diff --git a/chrome/browser/chromeos/file_system_provider/operations/delete_entry.h b/chrome/browser/chromeos/file_system_provider/operations/delete_entry.h index 675cc39..d757f5a 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/delete_entry.h +++ b/chrome/browser/chromeos/file_system_provider/operations/delete_entry.h @@ -33,7 +33,7 @@ class DeleteEntry : public Operation { const ProvidedFileSystemInfo& file_system_info, const base::FilePath& entry_path, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~DeleteEntry(); // Operation overrides. @@ -49,7 +49,7 @@ class DeleteEntry : public Operation { base::FilePath entry_path_; ProvidedFileSystemInterface::OpenFileMode mode_; bool recursive_; - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(DeleteEntry); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/move_entry.cc b/chrome/browser/chromeos/file_system_provider/operations/move_entry.cc index 909bb35..572bd64 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/move_entry.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/move_entry.cc @@ -17,7 +17,7 @@ MoveEntry::MoveEntry(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), source_path_(source_path), target_path_(target_path), diff --git a/chrome/browser/chromeos/file_system_provider/operations/move_entry.h b/chrome/browser/chromeos/file_system_provider/operations/move_entry.h index 5c6de31..2e08ce1 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/move_entry.h +++ b/chrome/browser/chromeos/file_system_provider/operations/move_entry.h @@ -32,7 +32,7 @@ class MoveEntry : public Operation { const ProvidedFileSystemInfo& file_system_info, const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~MoveEntry(); // Operation overrides. @@ -47,7 +47,7 @@ class MoveEntry : public Operation { private: base::FilePath source_path_; base::FilePath target_path_; - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(MoveEntry); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/read_directory.cc b/chrome/browser/chromeos/file_system_provider/operations/read_directory.cc index eda2ca6..6a20768 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/read_directory.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/read_directory.cc @@ -17,7 +17,7 @@ namespace { // Convert |input| into |output|. If parsing fails, then returns false. bool ConvertRequestValueToEntryList(scoped_ptr<RequestValue> value, - fileapi::AsyncFileUtil::EntryList* output) { + storage::AsyncFileUtil::EntryList* output) { using extensions::api::file_system_provider::EntryMetadata; using extensions::api::file_system_provider_internal:: ReadDirectoryRequestedSuccess::Params; @@ -29,7 +29,7 @@ bool ConvertRequestValueToEntryList(scoped_ptr<RequestValue> value, for (size_t i = 0; i < params->entries.size(); ++i) { const linked_ptr<EntryMetadata> entry_metadata = params->entries[i]; - fileapi::DirectoryEntry output_entry; + storage::DirectoryEntry output_entry; output_entry.is_directory = entry_metadata->is_directory; output_entry.name = entry_metadata->name; output_entry.size = static_cast<int64>(entry_metadata->size); @@ -56,7 +56,7 @@ ReadDirectory::ReadDirectory( extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, const base::FilePath& directory_path, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) + const storage::AsyncFileUtil::ReadDirectoryCallback& callback) : Operation(event_router, file_system_info), directory_path_(directory_path), callback_(callback) { @@ -77,7 +77,7 @@ bool ReadDirectory::Execute(int request_id) { void ReadDirectory::OnSuccess(int /* request_id */, scoped_ptr<RequestValue> result, bool has_more) { - fileapi::AsyncFileUtil::EntryList entry_list; + storage::AsyncFileUtil::EntryList entry_list; const bool convert_result = ConvertRequestValueToEntryList(result.Pass(), &entry_list); @@ -85,7 +85,7 @@ void ReadDirectory::OnSuccess(int /* request_id */, LOG(ERROR) << "Failed to parse a response for the read directory operation."; callback_.Run(base::File::FILE_ERROR_IO, - fileapi::AsyncFileUtil::EntryList(), + storage::AsyncFileUtil::EntryList(), false /* has_more */); return; } @@ -97,7 +97,7 @@ void ReadDirectory::OnError(int /* request_id */, scoped_ptr<RequestValue> /* result */, base::File::Error error) { callback_.Run( - error, fileapi::AsyncFileUtil::EntryList(), false /* has_more */); + error, storage::AsyncFileUtil::EntryList(), false /* has_more */); } } // namespace operations diff --git a/chrome/browser/chromeos/file_system_provider/operations/read_directory.h b/chrome/browser/chromeos/file_system_provider/operations/read_directory.h index bc939a6..c9e536b 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/read_directory.h +++ b/chrome/browser/chromeos/file_system_provider/operations/read_directory.h @@ -31,7 +31,7 @@ class ReadDirectory : public Operation { ReadDirectory(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, const base::FilePath& directory_path, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback); + const storage::AsyncFileUtil::ReadDirectoryCallback& callback); virtual ~ReadDirectory(); // Operation overrides. @@ -45,7 +45,7 @@ class ReadDirectory : public Operation { private: base::FilePath directory_path_; - const fileapi::AsyncFileUtil::ReadDirectoryCallback callback_; + const storage::AsyncFileUtil::ReadDirectoryCallback callback_; DISALLOW_COPY_AND_ASSIGN(ReadDirectory); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/read_directory_unittest.cc b/chrome/browser/chromeos/file_system_provider/operations/read_directory_unittest.cc index dcacecb..f415283 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/read_directory_unittest.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/read_directory_unittest.cc @@ -35,20 +35,20 @@ class CallbackLogger { class Event { public: Event(base::File::Error result, - const fileapi::AsyncFileUtil::EntryList& entry_list, + const storage::AsyncFileUtil::EntryList& entry_list, bool has_more) : result_(result), entry_list_(entry_list), has_more_(has_more) {} virtual ~Event() {} base::File::Error result() { return result_; } - const fileapi::AsyncFileUtil::EntryList& entry_list() { + const storage::AsyncFileUtil::EntryList& entry_list() { return entry_list_; } bool has_more() { return has_more_; } private: base::File::Error result_; - fileapi::AsyncFileUtil::EntryList entry_list_; + storage::AsyncFileUtil::EntryList entry_list_; bool has_more_; DISALLOW_COPY_AND_ASSIGN(Event); @@ -58,7 +58,7 @@ class CallbackLogger { virtual ~CallbackLogger() {} void OnReadDirectory(base::File::Error result, - const fileapi::AsyncFileUtil::EntryList& entry_list, + const storage::AsyncFileUtil::EntryList& entry_list, bool has_more) { events_.push_back(new Event(result, entry_list, has_more)); } @@ -207,7 +207,7 @@ TEST_F(FileSystemProviderOperationsReadDirectoryTest, OnSuccess) { EXPECT_EQ(base::File::FILE_OK, event->result()); ASSERT_EQ(1u, event->entry_list().size()); - const fileapi::DirectoryEntry entry = event->entry_list()[0]; + const storage::DirectoryEntry entry = event->entry_list()[0]; EXPECT_FALSE(entry.is_directory); EXPECT_EQ("blueberries.txt", entry.name); EXPECT_EQ(4096, entry.size); diff --git a/chrome/browser/chromeos/file_system_provider/operations/truncate.cc b/chrome/browser/chromeos/file_system_provider/operations/truncate.cc index f167aef..8bd4519 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/truncate.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/truncate.cc @@ -17,7 +17,7 @@ Truncate::Truncate(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, const base::FilePath& file_path, int64 length, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), file_path_(file_path), length_(length), diff --git a/chrome/browser/chromeos/file_system_provider/operations/truncate.h b/chrome/browser/chromeos/file_system_provider/operations/truncate.h index 52e59a1..6195b50 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/truncate.h +++ b/chrome/browser/chromeos/file_system_provider/operations/truncate.h @@ -33,7 +33,7 @@ class Truncate : public Operation { const ProvidedFileSystemInfo& file_system_info, const base::FilePath& file_path, int64 length, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~Truncate(); // Operation overrides. @@ -48,7 +48,7 @@ class Truncate : public Operation { private: base::FilePath file_path_; int64 length_; - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(Truncate); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/unmount.cc b/chrome/browser/chromeos/file_system_provider/operations/unmount.cc index eb4ccba..de1ee76 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/unmount.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/unmount.cc @@ -13,7 +13,7 @@ namespace operations { Unmount::Unmount(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), callback_(callback) { } diff --git a/chrome/browser/chromeos/file_system_provider/operations/unmount.h b/chrome/browser/chromeos/file_system_provider/operations/unmount.h index b6614d4..6ac8195 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/unmount.h +++ b/chrome/browser/chromeos/file_system_provider/operations/unmount.h @@ -31,7 +31,7 @@ class Unmount : public Operation { public: Unmount(extensions::EventRouter* event_router, const ProvidedFileSystemInfo& file_system_info, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~Unmount(); // Operation overrides. @@ -44,7 +44,7 @@ class Unmount : public Operation { base::File::Error error) OVERRIDE; private: - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(Unmount); }; diff --git a/chrome/browser/chromeos/file_system_provider/operations/write_file.cc b/chrome/browser/chromeos/file_system_provider/operations/write_file.cc index 0e45a01..c893eff 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/write_file.cc +++ b/chrome/browser/chromeos/file_system_provider/operations/write_file.cc @@ -19,7 +19,7 @@ WriteFile::WriteFile(extensions::EventRouter* event_router, scoped_refptr<net::IOBuffer> buffer, int64 offset, int length, - const fileapi::AsyncFileUtil::StatusCallback& callback) + const storage::AsyncFileUtil::StatusCallback& callback) : Operation(event_router, file_system_info), file_handle_(file_handle), buffer_(buffer), diff --git a/chrome/browser/chromeos/file_system_provider/operations/write_file.h b/chrome/browser/chromeos/file_system_provider/operations/write_file.h index eb705f0..057699a 100644 --- a/chrome/browser/chromeos/file_system_provider/operations/write_file.h +++ b/chrome/browser/chromeos/file_system_provider/operations/write_file.h @@ -38,7 +38,7 @@ class WriteFile : public Operation { scoped_refptr<net::IOBuffer> buffer, int64 offset, int length, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); virtual ~WriteFile(); // Operation overrides. @@ -55,7 +55,7 @@ class WriteFile : public Operation { scoped_refptr<net::IOBuffer> buffer_; int64 offset_; int length_; - const fileapi::AsyncFileUtil::StatusCallback callback_; + const storage::AsyncFileUtil::StatusCallback callback_; DISALLOW_COPY_AND_ASSIGN(WriteFile); }; diff --git a/chrome/browser/chromeos/file_system_provider/provided_file_system.cc b/chrome/browser/chromeos/file_system_provider/provided_file_system.cc index 55a2c02..dc0de56 100644 --- a/chrome/browser/chromeos/file_system_provider/provided_file_system.cc +++ b/chrome/browser/chromeos/file_system_provider/provided_file_system.cc @@ -62,7 +62,7 @@ ProvidedFileSystem::~ProvidedFileSystem() { } ProvidedFileSystem::AbortCallback ProvidedFileSystem::RequestUnmount( - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const int request_id = request_manager_.CreateRequest( REQUEST_UNMOUNT, scoped_ptr<RequestManager::HandlerInterface>( @@ -94,7 +94,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::GetMetadata( ProvidedFileSystem::AbortCallback ProvidedFileSystem::ReadDirectory( const base::FilePath& directory_path, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) { + const storage::AsyncFileUtil::ReadDirectoryCallback& callback) { const int request_id = request_manager_.CreateRequest( READ_DIRECTORY, scoped_ptr<RequestManager::HandlerInterface>( @@ -102,7 +102,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::ReadDirectory( event_router_, file_system_info_, directory_path, callback))); if (!request_id) { callback.Run(base::File::FILE_ERROR_SECURITY, - fileapi::AsyncFileUtil::EntryList(), + storage::AsyncFileUtil::EntryList(), false /* has_more */); return AbortCallback(); } @@ -159,7 +159,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::OpenFile( ProvidedFileSystem::AbortCallback ProvidedFileSystem::CloseFile( int file_handle, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const int request_id = request_manager_.CreateRequest( CLOSE_FILE, scoped_ptr<RequestManager::HandlerInterface>(new operations::CloseFile( @@ -177,7 +177,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::CreateDirectory( const base::FilePath& directory_path, bool exclusive, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const int request_id = request_manager_.CreateRequest( CREATE_DIRECTORY, scoped_ptr<RequestManager::HandlerInterface>( @@ -199,7 +199,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::CreateDirectory( ProvidedFileSystem::AbortCallback ProvidedFileSystem::DeleteEntry( const base::FilePath& entry_path, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const int request_id = request_manager_.CreateRequest( DELETE_ENTRY, scoped_ptr<RequestManager::HandlerInterface>(new operations::DeleteEntry( @@ -215,7 +215,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::DeleteEntry( ProvidedFileSystem::AbortCallback ProvidedFileSystem::CreateFile( const base::FilePath& file_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const int request_id = request_manager_.CreateRequest( CREATE_FILE, scoped_ptr<RequestManager::HandlerInterface>(new operations::CreateFile( @@ -232,7 +232,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::CreateFile( ProvidedFileSystem::AbortCallback ProvidedFileSystem::CopyEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const int request_id = request_manager_.CreateRequest( COPY_ENTRY, scoped_ptr<RequestManager::HandlerInterface>( @@ -255,7 +255,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::WriteFile( net::IOBuffer* buffer, int64 offset, int length, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { TRACE_EVENT1("file_system_provider", "ProvidedFileSystem::WriteFile", "length", @@ -282,7 +282,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::WriteFile( ProvidedFileSystem::AbortCallback ProvidedFileSystem::MoveEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const int request_id = request_manager_.CreateRequest( MOVE_ENTRY, scoped_ptr<RequestManager::HandlerInterface>( @@ -303,7 +303,7 @@ ProvidedFileSystem::AbortCallback ProvidedFileSystem::MoveEntry( ProvidedFileSystem::AbortCallback ProvidedFileSystem::Truncate( const base::FilePath& file_path, int64 length, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { const int request_id = request_manager_.CreateRequest( TRUNCATE, scoped_ptr<RequestManager::HandlerInterface>(new operations::Truncate( @@ -331,7 +331,7 @@ base::WeakPtr<ProvidedFileSystemInterface> ProvidedFileSystem::GetWeakPtr() { void ProvidedFileSystem::Abort( int operation_request_id, - const fileapi::AsyncFileUtil::StatusCallback& callback) { + const storage::AsyncFileUtil::StatusCallback& callback) { request_manager_.RejectRequest(operation_request_id, make_scoped_ptr(new RequestValue()), base::File::FILE_ERROR_ABORT); diff --git a/chrome/browser/chromeos/file_system_provider/provided_file_system.h b/chrome/browser/chromeos/file_system_provider/provided_file_system.h index b2fc735..7b7105b 100644 --- a/chrome/browser/chromeos/file_system_provider/provided_file_system.h +++ b/chrome/browser/chromeos/file_system_provider/provided_file_system.h @@ -40,19 +40,19 @@ class ProvidedFileSystem : public ProvidedFileSystemInterface { // ProvidedFileSystemInterface overrides. virtual AbortCallback RequestUnmount( - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback GetMetadata( const base::FilePath& entry_path, const GetMetadataCallback& callback) OVERRIDE; virtual AbortCallback ReadDirectory( const base::FilePath& directory_path, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::ReadDirectoryCallback& callback) OVERRIDE; virtual AbortCallback OpenFile(const base::FilePath& file_path, OpenFileMode mode, const OpenFileCallback& callback) OVERRIDE; virtual AbortCallback CloseFile( int file_handle, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback ReadFile( int file_handle, net::IOBuffer* buffer, @@ -63,32 +63,32 @@ class ProvidedFileSystem : public ProvidedFileSystemInterface { const base::FilePath& directory_path, bool exclusive, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback DeleteEntry( const base::FilePath& entry_path, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback CreateFile( const base::FilePath& file_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback CopyEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback MoveEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback Truncate( const base::FilePath& file_path, int64 length, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual AbortCallback WriteFile( int file_handle, net::IOBuffer* buffer, int64 offset, int length, - const fileapi::AsyncFileUtil::StatusCallback& callback) OVERRIDE; + const storage::AsyncFileUtil::StatusCallback& callback) OVERRIDE; virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const OVERRIDE; virtual RequestManager* GetRequestManager() OVERRIDE; virtual base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() OVERRIDE; @@ -98,7 +98,7 @@ class ProvidedFileSystem : public ProvidedFileSystemInterface { // |operation_request_id|. The request is removed immediately on the C++ side // despite being handled by the providing extension or not. void Abort(int operation_request_id, - const fileapi::AsyncFileUtil::StatusCallback& callback); + const storage::AsyncFileUtil::StatusCallback& callback); Profile* profile_; // Not owned. extensions::EventRouter* event_router_; // Not owned. May be NULL. diff --git a/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h b/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h index 149c2e6..064276f 100644 --- a/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h +++ b/chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h @@ -60,7 +60,7 @@ class ProvidedFileSystemInterface { base::File::Error result)> GetMetadataCallback; typedef base::Callback<void( - const fileapi::AsyncFileUtil::StatusCallback& callback)> AbortCallback; + const storage::AsyncFileUtil::StatusCallback& callback)> AbortCallback; // Mode of opening a file. Used by OpenFile(). enum OpenFileMode { OPEN_FILE_MODE_READ, OPEN_FILE_MODE_WRITE }; @@ -70,7 +70,7 @@ class ProvidedFileSystemInterface { // Requests unmounting of the file system. The callback is called when the // request is accepted or rejected, with an error code. virtual AbortCallback RequestUnmount( - const fileapi::AsyncFileUtil::StatusCallback& callback) = 0; + const storage::AsyncFileUtil::StatusCallback& callback) = 0; // Requests metadata of the passed |entry_path|. It can be either a file // or a directory. @@ -81,7 +81,7 @@ class ProvidedFileSystemInterface { // can be called multiple times until |has_more| is set to false. virtual AbortCallback ReadDirectory( const base::FilePath& directory_path, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) = 0; + const storage::AsyncFileUtil::ReadDirectoryCallback& callback) = 0; // Requests opening a file at |file_path|. If the file doesn't exist, then the // operation will fail. @@ -93,7 +93,7 @@ class ProvidedFileSystemInterface { // |file_handle|. For either succes or error |callback| must be called. virtual AbortCallback CloseFile( int file_handle, - const fileapi::AsyncFileUtil::StatusCallback& callback) = 0; + const storage::AsyncFileUtil::StatusCallback& callback) = 0; // Requests reading a file previously opened with |file_handle|. The callback // can be called multiple times until |has_more| is set to false. On success @@ -112,40 +112,40 @@ class ProvidedFileSystemInterface { const base::FilePath& directory_path, bool exclusive, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) = 0; + const storage::AsyncFileUtil::StatusCallback& callback) = 0; // Requests creating a file. If the entry already exists, then the // FILE_ERROR_EXISTS error must be returned. virtual AbortCallback CreateFile( const base::FilePath& file_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) = 0; + const storage::AsyncFileUtil::StatusCallback& callback) = 0; // Requests deleting a directory. If |recursive| is passed and the entry is // a directory, then all contents of it (recursively) will be deleted too. virtual AbortCallback DeleteEntry( const base::FilePath& entry_path, bool recursive, - const fileapi::AsyncFileUtil::StatusCallback& callback) = 0; + const storage::AsyncFileUtil::StatusCallback& callback) = 0; // Requests copying an entry (recursively in case of a directory) within the // same file system. virtual AbortCallback CopyEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) = 0; + const storage::AsyncFileUtil::StatusCallback& callback) = 0; // Requests moving an entry (recursively in case of a directory) within the // same file system. virtual AbortCallback MoveEntry( const base::FilePath& source_path, const base::FilePath& target_path, - const fileapi::AsyncFileUtil::StatusCallback& callback) = 0; + const storage::AsyncFileUtil::StatusCallback& callback) = 0; // Requests truncating a file to the desired length. virtual AbortCallback Truncate( const base::FilePath& file_path, int64 length, - const fileapi::AsyncFileUtil::StatusCallback& callback) = 0; + const storage::AsyncFileUtil::StatusCallback& callback) = 0; // Requests writing to a file previously opened with |file_handle|. virtual AbortCallback WriteFile( @@ -153,7 +153,7 @@ class ProvidedFileSystemInterface { net::IOBuffer* buffer, int64 offset, int length, - const fileapi::AsyncFileUtil::StatusCallback& callback) = 0; + const storage::AsyncFileUtil::StatusCallback& callback) = 0; // Returns a provided file system info for this file system. virtual const ProvidedFileSystemInfo& GetFileSystemInfo() const = 0; diff --git a/chrome/browser/chromeos/file_system_provider/service.cc b/chrome/browser/chromeos/file_system_provider/service.cc index e420bdc..3c3ebaa 100644 --- a/chrome/browser/chromeos/file_system_provider/service.cc +++ b/chrome/browser/chromeos/file_system_provider/service.cc @@ -126,8 +126,8 @@ bool Service::MountFileSystem(const std::string& extension_id, return false; } - fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); DCHECK(mount_points); // The mount point path and name are unique per system, since they are system @@ -137,8 +137,8 @@ bool Service::MountFileSystem(const std::string& extension_id, const std::string mount_point_name = mount_path.BaseName().AsUTF8Unsafe(); if (!mount_points->RegisterFileSystem(mount_point_name, - fileapi::kFileSystemTypeProvided, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeProvided, + storage::FileSystemMountOption(), mount_path)) { FOR_EACH_OBSERVER( Observer, @@ -191,8 +191,8 @@ bool Service::UnmountFileSystem(const std::string& extension_id, return false; } - fileapi::ExternalMountPoints* const mount_points = - fileapi::ExternalMountPoints::GetSystemInstance(); + storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); DCHECK(mount_points); const ProvidedFileSystemInfo& file_system_info = diff --git a/chrome/browser/chromeos/fileapi/file_system_backend.cc b/chrome/browser/chromeos/fileapi/file_system_backend.cc index e654178..ae2947d 100644 --- a/chrome/browser/chromeos/fileapi/file_system_backend.cc +++ b/chrome/browser/chromeos/fileapi/file_system_backend.cc @@ -23,31 +23,32 @@ namespace chromeos { // static -bool FileSystemBackend::CanHandleURL(const fileapi::FileSystemURL& url) { +bool FileSystemBackend::CanHandleURL(const storage::FileSystemURL& url) { if (!url.is_valid()) return false; - return url.type() == fileapi::kFileSystemTypeNativeLocal || - url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal || - url.type() == fileapi::kFileSystemTypeDrive || - url.type() == fileapi::kFileSystemTypeProvided || - url.type() == fileapi::kFileSystemTypeDeviceMediaAsFileStorage; + return url.type() == storage::kFileSystemTypeNativeLocal || + url.type() == storage::kFileSystemTypeRestrictedNativeLocal || + url.type() == storage::kFileSystemTypeDrive || + url.type() == storage::kFileSystemTypeProvided || + url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage; } FileSystemBackend::FileSystemBackend( FileSystemBackendDelegate* drive_delegate, FileSystemBackendDelegate* file_system_provider_delegate, FileSystemBackendDelegate* mtp_delegate, - scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy, - scoped_refptr<fileapi::ExternalMountPoints> mount_points, - fileapi::ExternalMountPoints* system_mount_points) + scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy, + scoped_refptr<storage::ExternalMountPoints> mount_points, + storage::ExternalMountPoints* system_mount_points) : special_storage_policy_(special_storage_policy), file_access_permissions_(new FileAccessPermissions()), - local_file_util_(fileapi::AsyncFileUtil::CreateForLocalFileSystem()), + local_file_util_(storage::AsyncFileUtil::CreateForLocalFileSystem()), drive_delegate_(drive_delegate), file_system_provider_delegate_(file_system_provider_delegate), mtp_delegate_(mtp_delegate), mount_points_(mount_points), - system_mount_points_(system_mount_points) {} + system_mount_points_(system_mount_points) { +} FileSystemBackend::~FileSystemBackend() { } @@ -58,54 +59,54 @@ void FileSystemBackend::AddSystemMountPoints() { // point already exists or not. system_mount_points_->RegisterFileSystem( "archive", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), chromeos::CrosDisksClient::GetArchiveMountPoint()); system_mount_points_->RegisterFileSystem( "removable", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(fileapi::COPY_SYNC_OPTION_SYNC), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(storage::COPY_SYNC_OPTION_SYNC), chromeos::CrosDisksClient::GetRemovableDiskMountPoint()); system_mount_points_->RegisterFileSystem( "oem", - fileapi::kFileSystemTypeRestrictedNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeRestrictedNativeLocal, + storage::FileSystemMountOption(), base::FilePath(FILE_PATH_LITERAL("/usr/share/oem"))); } -bool FileSystemBackend::CanHandleType(fileapi::FileSystemType type) const { +bool FileSystemBackend::CanHandleType(storage::FileSystemType type) const { switch (type) { - case fileapi::kFileSystemTypeExternal: - case fileapi::kFileSystemTypeDrive: - case fileapi::kFileSystemTypeRestrictedNativeLocal: - case fileapi::kFileSystemTypeNativeLocal: - case fileapi::kFileSystemTypeNativeForPlatformApp: - case fileapi::kFileSystemTypeDeviceMediaAsFileStorage: - case fileapi::kFileSystemTypeProvided: + case storage::kFileSystemTypeExternal: + case storage::kFileSystemTypeDrive: + case storage::kFileSystemTypeRestrictedNativeLocal: + case storage::kFileSystemTypeNativeLocal: + case storage::kFileSystemTypeNativeForPlatformApp: + case storage::kFileSystemTypeDeviceMediaAsFileStorage: + case storage::kFileSystemTypeProvided: return true; default: return false; } } -void FileSystemBackend::Initialize(fileapi::FileSystemContext* context) { +void FileSystemBackend::Initialize(storage::FileSystemContext* context) { } -void FileSystemBackend::ResolveURL(const fileapi::FileSystemURL& url, - fileapi::OpenFileSystemMode mode, +void FileSystemBackend::ResolveURL(const storage::FileSystemURL& url, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback) { std::string id; - fileapi::FileSystemType type; + storage::FileSystemType type; std::string cracked_id; base::FilePath path; - fileapi::FileSystemMountOption option; + storage::FileSystemMountOption option; if (!mount_points_->CrackVirtualPath( url.virtual_path(), &id, &type, &cracked_id, &path, &option) && !system_mount_points_->CrackVirtualPath( url.virtual_path(), &id, &type, &cracked_id, &path, &option)) { // Not under a mount point, so return an error, since the root is not // accessible. - GURL root_url = GURL(fileapi::GetExternalFileSystemRootURIString( + GURL root_url = GURL(storage::GetExternalFileSystemRootURIString( url.origin(), std::string())); callback.Run(root_url, std::string(), base::File::FILE_ERROR_SECURITY); return; @@ -114,7 +115,7 @@ void FileSystemBackend::ResolveURL(const fileapi::FileSystemURL& url, std::string name; // Construct a URL restricted to the found mount point. std::string root_url = - fileapi::GetExternalFileSystemRootURIString(url.origin(), id); + storage::GetExternalFileSystemRootURIString(url.origin(), id); // For removable and archives, the file system root is the external mount // point plus the inner mount point. @@ -139,18 +140,18 @@ void FileSystemBackend::ResolveURL(const fileapi::FileSystemURL& url, callback.Run(GURL(root_url), name, base::File::FILE_OK); } -fileapi::FileSystemQuotaUtil* FileSystemBackend::GetQuotaUtil() { +storage::FileSystemQuotaUtil* FileSystemBackend::GetQuotaUtil() { // No quota support. return NULL; } bool FileSystemBackend::IsAccessAllowed( - const fileapi::FileSystemURL& url) const { + const storage::FileSystemURL& url) const { if (!url.is_valid()) return false; // No extra check is needed for isolated file systems. - if (url.mount_type() == fileapi::kFileSystemTypeIsolated) + if (url.mount_type() == storage::kFileSystemTypeIsolated) return true; if (!CanHandleURL(url)) @@ -160,7 +161,7 @@ bool FileSystemBackend::IsAccessAllowed( // TODO(mtomasz): Temporarily whitelist TimeScapes. Remove this in M-31. // See: crbug.com/271946 if (extension_id == "mlbmkoenclnokonejhlfakkeabdlmpek" && - url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal) { + url.type() == storage::kFileSystemTypeRestrictedNativeLocal) { return true; } @@ -195,10 +196,10 @@ void FileSystemBackend::GrantFileAccessToExtension( } std::string id; - fileapi::FileSystemType type; + storage::FileSystemType type; std::string cracked_id; base::FilePath path; - fileapi::FileSystemMountOption option; + storage::FileSystemMountOption option; if (!mount_points_->CrackVirtualPath(virtual_path, &id, &type, &cracked_id, &path, &option) && !system_mount_points_->CrackVirtualPath(virtual_path, &id, &type, @@ -206,7 +207,7 @@ void FileSystemBackend::GrantFileAccessToExtension( return; } - if (type == fileapi::kFileSystemTypeRestrictedNativeLocal) { + if (type == storage::kFileSystemTypeRestrictedNativeLocal) { LOG(ERROR) << "Can't grant access for restricted mount point"; return; } @@ -220,7 +221,7 @@ void FileSystemBackend::RevokeAccessForExtension( } std::vector<base::FilePath> FileSystemBackend::GetRootDirectories() const { - std::vector<fileapi::MountPoints::MountPointInfo> mount_points; + std::vector<storage::MountPoints::MountPointInfo> mount_points; mount_points_->AddMountPointInfosTo(&mount_points); system_mount_points_->AddMountPointInfosTo(&mount_points); @@ -230,17 +231,17 @@ std::vector<base::FilePath> FileSystemBackend::GetRootDirectories() const { return root_dirs; } -fileapi::AsyncFileUtil* FileSystemBackend::GetAsyncFileUtil( - fileapi::FileSystemType type) { +storage::AsyncFileUtil* FileSystemBackend::GetAsyncFileUtil( + storage::FileSystemType type) { switch (type) { - case fileapi::kFileSystemTypeDrive: + case storage::kFileSystemTypeDrive: return drive_delegate_->GetAsyncFileUtil(type); - case fileapi::kFileSystemTypeProvided: + case storage::kFileSystemTypeProvided: return file_system_provider_delegate_->GetAsyncFileUtil(type); - case fileapi::kFileSystemTypeNativeLocal: - case fileapi::kFileSystemTypeRestrictedNativeLocal: + case storage::kFileSystemTypeNativeLocal: + case storage::kFileSystemTypeRestrictedNativeLocal: return local_file_util_.get(); - case fileapi::kFileSystemTypeDeviceMediaAsFileStorage: + case storage::kFileSystemTypeDeviceMediaAsFileStorage: return mtp_delegate_->GetAsyncFileUtil(type); default: NOTREACHED(); @@ -248,17 +249,18 @@ fileapi::AsyncFileUtil* FileSystemBackend::GetAsyncFileUtil( return NULL; } -fileapi::CopyOrMoveFileValidatorFactory* +storage::CopyOrMoveFileValidatorFactory* FileSystemBackend::GetCopyOrMoveFileValidatorFactory( - fileapi::FileSystemType type, base::File::Error* error_code) { + storage::FileSystemType type, + base::File::Error* error_code) { DCHECK(error_code); *error_code = base::File::FILE_OK; return NULL; } -fileapi::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation( - const fileapi::FileSystemURL& url, - fileapi::FileSystemContext* context, +storage::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation( + const storage::FileSystemURL& url, + storage::FileSystemContext* context, base::File::Error* error_code) const { DCHECK(url.is_valid()); @@ -267,39 +269,41 @@ fileapi::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation( return NULL; } - if (url.type() == fileapi::kFileSystemTypeDeviceMediaAsFileStorage) { + if (url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage) { // MTP file operations run on MediaTaskRunner. - return fileapi::FileSystemOperation::Create( - url, context, - make_scoped_ptr(new fileapi::FileSystemOperationContext( + return storage::FileSystemOperation::Create( + url, + context, + make_scoped_ptr(new storage::FileSystemOperationContext( context, MediaFileSystemBackend::MediaTaskRunner()))); } - DCHECK(url.type() == fileapi::kFileSystemTypeNativeLocal || - url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal || - url.type() == fileapi::kFileSystemTypeDrive || - url.type() == fileapi::kFileSystemTypeProvided); - return fileapi::FileSystemOperation::Create( - url, context, - make_scoped_ptr(new fileapi::FileSystemOperationContext(context))); + DCHECK(url.type() == storage::kFileSystemTypeNativeLocal || + url.type() == storage::kFileSystemTypeRestrictedNativeLocal || + url.type() == storage::kFileSystemTypeDrive || + url.type() == storage::kFileSystemTypeProvided); + return storage::FileSystemOperation::Create( + url, + context, + make_scoped_ptr(new storage::FileSystemOperationContext(context))); } bool FileSystemBackend::SupportsStreaming( - const fileapi::FileSystemURL& url) const { - return url.type() == fileapi::kFileSystemTypeDrive || - url.type() == fileapi::kFileSystemTypeProvided || - url.type() == fileapi::kFileSystemTypeDeviceMediaAsFileStorage; + const storage::FileSystemURL& url) const { + return url.type() == storage::kFileSystemTypeDrive || + url.type() == storage::kFileSystemTypeProvided || + url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage; } bool FileSystemBackend::HasInplaceCopyImplementation( - fileapi::FileSystemType type) const { + storage::FileSystemType type) const { switch (type) { - case fileapi::kFileSystemTypeDrive: - case fileapi::kFileSystemTypeProvided: - case fileapi::kFileSystemTypeDeviceMediaAsFileStorage: + case storage::kFileSystemTypeDrive: + case storage::kFileSystemTypeProvided: + case storage::kFileSystemTypeDeviceMediaAsFileStorage: return true; - case fileapi::kFileSystemTypeNativeLocal: - case fileapi::kFileSystemTypeRestrictedNativeLocal: + case storage::kFileSystemTypeNativeLocal: + case storage::kFileSystemTypeRestrictedNativeLocal: return false; default: NOTREACHED(); @@ -307,68 +311,68 @@ bool FileSystemBackend::HasInplaceCopyImplementation( return true; } -scoped_ptr<webkit_blob::FileStreamReader> -FileSystemBackend::CreateFileStreamReader( - const fileapi::FileSystemURL& url, +scoped_ptr<storage::FileStreamReader> FileSystemBackend::CreateFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) const { + storage::FileSystemContext* context) const { DCHECK(url.is_valid()); if (!IsAccessAllowed(url)) - return scoped_ptr<webkit_blob::FileStreamReader>(); + return scoped_ptr<storage::FileStreamReader>(); switch (url.type()) { - case fileapi::kFileSystemTypeDrive: + case storage::kFileSystemTypeDrive: return drive_delegate_->CreateFileStreamReader( url, offset, expected_modification_time, context); - case fileapi::kFileSystemTypeProvided: + case storage::kFileSystemTypeProvided: return file_system_provider_delegate_->CreateFileStreamReader( url, offset, expected_modification_time, context); - case fileapi::kFileSystemTypeNativeLocal: - case fileapi::kFileSystemTypeRestrictedNativeLocal: - return scoped_ptr<webkit_blob::FileStreamReader>( - webkit_blob::FileStreamReader::CreateForFileSystemFile( + case storage::kFileSystemTypeNativeLocal: + case storage::kFileSystemTypeRestrictedNativeLocal: + return scoped_ptr<storage::FileStreamReader>( + storage::FileStreamReader::CreateForFileSystemFile( context, url, offset, expected_modification_time)); - case fileapi::kFileSystemTypeDeviceMediaAsFileStorage: + case storage::kFileSystemTypeDeviceMediaAsFileStorage: return mtp_delegate_->CreateFileStreamReader( url, offset, expected_modification_time, context); default: NOTREACHED(); } - return scoped_ptr<webkit_blob::FileStreamReader>(); + return scoped_ptr<storage::FileStreamReader>(); } -scoped_ptr<fileapi::FileStreamWriter> -FileSystemBackend::CreateFileStreamWriter( - const fileapi::FileSystemURL& url, +scoped_ptr<storage::FileStreamWriter> FileSystemBackend::CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) const { + storage::FileSystemContext* context) const { DCHECK(url.is_valid()); if (!IsAccessAllowed(url)) - return scoped_ptr<fileapi::FileStreamWriter>(); + return scoped_ptr<storage::FileStreamWriter>(); switch (url.type()) { - case fileapi::kFileSystemTypeDrive: + case storage::kFileSystemTypeDrive: return drive_delegate_->CreateFileStreamWriter(url, offset, context); - case fileapi::kFileSystemTypeProvided: + case storage::kFileSystemTypeProvided: return file_system_provider_delegate_->CreateFileStreamWriter( url, offset, context); - case fileapi::kFileSystemTypeNativeLocal: - return scoped_ptr<fileapi::FileStreamWriter>( - fileapi::FileStreamWriter::CreateForLocalFile( - context->default_file_task_runner(), url.path(), offset, - fileapi::FileStreamWriter::OPEN_EXISTING_FILE)); - case fileapi::kFileSystemTypeRestrictedNativeLocal: + case storage::kFileSystemTypeNativeLocal: + return scoped_ptr<storage::FileStreamWriter>( + storage::FileStreamWriter::CreateForLocalFile( + context->default_file_task_runner(), + url.path(), + offset, + storage::FileStreamWriter::OPEN_EXISTING_FILE)); + case storage::kFileSystemTypeRestrictedNativeLocal: // Restricted native local file system is read only. - return scoped_ptr<fileapi::FileStreamWriter>(); - case fileapi::kFileSystemTypeDeviceMediaAsFileStorage: + return scoped_ptr<storage::FileStreamWriter>(); + case storage::kFileSystemTypeDeviceMediaAsFileStorage: return mtp_delegate_->CreateFileStreamWriter(url, offset, context); default: NOTREACHED(); } - return scoped_ptr<fileapi::FileStreamWriter>(); + return scoped_ptr<storage::FileStreamWriter>(); } bool FileSystemBackend::GetVirtualPath( diff --git a/chrome/browser/chromeos/fileapi/file_system_backend.h b/chrome/browser/chromeos/fileapi/file_system_backend.h index ffccdf1..a8109bf 100644 --- a/chrome/browser/chromeos/fileapi/file_system_backend.h +++ b/chrome/browser/chromeos/fileapi/file_system_backend.h @@ -15,11 +15,11 @@ #include "webkit/browser/quota/special_storage_policy.h" #include "webkit/common/fileapi/file_system_types.h" -namespace fileapi { +namespace storage { class CopyOrMoveFileValidatorFactory; class ExternalMountPoints; class FileSystemURL; -} // namespace fileapi +} // namespace storage namespace chromeos { @@ -58,9 +58,9 @@ class FileAccessPermissions; // // filesystem:<origin>/external/<mount_name>/... // -class FileSystemBackend : public fileapi::ExternalFileSystemBackend { +class FileSystemBackend : public storage::ExternalFileSystemBackend { public: - using fileapi::FileSystemBackend::OpenFileSystemCallback; + using storage::FileSystemBackend::OpenFileSystemCallback; // FileSystemBackend will take an ownership of a |mount_points| // reference. On the other hand, |system_mount_points| will be kept as a raw @@ -71,9 +71,9 @@ class FileSystemBackend : public fileapi::ExternalFileSystemBackend { FileSystemBackendDelegate* drive_delegate, FileSystemBackendDelegate* file_system_provider_delegate, FileSystemBackendDelegate* mtp_delegate, - scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy, - scoped_refptr<fileapi::ExternalMountPoints> mount_points, - fileapi::ExternalMountPoints* system_mount_points); + scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy, + scoped_refptr<storage::ExternalMountPoints> mount_points, + storage::ExternalMountPoints* system_mount_points); virtual ~FileSystemBackend(); // Adds system mount points, such as "archive", and "removable". This @@ -83,42 +83,41 @@ class FileSystemBackend : public fileapi::ExternalFileSystemBackend { // Returns true if CrosMountpointProvider can handle |url|, i.e. its // file system type matches with what this provider supports. // This could be called on any threads. - static bool CanHandleURL(const fileapi::FileSystemURL& url); + static bool CanHandleURL(const storage::FileSystemURL& url); - // fileapi::FileSystemBackend overrides. - virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; - virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE; - virtual void ResolveURL(const fileapi::FileSystemURL& url, - fileapi::OpenFileSystemMode mode, + // storage::FileSystemBackend overrides. + virtual bool CanHandleType(storage::FileSystemType type) const OVERRIDE; + virtual void Initialize(storage::FileSystemContext* context) OVERRIDE; + virtual void ResolveURL(const storage::FileSystemURL& url, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback) OVERRIDE; - virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( - fileapi::FileSystemType type) OVERRIDE; - virtual fileapi::CopyOrMoveFileValidatorFactory* - GetCopyOrMoveFileValidatorFactory( - fileapi::FileSystemType type, - base::File::Error* error_code) OVERRIDE; - virtual fileapi::FileSystemOperation* CreateFileSystemOperation( - const fileapi::FileSystemURL& url, - fileapi::FileSystemContext* context, + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE; + virtual storage::CopyOrMoveFileValidatorFactory* + GetCopyOrMoveFileValidatorFactory(storage::FileSystemType type, + base::File::Error* error_code) OVERRIDE; + virtual storage::FileSystemOperation* CreateFileSystemOperation( + const storage::FileSystemURL& url, + storage::FileSystemContext* context, base::File::Error* error_code) const OVERRIDE; virtual bool SupportsStreaming( - const fileapi::FileSystemURL& url) const OVERRIDE; + const storage::FileSystemURL& url) const OVERRIDE; virtual bool HasInplaceCopyImplementation( - fileapi::FileSystemType type) const OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( - const fileapi::FileSystemURL& path, + storage::FileSystemType type) const OVERRIDE; + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( + const storage::FileSystemURL& path, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) const OVERRIDE; - virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + storage::FileSystemContext* context) const OVERRIDE; + virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) const OVERRIDE; - virtual fileapi::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; + storage::FileSystemContext* context) const OVERRIDE; + virtual storage::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; - // fileapi::ExternalFileSystemBackend overrides. - virtual bool IsAccessAllowed(const fileapi::FileSystemURL& url) - const OVERRIDE; + // storage::ExternalFileSystemBackend overrides. + virtual bool IsAccessAllowed( + const storage::FileSystemURL& url) const OVERRIDE; virtual std::vector<base::FilePath> GetRootDirectories() const OVERRIDE; virtual void GrantFullAccessToExtension( const std::string& extension_id) OVERRIDE; @@ -131,9 +130,9 @@ class FileSystemBackend : public fileapi::ExternalFileSystemBackend { base::FilePath* virtual_path) OVERRIDE; private: - scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; + scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; scoped_ptr<FileAccessPermissions> file_access_permissions_; - scoped_ptr<fileapi::AsyncFileUtil> local_file_util_; + scoped_ptr<storage::AsyncFileUtil> local_file_util_; // The delegate instance for the drive file system related operations. scoped_ptr<FileSystemBackendDelegate> drive_delegate_; @@ -155,11 +154,11 @@ class FileSystemBackend : public fileapi::ExternalFileSystemBackend { // |file_system_mount_points_| map 'xxx' to '/foo/foo1/xxx', |GetVirtualPaths| // will resolve '/foo/foo1/xxx/yyy' as 'foo1/xxx/yyy' (i.e. the mapping from // |mount_points_| will be used). - scoped_refptr<fileapi::ExternalMountPoints> mount_points_; + scoped_refptr<storage::ExternalMountPoints> mount_points_; // Globally visible mount points. System MountPonts instance should outlive // all FileSystemBackend instances, so raw pointer is safe. - fileapi::ExternalMountPoints* system_mount_points_; + storage::ExternalMountPoints* system_mount_points_; DISALLOW_COPY_AND_ASSIGN(FileSystemBackend); }; diff --git a/chrome/browser/chromeos/fileapi/file_system_backend_delegate.h b/chrome/browser/chromeos/fileapi/file_system_backend_delegate.h index 5fcda49..f083a91 100644 --- a/chrome/browser/chromeos/fileapi/file_system_backend_delegate.h +++ b/chrome/browser/chromeos/fileapi/file_system_backend_delegate.h @@ -13,16 +13,16 @@ namespace base { class Time; } // namespace base -namespace fileapi { +namespace storage { class AsyncFileUtil; class FileSystemContext; class FileSystemURL; class FileStreamWriter; -} // namespace fileapi +} // namespace storage -namespace webkit_blob { +namespace storage { class FileStreamReader; -} // namespace webkit_blob +} // namespace storage namespace chromeos { @@ -33,21 +33,21 @@ class FileSystemBackendDelegate { virtual ~FileSystemBackendDelegate() {} // Called from FileSystemBackend::GetAsyncFileUtil(). - virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( - fileapi::FileSystemType type) = 0; + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) = 0; // Called from FileSystemBackend::CreateFileStreamReader(). - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( - const fileapi::FileSystemURL& url, + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) = 0; + storage::FileSystemContext* context) = 0; // Called from FileSystemBackend::CreateFileStreamWriter(). - virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) = 0; + storage::FileSystemContext* context) = 0; }; } // namespace chromeos diff --git a/chrome/browser/chromeos/fileapi/file_system_backend_unittest.cc b/chrome/browser/chromeos/fileapi/file_system_backend_unittest.cc index 054c01b..5829a8b 100644 --- a/chrome/browser/chromeos/fileapi/file_system_backend_unittest.cc +++ b/chrome/browser/chromeos/fileapi/file_system_backend_unittest.cc @@ -17,8 +17,8 @@ #define FPL(x) FILE_PATH_LITERAL(x) -using fileapi::ExternalMountPoints; -using fileapi::FileSystemURL; +using storage::ExternalMountPoints; +using storage::FileSystemURL; namespace { @@ -27,26 +27,26 @@ FileSystemURL CreateFileSystemURL(const std::string& extension, ExternalMountPoints* mount_points) { return mount_points->CreateCrackedFileSystemURL( GURL("chrome-extension://" + extension + "/"), - fileapi::kFileSystemTypeExternal, + storage::kFileSystemTypeExternal, base::FilePath::FromUTF8Unsafe(path)); } TEST(ChromeOSFileSystemBackendTest, DefaultMountPoints) { // Make sure no system-level mount points are registered before testing // to avoid flakiness. - fileapi::ExternalMountPoints::GetSystemInstance()->RevokeAllFileSystems(); + storage::ExternalMountPoints::GetSystemInstance()->RevokeAllFileSystems(); - scoped_refptr<quota::SpecialStoragePolicy> storage_policy = + scoped_refptr<storage::SpecialStoragePolicy> storage_policy = new content::MockSpecialStoragePolicy(); - scoped_refptr<fileapi::ExternalMountPoints> mount_points( - fileapi::ExternalMountPoints::CreateRefCounted()); + scoped_refptr<storage::ExternalMountPoints> mount_points( + storage::ExternalMountPoints::CreateRefCounted()); chromeos::FileSystemBackend backend( NULL, // drive_delegate NULL, // file_system_provider_delegate NULL, // mtp_delegate storage_policy, mount_points.get(), - fileapi::ExternalMountPoints::GetSystemInstance()); + storage::ExternalMountPoints::GetSystemInstance()); backend.AddSystemMountPoints(); std::vector<base::FilePath> root_dirs = backend.GetRootDirectories(); std::set<base::FilePath> root_dirs_set(root_dirs.begin(), root_dirs.end()); @@ -62,13 +62,13 @@ TEST(ChromeOSFileSystemBackendTest, DefaultMountPoints) { } TEST(ChromeOSFileSystemBackendTest, GetRootDirectories) { - scoped_refptr<quota::SpecialStoragePolicy> storage_policy = + scoped_refptr<storage::SpecialStoragePolicy> storage_policy = new content::MockSpecialStoragePolicy(); - scoped_refptr<fileapi::ExternalMountPoints> mount_points( - fileapi::ExternalMountPoints::CreateRefCounted()); + scoped_refptr<storage::ExternalMountPoints> mount_points( + storage::ExternalMountPoints::CreateRefCounted()); - scoped_refptr<fileapi::ExternalMountPoints> system_mount_points( - fileapi::ExternalMountPoints::CreateRefCounted()); + scoped_refptr<storage::ExternalMountPoints> system_mount_points( + storage::ExternalMountPoints::CreateRefCounted()); chromeos::FileSystemBackend backend(NULL, // drive_delegate NULL, // file_system_provider_delegate @@ -81,22 +81,22 @@ TEST(ChromeOSFileSystemBackendTest, GetRootDirectories) { // Register 'local' test mount points. mount_points->RegisterFileSystem("c", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), base::FilePath(FPL("/a/b/c"))); mount_points->RegisterFileSystem("d", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), base::FilePath(FPL("/b/c/d"))); // Register system test mount points. system_mount_points->RegisterFileSystem("d", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), base::FilePath(FPL("/g/c/d"))); system_mount_points->RegisterFileSystem("e", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), base::FilePath(FPL("/g/d/e"))); std::vector<base::FilePath> root_dirs = backend.GetRootDirectories(); @@ -113,10 +113,10 @@ TEST(ChromeOSFileSystemBackendTest, AccessPermissions) { scoped_refptr<content::MockSpecialStoragePolicy> storage_policy = new content::MockSpecialStoragePolicy(); - scoped_refptr<fileapi::ExternalMountPoints> mount_points( - fileapi::ExternalMountPoints::CreateRefCounted()); - scoped_refptr<fileapi::ExternalMountPoints> system_mount_points( - fileapi::ExternalMountPoints::CreateRefCounted()); + scoped_refptr<storage::ExternalMountPoints> mount_points( + storage::ExternalMountPoints::CreateRefCounted()); + scoped_refptr<storage::ExternalMountPoints> system_mount_points( + storage::ExternalMountPoints::CreateRefCounted()); chromeos::FileSystemBackend backend(NULL, // drive_delegate NULL, // file_system_provider_delegate NULL, // mtp_delegate @@ -131,18 +131,18 @@ TEST(ChromeOSFileSystemBackendTest, AccessPermissions) { // Initialize mount points. ASSERT_TRUE(system_mount_points->RegisterFileSystem( "system", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), base::FilePath(FPL("/g/system")))); ASSERT_TRUE(mount_points->RegisterFileSystem( "removable", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), base::FilePath(FPL("/media/removable")))); ASSERT_TRUE(mount_points->RegisterFileSystem( "oem", - fileapi::kFileSystemTypeRestrictedNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeRestrictedNativeLocal, + storage::FileSystemMountOption(), base::FilePath(FPL("/usr/share/oem")))); // Backend specific mount point access. @@ -191,11 +191,11 @@ TEST(ChromeOSFileSystemBackendTest, AccessPermissions) { // The extension cannot access new mount points. // TODO(tbarzic): This should probably be changed. - ASSERT_TRUE(mount_points->RegisterFileSystem( - "test", - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), - base::FilePath(FPL("/foo/test")))); + ASSERT_TRUE( + mount_points->RegisterFileSystem("test", + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), + base::FilePath(FPL("/foo/test")))); EXPECT_FALSE(backend.IsAccessAllowed( CreateFileSystemURL(extension, "test_/foo", mount_points.get()))); @@ -207,10 +207,10 @@ TEST(ChromeOSFileSystemBackendTest, AccessPermissions) { TEST(ChromeOSFileSystemBackendTest, GetVirtualPathConflictWithSystemPoints) { scoped_refptr<content::MockSpecialStoragePolicy> storage_policy = new content::MockSpecialStoragePolicy(); - scoped_refptr<fileapi::ExternalMountPoints> mount_points( - fileapi::ExternalMountPoints::CreateRefCounted()); - scoped_refptr<fileapi::ExternalMountPoints> system_mount_points( - fileapi::ExternalMountPoints::CreateRefCounted()); + scoped_refptr<storage::ExternalMountPoints> mount_points( + storage::ExternalMountPoints::CreateRefCounted()); + scoped_refptr<storage::ExternalMountPoints> system_mount_points( + storage::ExternalMountPoints::CreateRefCounted()); chromeos::FileSystemBackend backend(NULL, // drive_delegate NULL, // file_system_provider_delegate NULL, // mtp_delegate @@ -218,9 +218,9 @@ TEST(ChromeOSFileSystemBackendTest, GetVirtualPathConflictWithSystemPoints) { mount_points.get(), system_mount_points.get()); - const fileapi::FileSystemType type = fileapi::kFileSystemTypeNativeLocal; - const fileapi::FileSystemMountOption option = - fileapi::FileSystemMountOption(); + const storage::FileSystemType type = storage::kFileSystemTypeNativeLocal; + const storage::FileSystemMountOption option = + storage::FileSystemMountOption(); // Backend specific mount points. ASSERT_TRUE(mount_points->RegisterFileSystem( diff --git a/chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.cc b/chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.cc index 27a01a2..62cbf9f 100644 --- a/chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.cc +++ b/chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.cc @@ -20,34 +20,34 @@ MTPFileSystemBackendDelegate::MTPFileSystemBackendDelegate( MTPFileSystemBackendDelegate::~MTPFileSystemBackendDelegate() { } -fileapi::AsyncFileUtil* MTPFileSystemBackendDelegate::GetAsyncFileUtil( - fileapi::FileSystemType type) { - DCHECK_EQ(fileapi::kFileSystemTypeDeviceMediaAsFileStorage, type); +storage::AsyncFileUtil* MTPFileSystemBackendDelegate::GetAsyncFileUtil( + storage::FileSystemType type) { + DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, type); return device_media_async_file_util_.get(); } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> MTPFileSystemBackendDelegate::CreateFileStreamReader( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) { - DCHECK_EQ(fileapi::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); + storage::FileSystemContext* context) { + DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); return device_media_async_file_util_->GetFileStreamReader( url, offset, expected_modification_time, context); } -scoped_ptr<fileapi::FileStreamWriter> +scoped_ptr<storage::FileStreamWriter> MTPFileSystemBackendDelegate::CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) { - DCHECK_EQ(fileapi::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); + storage::FileSystemContext* context) { + DCHECK_EQ(storage::kFileSystemTypeDeviceMediaAsFileStorage, url.type()); // TODO(kinaba): support writing. - return scoped_ptr<fileapi::FileStreamWriter>(); + return scoped_ptr<storage::FileStreamWriter>(); } } // namespace chromeos diff --git a/chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.h b/chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.h index a3d21da..2929194 100644 --- a/chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.h +++ b/chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.h @@ -25,17 +25,17 @@ class MTPFileSystemBackendDelegate : public FileSystemBackendDelegate { virtual ~MTPFileSystemBackendDelegate(); // FileSystemBackendDelegate overrides. - virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( - fileapi::FileSystemType type) OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( - const fileapi::FileSystemURL& url, + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE; + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) OVERRIDE; - virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + storage::FileSystemContext* context) OVERRIDE; + virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) OVERRIDE; + storage::FileSystemContext* context) OVERRIDE; private: scoped_ptr<DeviceMediaAsyncFileUtil> device_media_async_file_util_; diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 0aaf43d..6b83c43 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -442,12 +442,12 @@ void TabSpecificContentSettings::OnFileSystemAccessed( const GURL& url, bool blocked_by_policy) { if (blocked_by_policy) { - blocked_local_shared_objects_.file_systems()->AddFileSystem(url, - fileapi::kFileSystemTypeTemporary, 0); + blocked_local_shared_objects_.file_systems()->AddFileSystem( + url, storage::kFileSystemTypeTemporary, 0); OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES); } else { - allowed_local_shared_objects_.file_systems()->AddFileSystem(url, - fileapi::kFileSystemTypeTemporary, 0); + allowed_local_shared_objects_.file_systems()->AddFileSystem( + url, storage::kFileSystemTypeTemporary, 0); OnContentAllowed(CONTENT_SETTINGS_TYPE_COOKIES); } diff --git a/chrome/browser/devtools/devtools_file_helper.cc b/chrome/browser/devtools/devtools_file_helper.cc index e480e52..7ccfbd8 100644 --- a/chrome/browser/devtools/devtools_file_helper.cc +++ b/chrome/browser/devtools/devtools_file_helper.cc @@ -131,10 +131,10 @@ void AppendToFile(const base::FilePath& path, const std::string& content) { base::AppendToFile(path, content.c_str(), content.length()); } -fileapi::IsolatedContext* isolated_context() { +storage::IsolatedContext* isolated_context() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - fileapi::IsolatedContext* isolated_context = - fileapi::IsolatedContext::GetInstance(); + storage::IsolatedContext* isolated_context = + storage::IsolatedContext::GetInstance(); DCHECK(isolated_context); return isolated_context; } @@ -145,7 +145,9 @@ std::string RegisterFileSystem(WebContents* web_contents, DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); CHECK(web_contents->GetURL().SchemeIs(content::kChromeDevToolsScheme)); std::string file_system_id = isolated_context()->RegisterFileSystemForPath( - fileapi::kFileSystemTypeNativeLocal, std::string(), path, + storage::kFileSystemTypeNativeLocal, + std::string(), + path, registered_name); content::ChildProcessSecurityPolicy* policy = @@ -172,13 +174,10 @@ DevToolsFileHelper::FileSystem CreateFileSystemStruct( const std::string& registered_name, const std::string& file_system_path) { const GURL origin = web_contents->GetURL().GetOrigin(); - std::string file_system_name = fileapi::GetIsolatedFileSystemName( - origin, - file_system_id); - std::string root_url = fileapi::GetIsolatedFileSystemRootURIString( - origin, - file_system_id, - registered_name); + std::string file_system_name = + storage::GetIsolatedFileSystemName(origin, file_system_id); + std::string root_url = storage::GetIsolatedFileSystemRootURIString( + origin, file_system_id, registered_name); return DevToolsFileHelper::FileSystem(file_system_name, root_url, file_system_path); @@ -320,18 +319,18 @@ void DevToolsFileHelper::UpgradeDraggedFileSystemPermissions( const std::string& file_system_url, const AddFileSystemCallback& callback, const ShowInfoBarCallback& show_info_bar_callback) { - fileapi::FileSystemURL root_url = + storage::FileSystemURL root_url = isolated_context()->CrackURL(GURL(file_system_url)); if (!root_url.is_valid() || !root_url.path().empty()) { callback.Run(FileSystem()); return; } - std::vector<fileapi::MountPoints::MountPointInfo> mount_points; + std::vector<storage::MountPoints::MountPointInfo> mount_points; isolated_context()->GetDraggedFileInfo(root_url.filesystem_id(), &mount_points); - std::vector<fileapi::MountPoints::MountPointInfo>::const_iterator it = + std::vector<storage::MountPoints::MountPointInfo>::const_iterator it = mount_points.begin(); for (; it != mount_points.end(); ++it) InnerAddFileSystem(callback, show_info_bar_callback, it->path); diff --git a/chrome/browser/diagnostics/sqlite_diagnostics.cc b/chrome/browser/diagnostics/sqlite_diagnostics.cc index 2982d2b..a032f37 100644 --- a/chrome/browser/diagnostics/sqlite_diagnostics.cc +++ b/chrome/browser/diagnostics/sqlite_diagnostics.cc @@ -207,9 +207,9 @@ DiagnosticsTest* MakeSqliteCookiesDbTest() { } DiagnosticsTest* MakeSqliteWebDatabaseTrackerDbTest() { - base::FilePath databases_dir(webkit_database::kDatabaseDirectoryName); + base::FilePath databases_dir(storage::kDatabaseDirectoryName); base::FilePath tracker_db = - databases_dir.Append(webkit_database::kTrackerDatabaseFileName); + databases_dir.Append(storage::kTrackerDatabaseFileName); return new SqliteIntegrityTest( SqliteIntegrityTest::NO_FLAGS_SET, DIAGNOSTICS_SQLITE_INTEGRITY_DATABASE_TRACKER_TEST, diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index ff6e003..eb245c4 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc @@ -1070,10 +1070,10 @@ bool DeveloperPrivateLoadDirectoryFunction::RunAsync() { // Directory url is non empty only for syncfilesystem. if (directory_url_str != "") { - fileapi::FileSystemURL directory_url = + storage::FileSystemURL directory_url = context_->CrackURL(GURL(directory_url_str)); if (!directory_url.is_valid() || - directory_url.type() != fileapi::kFileSystemTypeSyncable) { + directory_url.type() != storage::kFileSystemTypeSyncable) { SetError("DirectoryEntry of unsupported filesystem."); return false; } @@ -1093,21 +1093,21 @@ bool DeveloperPrivateLoadDirectoryFunction::RunAsync() { // points to a non-native local directory. std::string filesystem_id; bool cracked = - fileapi::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id); + storage::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id); CHECK(cracked); base::FilePath virtual_path = - fileapi::IsolatedContext::GetInstance() + storage::IsolatedContext::GetInstance() ->CreateVirtualRootPath(filesystem_id) .Append(base::FilePath::FromUTF8Unsafe(filesystem_path)); - fileapi::FileSystemURL directory_url = context_->CreateCrackedFileSystemURL( + storage::FileSystemURL directory_url = context_->CreateCrackedFileSystemURL( extensions::Extension::GetBaseURLFromExtensionId(extension_id()), - fileapi::kFileSystemTypeIsolated, + storage::kFileSystemTypeIsolated, virtual_path); if (directory_url.is_valid() && - directory_url.type() != fileapi::kFileSystemTypeNativeLocal && - directory_url.type() != fileapi::kFileSystemTypeRestrictedNativeLocal && - directory_url.type() != fileapi::kFileSystemTypeDragged) { + directory_url.type() != storage::kFileSystemTypeNativeLocal && + directory_url.type() != storage::kFileSystemTypeRestrictedNativeLocal && + directory_url.type() != storage::kFileSystemTypeDragged) { return LoadByFileSystemAPI(directory_url); } @@ -1118,7 +1118,7 @@ bool DeveloperPrivateLoadDirectoryFunction::RunAsync() { } bool DeveloperPrivateLoadDirectoryFunction::LoadByFileSystemAPI( - const fileapi::FileSystemURL& directory_url) { + const storage::FileSystemURL& directory_url) { std::string directory_url_str = directory_url.ToGURL().spec(); size_t pos = 0; @@ -1176,7 +1176,7 @@ void DeveloperPrivateLoadDirectoryFunction::ReadDirectoryByFileSystemAPI( const base::FilePath& project_path, const base::FilePath& destination_path) { GURL project_url = GURL(project_base_url_ + destination_path.AsUTF8Unsafe()); - fileapi::FileSystemURL url = context_->CrackURL(project_url); + storage::FileSystemURL url = context_->CrackURL(project_url); context_->operation_runner()->ReadDirectory( url, base::Bind(&DeveloperPrivateLoadDirectoryFunction:: @@ -1188,9 +1188,8 @@ void DeveloperPrivateLoadDirectoryFunction::ReadDirectoryByFileSystemAPICb( const base::FilePath& project_path, const base::FilePath& destination_path, base::File::Error status, - const fileapi::FileSystemOperation::FileEntryList& file_list, + const storage::FileSystemOperation::FileEntryList& file_list, bool has_more) { - if (status != base::File::FILE_OK) { DLOG(ERROR) << "Error in copying files from sync filesystem."; return; @@ -1214,7 +1213,7 @@ void DeveloperPrivateLoadDirectoryFunction::ReadDirectoryByFileSystemAPICb( GURL project_url = GURL(project_base_url_ + destination_path.Append(file_list[i].name).AsUTF8Unsafe()); - fileapi::FileSystemURL url = context_->CrackURL(project_url); + storage::FileSystemURL url = context_->CrackURL(project_url); base::FilePath target_path = project_path; target_path = target_path.Append(file_list[i].name); @@ -1245,7 +1244,7 @@ void DeveloperPrivateLoadDirectoryFunction::SnapshotFileCallback( base::File::Error result, const base::File::Info& file_info, const base::FilePath& src_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + const scoped_refptr<storage::ShareableFileReference>& file_ref) { if (result != base::File::FILE_OK) { SetError("Error in copying files from sync filesystem."); success_ = false; diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chrome/browser/extensions/api/developer_private/developer_private_api.h index 6525bd4..5ac8ae9 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.h +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h @@ -412,7 +412,7 @@ class DeveloperPrivateLoadDirectoryFunction // ExtensionFunction: virtual bool RunAsync() OVERRIDE; - bool LoadByFileSystemAPI(const fileapi::FileSystemURL& directory_url); + bool LoadByFileSystemAPI(const storage::FileSystemURL& directory_url); void ClearExistingDirectoryContent(const base::FilePath& project_path); @@ -423,7 +423,7 @@ class DeveloperPrivateLoadDirectoryFunction const base::FilePath& project_path, const base::FilePath& destination_path, base::File::Error result, - const fileapi::FileSystemOperation::FileEntryList& file_list, + const storage::FileSystemOperation::FileEntryList& file_list, bool has_more); void SnapshotFileCallback( @@ -431,14 +431,14 @@ class DeveloperPrivateLoadDirectoryFunction base::File::Error result, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); + const scoped_refptr<storage::ShareableFileReference>& file_ref); void CopyFile(const base::FilePath& src_path, const base::FilePath& dest_path); void Load(); - scoped_refptr<fileapi::FileSystemContext> context_; + scoped_refptr<storage::FileSystemContext> context_; // syncfs url representing the root of the folder to be copied. std::string project_base_url_; diff --git a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc index 8853e1e1..5aecf46 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc @@ -699,9 +699,9 @@ class ScopedItemVectorCanceller { // Writes an HTML5 file so that it can be downloaded. class HTML5FileWriter { public: - static bool CreateFileForTesting(fileapi::FileSystemContext* context, - const fileapi::FileSystemURL& path, - const char*data, + static bool CreateFileForTesting(storage::FileSystemContext* context, + const storage::FileSystemURL& path, + const char* data, int length) { // Create a temp file. base::FilePath temp_file; @@ -735,8 +735,8 @@ class HTML5FileWriter { } static void CreateFileForTestingOnIOThread( - fileapi::FileSystemContext* context, - const fileapi::FileSystemURL& path, + storage::FileSystemContext* context, + const storage::FileSystemURL& path, const base::FilePath& temp_file, bool* result, base::WaitableEvent* done_event) { @@ -2331,10 +2331,11 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, // Setup a file in the filesystem which we can download. ASSERT_TRUE(HTML5FileWriter::CreateFileForTesting( - BrowserContext::GetDefaultStoragePartition(browser()->profile())-> - GetFileSystemContext(), - fileapi::FileSystemURL::CreateForTest(GURL(download_url)), - kPayloadData, strlen(kPayloadData))); + BrowserContext::GetDefaultStoragePartition(browser()->profile()) + ->GetFileSystemContext(), + storage::FileSystemURL::CreateForTest(GURL(download_url)), + kPayloadData, + strlen(kPayloadData))); // Now download it. scoped_ptr<base::Value> result(RunFunctionAndReturnResult( diff --git a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc index dd6b81d..8dfa1f1 100644 --- a/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc +++ b/chrome/browser/extensions/api/file_handlers/app_file_handler_util.cc @@ -292,12 +292,14 @@ GrantedFileEntry CreateFileEntry( const base::FilePath& path, bool is_directory) { GrantedFileEntry result; - fileapi::IsolatedContext* isolated_context = - fileapi::IsolatedContext::GetInstance(); + storage::IsolatedContext* isolated_context = + storage::IsolatedContext::GetInstance(); DCHECK(isolated_context); result.filesystem_id = isolated_context->RegisterFileSystemForPath( - fileapi::kFileSystemTypeNativeForPlatformApp, std::string(), path, + storage::kFileSystemTypeNativeForPlatformApp, + std::string(), + path, &result.registered_name); content::ChildProcessSecurityPolicy* policy = @@ -344,7 +346,7 @@ bool ValidateFileEntryAndGetPath( } std::string filesystem_id; - if (!fileapi::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id)) { + if (!storage::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id)) { *error = kInvalidParameters; return false; } @@ -359,13 +361,13 @@ bool ValidateFileEntryAndGetPath( return false; } - fileapi::IsolatedContext* context = fileapi::IsolatedContext::GetInstance(); + storage::IsolatedContext* context = storage::IsolatedContext::GetInstance(); base::FilePath relative_path = base::FilePath::FromUTF8Unsafe(filesystem_path); base::FilePath virtual_path = context->CreateVirtualRootPath(filesystem_id) .Append(relative_path); - fileapi::FileSystemType type; - fileapi::FileSystemMountOption mount_option; + storage::FileSystemType type; + storage::FileSystemMountOption mount_option; std::string cracked_id; if (!context->CrackVirtualPath( virtual_path, &filesystem_id, &type, &cracked_id, file_path, @@ -377,8 +379,8 @@ bool ValidateFileEntryAndGetPath( // The file system API is only intended to operate on file entries that // correspond to a native file, selected by the user so only allow file // systems returned by the file system API or from a drag and drop operation. - if (type != fileapi::kFileSystemTypeNativeForPlatformApp && - type != fileapi::kFileSystemTypeDragged) { + if (type != storage::kFileSystemTypeNativeForPlatformApp && + type != storage::kFileSystemTypeDragged) { *error = kInvalidParameters; return false; } diff --git a/chrome/browser/extensions/api/file_handlers/mime_util.cc b/chrome/browser/extensions/api/file_handlers/mime_util.cc index 6045d57..a4594ba 100644 --- a/chrome/browser/extensions/api/file_handlers/mime_util.cc +++ b/chrome/browser/extensions/api/file_handlers/mime_util.cc @@ -153,7 +153,7 @@ MimeTypeCollector::~MimeTypeCollector() { } void MimeTypeCollector::CollectForURLs( - const std::vector<fileapi::FileSystemURL>& urls, + const std::vector<storage::FileSystemURL>& urls, const CompletionCallback& callback) { std::vector<base::FilePath> local_paths; for (size_t i = 0; i < urls.size(); ++i) { diff --git a/chrome/browser/extensions/api/file_handlers/mime_util.h b/chrome/browser/extensions/api/file_handlers/mime_util.h index 16332b8..e1bc248 100644 --- a/chrome/browser/extensions/api/file_handlers/mime_util.h +++ b/chrome/browser/extensions/api/file_handlers/mime_util.h @@ -20,9 +20,9 @@ namespace base { class FilePath; } // namespace base -namespace fileapi { +namespace storage { class FileSystemURL; -} // namespace fileapi +} // namespace storage namespace extensions { namespace app_file_handler_util { @@ -48,7 +48,7 @@ class MimeTypeCollector { // Collects all mime types asynchronously for a vector of URLs and upon // completion, calls the |callback|. It can be called only once. - void CollectForURLs(const std::vector<fileapi::FileSystemURL>& urls, + void CollectForURLs(const std::vector<storage::FileSystemURL>& urls, const CompletionCallback& callback); // Collects all mime types asynchronously for a vector of local file paths and diff --git a/chrome/browser/extensions/api/file_handlers/mime_util_unittest.cc b/chrome/browser/extensions/api/file_handlers/mime_util_unittest.cc index 626e895..bf6fd6d 100644 --- a/chrome/browser/extensions/api/file_handlers/mime_util_unittest.cc +++ b/chrome/browser/extensions/api/file_handlers/mime_util_unittest.cc @@ -38,11 +38,11 @@ void OnMimeTypesCollected(std::vector<std::string>* output, } // Creates a native local file system URL for a local path. -fileapi::FileSystemURL CreateNativeLocalFileSystemURL( - fileapi::FileSystemContext* context, +storage::FileSystemURL CreateNativeLocalFileSystemURL( + storage::FileSystemContext* context, const base::FilePath local_path) { return context->CreateCrackedFileSystemURL( - GURL(kOrigin), fileapi::kFileSystemTypeNativeLocal, local_path); + GURL(kOrigin), storage::kFileSystemTypeNativeLocal, local_path); } } // namespace @@ -65,7 +65,7 @@ class FileHandlersMimeUtilTest : public testing::Test { content::TestBrowserThreadBundle thread_bundle_; TestingProfile profile_; - scoped_refptr<fileapi::FileSystemContext> file_system_context_; + scoped_refptr<storage::FileSystemContext> file_system_context_; base::ScopedTempDir data_dir_; base::FilePath html_mime_file_path_; }; @@ -104,7 +104,7 @@ TEST_F(FileHandlersMimeUtilTest, GetMimeTypeForLocalPath) { TEST_F(FileHandlersMimeUtilTest, MimeTypeCollector_ForURLs) { MimeTypeCollector collector(&profile_); - std::vector<fileapi::FileSystemURL> urls; + std::vector<storage::FileSystemURL> urls; urls.push_back(CreateNativeLocalFileSystemURL( file_system_context_, base::FilePath::FromUTF8Unsafe(kJPEGExtensionFilePath))); diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc index 1622f15..8419930 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api.cc @@ -59,7 +59,7 @@ using apps::SavedFileEntry; using apps::SavedFilesService; using apps::AppWindow; -using fileapi::IsolatedContext; +using storage::IsolatedContext; const char kInvalidCallingPage[] = "Invalid calling page. This function can't " "be called from a background page."; @@ -349,7 +349,7 @@ bool FileSystemIsWritableEntryFunction::RunSync() { EXTENSION_FUNCTION_VALIDATE(args_->GetString(1, &filesystem_path)); std::string filesystem_id; - if (!fileapi::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id)) { + if (!storage::CrackIsolatedFileSystemName(filesystem_name, &filesystem_id)) { error_ = app_file_handler_util::kInvalidParameters; return false; } @@ -570,10 +570,10 @@ void FileSystemChooseEntryFunction::RegisterTempExternalFileSystemForTest( // For testing on Chrome OS, where to deal with remote and local paths // smoothly, all accessed paths need to be registered in the list of // external mount points. - fileapi::ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( + storage::ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( name, - fileapi::kFileSystemTypeNativeLocal, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeNativeLocal, + storage::FileSystemMountOption(), path); } diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.cc b/chrome/browser/extensions/api/page_capture/page_capture_api.cc index b342c24..37b09b5 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.cc +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.cc @@ -23,7 +23,7 @@ using content::BrowserThread; using content::ChildProcessSecurityPolicy; using content::WebContents; using extensions::PageCaptureSaveAsMHTMLFunction; -using webkit_blob::ShareableFileReference; +using storage::ShareableFileReference; namespace SaveAsMHTML = extensions::api::page_capture::SaveAsMHTML; @@ -43,7 +43,7 @@ PageCaptureSaveAsMHTMLFunction::PageCaptureSaveAsMHTMLFunction() { PageCaptureSaveAsMHTMLFunction::~PageCaptureSaveAsMHTMLFunction() { if (mhtml_file_.get()) { - webkit_blob::ShareableFileReference* to_release = mhtml_file_.get(); + storage::ShareableFileReference* to_release = mhtml_file_.get(); to_release->AddRef(); mhtml_file_ = NULL; BrowserThread::ReleaseSoon(BrowserThread::IO, FROM_HERE, to_release); diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.h b/chrome/browser/extensions/api/page_capture/page_capture_api.h index c58a781..2cfe6ad 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.h +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.h @@ -60,7 +60,7 @@ class PageCaptureSaveAsMHTMLFunction : public ChromeAsyncExtensionFunction { base::FilePath mhtml_path_; // The file containing the MHTML. - scoped_refptr<webkit_blob::ShareableFileReference> mhtml_file_; + scoped_refptr<storage::ShareableFileReference> mhtml_file_; DECLARE_EXTENSION_FUNCTION("pageCapture.saveAsMHTML", PAGECAPTURE_SAVEASMHTML) }; diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc index 25dda794..f84f129 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.cc @@ -85,7 +85,7 @@ void ExtensionSyncEventObserver::OnSyncStateUpdated( } void ExtensionSyncEventObserver::OnFileSynced( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, sync_file_system::SyncFileStatus status, sync_file_system::SyncAction action, sync_file_system::SyncDirection direction) { diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h index f94f891..73510e4 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h @@ -44,11 +44,10 @@ class ExtensionSyncEventObserver : public sync_file_system::SyncEventObserver, sync_file_system::SyncServiceState state, const std::string& description) OVERRIDE; - virtual void OnFileSynced( - const fileapi::FileSystemURL& url, - sync_file_system::SyncFileStatus status, - sync_file_system::SyncAction action, - sync_file_system::SyncDirection direction) OVERRIDE; + virtual void OnFileSynced(const storage::FileSystemURL& url, + sync_file_system::SyncFileStatus status, + sync_file_system::SyncAction action, + sync_file_system::SyncDirection direction) OVERRIDE; private: friend class BrowserContextKeyedAPIFactory<ExtensionSyncEventObserver>; diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc index 5a8177e..6181124 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.cc @@ -68,17 +68,17 @@ bool SyncFileSystemDeleteFileSystemFunction::RunAsync() { std::string url; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = BrowserContext::GetStoragePartition(GetProfile(), render_view_host()->GetSiteInstance()) ->GetFileSystemContext(); - fileapi::FileSystemURL file_system_url( + storage::FileSystemURL file_system_url( file_system_context->CrackURL(GURL(url))); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - Bind(&fileapi::FileSystemContext::DeleteFileSystem, + Bind(&storage::FileSystemContext::DeleteFileSystem, file_system_context, source_url().GetOrigin(), file_system_url.type(), @@ -120,18 +120,18 @@ bool SyncFileSystemRequestFileSystemFunction::RunAsync() { // Initializes sync context for this extension and continue to open // a new file system. - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - Bind(&fileapi::FileSystemContext::OpenFileSystem, - GetFileSystemContext(), - source_url().GetOrigin(), - fileapi::kFileSystemTypeSyncable, - fileapi::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, - base::Bind(&self::DidOpenFileSystem, this))); + BrowserThread::PostTask(BrowserThread::IO, + FROM_HERE, + Bind(&storage::FileSystemContext::OpenFileSystem, + GetFileSystemContext(), + source_url().GetOrigin(), + storage::kFileSystemTypeSyncable, + storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, + base::Bind(&self::DidOpenFileSystem, this))); return true; } -fileapi::FileSystemContext* +storage::FileSystemContext* SyncFileSystemRequestFileSystemFunction::GetFileSystemContext() { DCHECK(render_view_host()); return BrowserContext::GetStoragePartition( @@ -171,11 +171,11 @@ bool SyncFileSystemGetFileStatusFunction::RunAsync() { std::string url; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = BrowserContext::GetStoragePartition(GetProfile(), render_view_host()->GetSiteInstance()) ->GetFileSystemContext(); - fileapi::FileSystemURL file_system_url( + storage::FileSystemURL file_system_url( file_system_context->CrackURL(GURL(url))); GetSyncFileSystemService(GetProfile())->GetFileSyncStatus( @@ -211,7 +211,7 @@ bool SyncFileSystemGetFileStatusesFunction::RunAsync() { base::ListValue* file_entry_urls = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetList(0, &file_entry_urls)); - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = BrowserContext::GetStoragePartition(GetProfile(), render_view_host()->GetSiteInstance()) ->GetFileSystemContext(); @@ -226,7 +226,7 @@ bool SyncFileSystemGetFileStatusesFunction::RunAsync() { for (unsigned int i = 0; i < num_expected_results_; i++) { std::string url; file_entry_urls->GetString(i, &url); - fileapi::FileSystemURL file_system_url( + storage::FileSystemURL file_system_url( file_system_context->CrackURL(GURL(url))); sync_file_system_service->GetFileSyncStatus( @@ -239,7 +239,7 @@ bool SyncFileSystemGetFileStatusesFunction::RunAsync() { } void SyncFileSystemGetFileStatusesFunction::DidGetFileStatus( - const fileapi::FileSystemURL& file_system_url, + const storage::FileSystemURL& file_system_url, SyncStatusCode sync_status_code, SyncFileStatus sync_file_status) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -265,7 +265,7 @@ void SyncFileSystemGetFileStatusesFunction::DidGetFileStatus( base::DictionaryValue* dict = new base::DictionaryValue(); status_array->Append(dict); - fileapi::FileSystemURL url = it->first; + storage::FileSystemURL url = it->first; SyncStatusCode file_error = it->second.first; api::sync_file_system::FileStatus file_status = SyncFileStatusToExtensionEnum(it->second.second); @@ -287,14 +287,14 @@ bool SyncFileSystemGetUsageAndQuotaFunction::RunAsync() { std::string url; EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &url)); - scoped_refptr<fileapi::FileSystemContext> file_system_context = + scoped_refptr<storage::FileSystemContext> file_system_context = BrowserContext::GetStoragePartition(GetProfile(), render_view_host()->GetSiteInstance()) ->GetFileSystemContext(); - fileapi::FileSystemURL file_system_url( + storage::FileSystemURL file_system_url( file_system_context->CrackURL(GURL(url))); - scoped_refptr<quota::QuotaManager> quota_manager = + scoped_refptr<storage::QuotaManager> quota_manager = BrowserContext::GetStoragePartition(GetProfile(), render_view_host()->GetSiteInstance()) ->GetQuotaManager(); @@ -302,10 +302,10 @@ bool SyncFileSystemGetUsageAndQuotaFunction::RunAsync() { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - Bind("a::QuotaManager::GetUsageAndQuotaForWebApps, + Bind(&storage::QuotaManager::GetUsageAndQuotaForWebApps, quota_manager, source_url().GetOrigin(), - fileapi::FileSystemTypeToQuotaStorageType(file_system_url.type()), + storage::FileSystemTypeToQuotaStorageType(file_system_url.type()), Bind(&SyncFileSystemGetUsageAndQuotaFunction::DidGetUsageAndQuota, this))); @@ -313,7 +313,9 @@ bool SyncFileSystemGetUsageAndQuotaFunction::RunAsync() { } void SyncFileSystemGetUsageAndQuotaFunction::DidGetUsageAndQuota( - quota::QuotaStatusCode status, int64 usage, int64 quota) { + storage::QuotaStatusCode status, + int64 usage, + int64 quota) { // Repost to switch from IO thread to UI thread for SendResponse(). if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -326,7 +328,7 @@ void SyncFileSystemGetUsageAndQuotaFunction::DidGetUsageAndQuota( } DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (status != quota::kQuotaStatusOk) { + if (status != storage::kQuotaStatusOk) { error_ = QuotaStatusCodeToString(status); SendResponse(false); return; diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h index e16fdce..c04944a 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api.h @@ -15,7 +15,7 @@ #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/common/quota/quota_types.h" -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -67,13 +67,13 @@ class SyncFileSystemGetFileStatusesFunction private: typedef std::pair<sync_file_system::SyncStatusCode, sync_file_system::SyncFileStatus> FileStatusPair; - typedef std::map<fileapi::FileSystemURL, FileStatusPair, - fileapi::FileSystemURL::Comparator> URLToStatusMap; + typedef std::map<storage::FileSystemURL, + FileStatusPair, + storage::FileSystemURL::Comparator> URLToStatusMap; - void DidGetFileStatus( - const fileapi::FileSystemURL& file_system_url, - sync_file_system::SyncStatusCode sync_status_code, - sync_file_system::SyncFileStatus sync_file_statuses); + void DidGetFileStatus(const storage::FileSystemURL& file_system_url, + sync_file_system::SyncStatusCode sync_status_code, + sync_file_system::SyncFileStatus sync_file_statuses); unsigned int num_expected_results_; unsigned int num_results_received_; @@ -91,7 +91,7 @@ class SyncFileSystemGetUsageAndQuotaFunction virtual bool RunAsync() OVERRIDE; private: - void DidGetUsageAndQuota(quota::QuotaStatusCode status, + void DidGetUsageAndQuota(storage::QuotaStatusCode status, int64 usage, int64 quota); }; @@ -110,7 +110,7 @@ class SyncFileSystemRequestFileSystemFunction typedef SyncFileSystemRequestFileSystemFunction self; // Returns the file system context for this extension. - fileapi::FileSystemContext* GetFileSystemContext(); + storage::FileSystemContext* GetFileSystemContext(); void DidOpenFileSystem(const GURL& root_url, const std::string& file_system_name, diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.cc b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.cc index 724b689..e949823 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.cc +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.cc @@ -106,16 +106,17 @@ ConflictResolutionPolicyToExtensionEnum( } base::DictionaryValue* CreateDictionaryValueForFileSystemEntry( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, sync_file_system::SyncFileType file_type) { if (!url.is_valid() || file_type == sync_file_system::SYNC_FILE_TYPE_UNKNOWN) return NULL; - std::string file_path = base::FilePath( - fileapi::VirtualPath::GetNormalizedFilePath(url.path())).AsUTF8Unsafe(); + std::string file_path = + base::FilePath(storage::VirtualPath::GetNormalizedFilePath(url.path())) + .AsUTF8Unsafe(); - std::string root_url = fileapi::GetFileSystemRootURI( - url.origin(), url.mount_type()).spec(); + std::string root_url = + storage::GetFileSystemRootURI(url.origin(), url.mount_type()).spec(); if (!url.filesystem_id().empty()) { root_url.append(url.filesystem_id()); root_url.append("/"); @@ -123,9 +124,9 @@ base::DictionaryValue* CreateDictionaryValueForFileSystemEntry( base::DictionaryValue* dict = new base::DictionaryValue; dict->SetString("fileSystemType", - fileapi::GetFileSystemTypeString(url.mount_type())); + storage::GetFileSystemTypeString(url.mount_type())); dict->SetString("fileSystemName", - fileapi::GetFileSystemName(url.origin(), url.type())); + storage::GetFileSystemName(url.origin(), url.type())); dict->SetString("rootUrl", root_url); dict->SetString("filePath", file_path); dict->SetBoolean("isDirectory", diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.h b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.h index e2bf82c..1d0feab 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.h +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_api_helpers.h @@ -13,7 +13,7 @@ #include "chrome/browser/sync_file_system/sync_service_state.h" #include "chrome/common/extensions/api/sync_file_system.h" -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -53,7 +53,7 @@ ExtensionEnumToConflictResolutionPolicy( // This returns NULL if the given |url| is not valid or |file_type| is // SYNC_FILE_TYPE_UNKNOWN. base::DictionaryValue* CreateDictionaryValueForFileSystemEntry( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, sync_file_system::SyncFileType file_type); } // namespace extensions diff --git a/chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc b/chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc index 9877296..c76d5dc 100644 --- a/chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc +++ b/chrome/browser/extensions/api/sync_file_system/sync_file_system_apitest.cc @@ -26,7 +26,7 @@ using ::testing::Eq; using ::testing::Ne; using ::testing::Property; using ::testing::Return; -using fileapi::FileSystemURL; +using storage::FileSystemURL; using sync_file_system::MockRemoteFileSyncService; using sync_file_system::RemoteFileSyncService; using sync_file_system::SyncFileSystemServiceFactory; @@ -44,19 +44,21 @@ class SyncFileSystemApiTest : public ExtensionApiTest { ExtensionApiTest::SetUpInProcessBrowserTestFixture(); real_minimum_preserved_space_ = - quota::QuotaManager::kMinimumPreserveForSystem; - quota::QuotaManager::kMinimumPreserveForSystem = 0; + storage::QuotaManager::kMinimumPreserveForSystem; + storage::QuotaManager::kMinimumPreserveForSystem = 0; // TODO(calvinlo): Update test code after default quota is made const // (http://crbug.com/155488). - real_default_quota_ = quota::QuotaManager::kSyncableStorageDefaultHostQuota; - quota::QuotaManager::kSyncableStorageDefaultHostQuota = 123456; + real_default_quota_ = + storage::QuotaManager::kSyncableStorageDefaultHostQuota; + storage::QuotaManager::kSyncableStorageDefaultHostQuota = 123456; } virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { - quota::QuotaManager::kMinimumPreserveForSystem = + storage::QuotaManager::kMinimumPreserveForSystem = real_minimum_preserved_space_; - quota::QuotaManager::kSyncableStorageDefaultHostQuota = real_default_quota_; + storage::QuotaManager::kSyncableStorageDefaultHostQuota = + real_default_quota_; ExtensionApiTest::TearDownInProcessBrowserTestFixture(); } diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc index e947032..b0dfa85 100644 --- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc +++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc @@ -499,7 +499,7 @@ void ChromeContentBrowserClientExtensionsPart:: } void ChromeContentBrowserClientExtensionsPart::GetURLRequestAutoMountHandlers( - std::vector<fileapi::URLRequestAutoMountHandler>* handlers) { + std::vector<storage::URLRequestAutoMountHandler>* handlers) { handlers->push_back( base::Bind(MediaFileSystemBackend::AttemptAutoMountForURLRequest)); } @@ -507,7 +507,7 @@ void ChromeContentBrowserClientExtensionsPart::GetURLRequestAutoMountHandlers( void ChromeContentBrowserClientExtensionsPart::GetAdditionalFileSystemBackends( content::BrowserContext* browser_context, const base::FilePath& storage_partition_path, - ScopedVector<fileapi::FileSystemBackend>* additional_backends) { + ScopedVector<storage::FileSystemBackend>* additional_backends) { base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); additional_backends->push_back(new MediaFileSystemBackend( storage_partition_path, diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h index 2200a39..80eb5b8 100644 --- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h +++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h @@ -70,11 +70,11 @@ class ChromeContentBrowserClientExtensionsPart virtual void GetAdditionalAllowedSchemesForFileSystem( std::vector<std::string>* additional_allowed_schemes) OVERRIDE; virtual void GetURLRequestAutoMountHandlers( - std::vector<fileapi::URLRequestAutoMountHandler>* handlers) OVERRIDE; + std::vector<storage::URLRequestAutoMountHandler>* handlers) OVERRIDE; virtual void GetAdditionalFileSystemBackends( content::BrowserContext* browser_context, const base::FilePath& storage_partition_path, - ScopedVector<fileapi::FileSystemBackend>* additional_backends) OVERRIDE; + ScopedVector<storage::FileSystemBackend>* additional_backends) OVERRIDE; virtual void AppendExtraRendererCommandLineSwitches( base::CommandLine* command_line, content::RenderProcessHost* process, diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc index b45137d..8324db0 100644 --- a/chrome/browser/extensions/component_loader.cc +++ b/chrome/browser/extensions/component_loader.cc @@ -631,7 +631,7 @@ void ComponentLoader::EnableFileSystemInGuestMode(const std::string& id) { browser_context_); GURL site = content::SiteInstance::GetSiteForURL( off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); - fileapi::FileSystemContext* file_system_context = + storage::FileSystemContext* file_system_context = content::BrowserContext::GetStoragePartitionForSite( off_the_record_context, site)->GetFileSystemContext(); file_system_context->EnableTemporaryFileSystemInIncognito(); diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 895b532..3ec1c33 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -1096,9 +1096,9 @@ void ExtensionService::NotifyExtensionUnloaded( // storage partition may get destroyed only after the extension gets unloaded. GURL site = extensions::util::GetSiteForExtensionId(extension->id(), profile_); - fileapi::FileSystemContext* filesystem_context = - BrowserContext::GetStoragePartitionForSite(profile_, site)-> - GetFileSystemContext(); + storage::FileSystemContext* filesystem_context = + BrowserContext::GetStoragePartitionForSite(profile_, site) + ->GetFileSystemContext(); if (filesystem_context && filesystem_context->external_backend()) { filesystem_context->external_backend()-> RevokeAccessForExtension(extension->id()); diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index cd2db75..d297132 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -4299,7 +4299,7 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { const Extension* extension = InstallCRX(path, INSTALL_NEW); ASSERT_TRUE(extension); GURL ext_url(extension->url()); - std::string origin_id = webkit_database::GetIdentifierFromOrigin(ext_url); + std::string origin_id = storage::GetIdentifierFromOrigin(ext_url); // Set a cookie for the extension. net::CookieMonster* cookie_monster = profile() @@ -4324,7 +4324,7 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { EXPECT_EQ(1U, callback.list_.size()); // Open a database. - webkit_database::DatabaseTracker* db_tracker = + storage::DatabaseTracker* db_tracker = BrowserContext::GetDefaultStoragePartition(profile()) ->GetDatabaseTracker(); base::string16 db_name = base::UTF8ToUTF16("db"); @@ -4332,7 +4332,7 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) { int64 size; db_tracker->DatabaseOpened(origin_id, db_name, description, 1, &size); db_tracker->DatabaseClosed(origin_id, db_name); - std::vector<webkit_database::OriginInfo> origins; + std::vector<storage::OriginInfo> origins; db_tracker->GetAllOriginsInfo(&origins); EXPECT_EQ(1U, origins.size()); EXPECT_EQ(origin_id, origins[0].GetOriginIdentifier()); @@ -4407,7 +4407,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) { extensions::AppLaunchInfo::GetFullLaunchURL(extension).GetOrigin()); EXPECT_TRUE(profile()->GetExtensionSpecialStoragePolicy()->IsStorageUnlimited( origin1)); - std::string origin_id = webkit_database::GetIdentifierFromOrigin(origin1); + std::string origin_id = storage::GetIdentifierFromOrigin(origin1); // Install app2 from the same origin with unlimited storage. extension = PackAndInstallCRX(data_dir().AppendASCII("app2"), INSTALL_NEW); @@ -4447,7 +4447,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) { EXPECT_EQ(1U, callback.list_.size()); // Open a database. - webkit_database::DatabaseTracker* db_tracker = + storage::DatabaseTracker* db_tracker = BrowserContext::GetDefaultStoragePartition(profile()) ->GetDatabaseTracker(); base::string16 db_name = base::UTF8ToUTF16("db"); @@ -4455,7 +4455,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) { int64 size; db_tracker->DatabaseOpened(origin_id, db_name, description, 1, &size); db_tracker->DatabaseClosed(origin_id, db_name); - std::vector<webkit_database::OriginInfo> origins; + std::vector<storage::OriginInfo> origins; db_tracker->GetAllOriginsInfo(&origins); EXPECT_EQ(1U, origins.size()); EXPECT_EQ(origin_id, origins[0].GetOriginIdentifier()); diff --git a/chrome/browser/extensions/extension_special_storage_policy.cc b/chrome/browser/extensions/extension_special_storage_policy.cc index 6503e58..20fbf48 100644 --- a/chrome/browser/extensions/extension_special_storage_policy.cc +++ b/chrome/browser/extensions/extension_special_storage_policy.cc @@ -25,7 +25,7 @@ using content::BrowserThread; using extensions::APIPermission; using extensions::Extension; -using quota::SpecialStoragePolicy; +using storage::SpecialStoragePolicy; ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy( CookieSettings* cookie_settings) diff --git a/chrome/browser/extensions/extension_special_storage_policy.h b/chrome/browser/extensions/extension_special_storage_policy.h index aa04bd6..d7737f1 100644 --- a/chrome/browser/extensions/extension_special_storage_policy.h +++ b/chrome/browser/extensions/extension_special_storage_policy.h @@ -22,11 +22,11 @@ class Extension; // Special rights are granted to 'extensions' and 'applications'. The // storage subsystems and the browsing data remover query this interface // to determine which origins have these rights. -class ExtensionSpecialStoragePolicy : public quota::SpecialStoragePolicy { +class ExtensionSpecialStoragePolicy : public storage::SpecialStoragePolicy { public: explicit ExtensionSpecialStoragePolicy(CookieSettings* cookie_settings); - // quota::SpecialStoragePolicy methods used by storage subsystems and the + // storage::SpecialStoragePolicy methods used by storage subsystems and the // browsing data remover. These methods are safe to call on any thread. virtual bool IsStorageProtected(const GURL& origin) OVERRIDE; virtual bool IsStorageUnlimited(const GURL& origin) OVERRIDE; diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc index fd70f73..c85500d 100644 --- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc +++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc @@ -20,7 +20,7 @@ using content::BrowserThread; using extensions::Extension; using extensions::ExtensionSet; using extensions::Manifest; -using quota::SpecialStoragePolicy; +using storage::SpecialStoragePolicy; typedef SpecialStoragePolicy::StoragePolicy StoragePolicy; diff --git a/chrome/browser/extensions/extension_storage_monitor.cc b/chrome/browser/extensions/extension_storage_monitor.cc index 0574dd0..5528d76 100644 --- a/chrome/browser/extensions/extension_storage_monitor.cc +++ b/chrome/browser/extensions/extension_storage_monitor.cc @@ -46,7 +46,8 @@ namespace { const int kStorageEventRateSec = 30; // The storage type to monitor. -const quota::StorageType kMonitorStorageType = quota::kStorageTypePersistent; +const storage::StorageType kMonitorStorageType = + storage::kStorageTypePersistent; // Set the thresholds for the first notification. Ephemeral apps have a lower // threshold than installed extensions and apps. Once a threshold is exceeded, @@ -88,10 +89,9 @@ const Extension* GetExtensionById(content::BrowserContext* context, // the IO thread. When a threshold is exceeded, a message will be posted to the // UI thread, which displays the notification. class StorageEventObserver - : public base::RefCountedThreadSafe< - StorageEventObserver, - BrowserThread::DeleteOnIOThread>, - public quota::StorageObserver { + : public base::RefCountedThreadSafe<StorageEventObserver, + BrowserThread::DeleteOnIOThread>, + public storage::StorageObserver { public: explicit StorageEventObserver( base::WeakPtr<ExtensionStorageMonitor> storage_monitor) @@ -100,7 +100,7 @@ class StorageEventObserver // Register as an observer for the extension's storage events. void StartObservingForExtension( - scoped_refptr<quota::QuotaManager> quota_manager, + scoped_refptr<storage::QuotaManager> quota_manager, const std::string& extension_id, const GURL& site_url, int64 next_threshold, @@ -114,11 +114,8 @@ class StorageEventObserver state.extension_id = extension_id; state.next_threshold = next_threshold; - quota::StorageObserver::MonitorParams params( - kMonitorStorageType, - origin, - base::TimeDelta::FromSeconds(rate), - false); + storage::StorageObserver::MonitorParams params( + kMonitorStorageType, origin, base::TimeDelta::FromSeconds(rate), false); quota_manager->AddStorageObserver(this, params); } @@ -144,7 +141,7 @@ class StorageEventObserver for (OriginStorageStateMap::iterator it = origin_state_map_.begin(); it != origin_state_map_.end(); ) { if (it->second.extension_id == extension_id) { - quota::StorageObserver::Filter filter(kMonitorStorageType, it->first); + storage::StorageObserver::Filter filter(kMonitorStorageType, it->first); it->second.quota_manager->RemoveStorageObserverForFilter(this, filter); origin_state_map_.erase(it++); } else { @@ -170,7 +167,7 @@ class StorageEventObserver content::BrowserThread::IO>; struct StorageState { - scoped_refptr<quota::QuotaManager> quota_manager; + scoped_refptr<storage::QuotaManager> quota_manager; std::string extension_id; int64 next_threshold; @@ -183,7 +180,7 @@ class StorageEventObserver StopObserving(); } - // quota::StorageObserver implementation. + // storage::StorageObserver implementation. virtual void OnStorageEvent(const Event& event) OVERRIDE { OriginStorageStateMap::iterator state = origin_state_map_.find(event.filter.origin); @@ -471,7 +468,7 @@ void ExtensionStorageMonitor::StartMonitoringStorage( content::StoragePartition* storage_partition = content::BrowserContext::GetStoragePartitionForSite(context_, site_url); DCHECK(storage_partition); - scoped_refptr<quota::QuotaManager> quota_manager( + scoped_refptr<storage::QuotaManager> quota_manager( storage_partition->GetQuotaManager()); GURL storage_origin(site_url.GetOrigin()); diff --git a/chrome/browser/extensions/mock_extension_special_storage_policy.h b/chrome/browser/extensions/mock_extension_special_storage_policy.h index 0e9f021..f1b6749 100644 --- a/chrome/browser/extensions/mock_extension_special_storage_policy.h +++ b/chrome/browser/extensions/mock_extension_special_storage_policy.h @@ -13,12 +13,12 @@ // This class is the same as MockSpecialStoragePolicy (in // content/public/test/mock_special_storage_policy.h), but it inherits -// ExtensionSpecialStoragePolicy instead of quota::SpecialStoragePolicy. +// ExtensionSpecialStoragePolicy instead of storage::SpecialStoragePolicy. class MockExtensionSpecialStoragePolicy : public ExtensionSpecialStoragePolicy { public: MockExtensionSpecialStoragePolicy(); - // quota::SpecialStoragePolicy: + // storage::SpecialStoragePolicy: virtual bool IsStorageProtected(const GURL& origin) OVERRIDE; virtual bool IsStorageUnlimited(const GURL& origin) OVERRIDE; virtual bool IsStorageSessionOnly(const GURL& origin) OVERRIDE; diff --git a/chrome/browser/local_discovery/storage/privet_filesystem_async_util.cc b/chrome/browser/local_discovery/storage/privet_filesystem_async_util.cc index 41838a6..9fece15 100644 --- a/chrome/browser/local_discovery/storage/privet_filesystem_async_util.cc +++ b/chrome/browser/local_discovery/storage/privet_filesystem_async_util.cc @@ -23,8 +23,8 @@ PrivetFileSystemAsyncUtil::~PrivetFileSystemAsyncUtil() { } void PrivetFileSystemAsyncUtil::CreateOrOpen( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) { NOTIMPLEMENTED(); @@ -33,16 +33,16 @@ void PrivetFileSystemAsyncUtil::CreateOrOpen( } void PrivetFileSystemAsyncUtil::EnsureFileExists( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const EnsureFileExistsCallback& callback) { NOTIMPLEMENTED(); callback.Run(base::File::FILE_ERROR_INVALID_OPERATION, false); } void PrivetFileSystemAsyncUtil::CreateDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) { @@ -51,8 +51,8 @@ void PrivetFileSystemAsyncUtil::CreateDirectory( } void PrivetFileSystemAsyncUtil::GetFileInfo( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) { ParsedPrivetPath parsed_path(url.path()); @@ -74,8 +74,8 @@ void PrivetFileSystemAsyncUtil::GetFileInfo( } void PrivetFileSystemAsyncUtil::ReadDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) { content::BrowserThread::PostTask( content::BrowserThread::UI, @@ -86,10 +86,9 @@ void PrivetFileSystemAsyncUtil::ReadDirectory( callback)); } - void PrivetFileSystemAsyncUtil::Touch( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time, const StatusCallback& callback) { @@ -98,8 +97,8 @@ void PrivetFileSystemAsyncUtil::Touch( } void PrivetFileSystemAsyncUtil::Truncate( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int64 length, const StatusCallback& callback) { NOTIMPLEMENTED(); @@ -107,9 +106,9 @@ void PrivetFileSystemAsyncUtil::Truncate( } void PrivetFileSystemAsyncUtil::CopyFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) { @@ -118,9 +117,9 @@ void PrivetFileSystemAsyncUtil::CopyFileLocal( } void PrivetFileSystemAsyncUtil::MoveFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) { NOTIMPLEMENTED(); @@ -128,47 +127,47 @@ void PrivetFileSystemAsyncUtil::MoveFileLocal( } void PrivetFileSystemAsyncUtil::CopyInForeignFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) { NOTIMPLEMENTED(); callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); } void PrivetFileSystemAsyncUtil::DeleteFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { NOTIMPLEMENTED(); callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); } void PrivetFileSystemAsyncUtil::DeleteDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { NOTIMPLEMENTED(); callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); } void PrivetFileSystemAsyncUtil::DeleteRecursively( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { NOTIMPLEMENTED(); callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); } void PrivetFileSystemAsyncUtil::CreateSnapshotFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) { NOTIMPLEMENTED(); callback.Run(base::File::FILE_ERROR_INVALID_OPERATION, base::File::Info(), base::FilePath(), - scoped_refptr<webkit_blob::ShareableFileReference>()); + scoped_refptr<storage::ShareableFileReference>()); } } // namespace local_discovery diff --git a/chrome/browser/local_discovery/storage/privet_filesystem_async_util.h b/chrome/browser/local_discovery/storage/privet_filesystem_async_util.h index 1dd121e..b190480 100644 --- a/chrome/browser/local_discovery/storage/privet_filesystem_async_util.h +++ b/chrome/browser/local_discovery/storage/privet_filesystem_async_util.h @@ -12,78 +12,76 @@ namespace local_discovery { -class PrivetFileSystemAsyncUtil : public fileapi::AsyncFileUtil { +class PrivetFileSystemAsyncUtil : public storage::AsyncFileUtil { public: explicit PrivetFileSystemAsyncUtil(content::BrowserContext* browser_context); virtual ~PrivetFileSystemAsyncUtil(); virtual void CreateOrOpen( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) OVERRIDE; virtual void EnsureFileExists( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const EnsureFileExistsCallback& callback) OVERRIDE; virtual void CreateDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) OVERRIDE; virtual void GetFileInfo( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) OVERRIDE; virtual void ReadDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; - virtual void Touch( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - const base::Time& last_access_time, - const base::Time& last_modified_time, - const StatusCallback& callback) OVERRIDE; - virtual void Truncate( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - int64 length, - const StatusCallback& callback) OVERRIDE; + virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + const base::Time& last_access_time, + const base::Time& last_modified_time, + const StatusCallback& callback) OVERRIDE; + virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + int64 length, + const StatusCallback& callback) OVERRIDE; virtual void CopyFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) OVERRIDE; virtual void MoveFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) OVERRIDE; virtual void CopyInForeignFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) OVERRIDE; virtual void DeleteFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteRecursively( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void CreateSnapshotFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) OVERRIDE; private: diff --git a/chrome/browser/local_discovery/storage/privet_filesystem_backend.cc b/chrome/browser/local_discovery/storage/privet_filesystem_backend.cc index 77214a1..7ec937c 100644 --- a/chrome/browser/local_discovery/storage/privet_filesystem_backend.cc +++ b/chrome/browser/local_discovery/storage/privet_filesystem_backend.cc @@ -14,7 +14,7 @@ namespace local_discovery { PrivetFileSystemBackend::PrivetFileSystemBackend( - fileapi::ExternalMountPoints* mount_points, + storage::ExternalMountPoints* mount_points, content::BrowserContext* browser_context) : mount_points_(mount_points), async_util_(new PrivetFileSystemAsyncUtil(browser_context)) { @@ -24,81 +24,82 @@ PrivetFileSystemBackend::~PrivetFileSystemBackend() { } bool PrivetFileSystemBackend::CanHandleType( - fileapi::FileSystemType type) const { - return (type == fileapi::kFileSystemTypeCloudDevice); + storage::FileSystemType type) const { + return (type == storage::kFileSystemTypeCloudDevice); } -void PrivetFileSystemBackend::Initialize(fileapi::FileSystemContext* context) { - mount_points_->RegisterFileSystem( - "privet", - fileapi::kFileSystemTypeCloudDevice, - fileapi::FileSystemMountOption(), - base::FilePath(kPrivetFilePath)); +void PrivetFileSystemBackend::Initialize(storage::FileSystemContext* context) { + mount_points_->RegisterFileSystem("privet", + storage::kFileSystemTypeCloudDevice, + storage::FileSystemMountOption(), + base::FilePath(kPrivetFilePath)); } void PrivetFileSystemBackend::ResolveURL( - const fileapi::FileSystemURL& url, - fileapi::OpenFileSystemMode mode, + const storage::FileSystemURL& url, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback) { // TODO(noamsml): Provide a proper root url and a proper name. GURL root_url = GURL( - fileapi::GetExternalFileSystemRootURIString(url.origin(), std::string())); + storage::GetExternalFileSystemRootURIString(url.origin(), std::string())); callback.Run(root_url, std::string(), base::File::FILE_OK); } -fileapi::FileSystemQuotaUtil* PrivetFileSystemBackend::GetQuotaUtil() { +storage::FileSystemQuotaUtil* PrivetFileSystemBackend::GetQuotaUtil() { // No quota support. return NULL; } -fileapi::AsyncFileUtil* PrivetFileSystemBackend::GetAsyncFileUtil( - fileapi::FileSystemType type) { +storage::AsyncFileUtil* PrivetFileSystemBackend::GetAsyncFileUtil( + storage::FileSystemType type) { return async_util_.get(); } -fileapi::CopyOrMoveFileValidatorFactory* +storage::CopyOrMoveFileValidatorFactory* PrivetFileSystemBackend::GetCopyOrMoveFileValidatorFactory( - fileapi::FileSystemType type, base::File::Error* error_code) { + storage::FileSystemType type, + base::File::Error* error_code) { DCHECK(error_code); *error_code = base::File::FILE_OK; return NULL; } -fileapi::FileSystemOperation* +storage::FileSystemOperation* PrivetFileSystemBackend::CreateFileSystemOperation( - const fileapi::FileSystemURL& url, - fileapi::FileSystemContext* context, + const storage::FileSystemURL& url, + storage::FileSystemContext* context, base::File::Error* error_code) const { - return fileapi::FileSystemOperation::Create( - url, context, - make_scoped_ptr(new fileapi::FileSystemOperationContext(context))); + return storage::FileSystemOperation::Create( + url, + context, + make_scoped_ptr(new storage::FileSystemOperationContext(context))); } bool PrivetFileSystemBackend::SupportsStreaming( - const fileapi::FileSystemURL& url) const { + const storage::FileSystemURL& url) const { return false; } bool PrivetFileSystemBackend::HasInplaceCopyImplementation( - fileapi::FileSystemType type) const { + storage::FileSystemType type) const { return true; } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> PrivetFileSystemBackend::CreateFileStreamReader( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) const { - return scoped_ptr<webkit_blob::FileStreamReader>(); + storage::FileSystemContext* context) const { + return scoped_ptr<storage::FileStreamReader>(); } -scoped_ptr<fileapi::FileStreamWriter> +scoped_ptr<storage::FileStreamWriter> PrivetFileSystemBackend::CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) const { - return scoped_ptr<fileapi::FileStreamWriter>(); + storage::FileSystemContext* context) const { + return scoped_ptr<storage::FileStreamWriter>(); } } // namespace local_discovery diff --git a/chrome/browser/local_discovery/storage/privet_filesystem_backend.h b/chrome/browser/local_discovery/storage/privet_filesystem_backend.h index 67026f5..e368a9f 100644 --- a/chrome/browser/local_discovery/storage/privet_filesystem_backend.h +++ b/chrome/browser/local_discovery/storage/privet_filesystem_backend.h @@ -19,54 +19,53 @@ namespace local_discovery { class PrivetFileSystemAsyncUtil; -class PrivetFileSystemBackend : public fileapi::FileSystemBackend { +class PrivetFileSystemBackend : public storage::FileSystemBackend { public: - PrivetFileSystemBackend(fileapi::ExternalMountPoints* mount_points, + PrivetFileSystemBackend(storage::ExternalMountPoints* mount_points, content::BrowserContext* browser_context); virtual ~PrivetFileSystemBackend(); // FileSystemBackend implementation. - virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; - virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE; + virtual bool CanHandleType(storage::FileSystemType type) const OVERRIDE; + virtual void Initialize(storage::FileSystemContext* context) OVERRIDE; - virtual void ResolveURL(const fileapi::FileSystemURL& url, - fileapi::OpenFileSystemMode mode, + virtual void ResolveURL(const storage::FileSystemURL& url, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback) OVERRIDE; - virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( - fileapi::FileSystemType type) OVERRIDE; - virtual fileapi::CopyOrMoveFileValidatorFactory* - GetCopyOrMoveFileValidatorFactory( - fileapi::FileSystemType type, - base::File::Error* error_code) OVERRIDE; + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE; + virtual storage::CopyOrMoveFileValidatorFactory* + GetCopyOrMoveFileValidatorFactory(storage::FileSystemType type, + base::File::Error* error_code) OVERRIDE; - virtual fileapi::FileSystemOperation* CreateFileSystemOperation( - const fileapi::FileSystemURL& url, - fileapi::FileSystemContext* context, + virtual storage::FileSystemOperation* CreateFileSystemOperation( + const storage::FileSystemURL& url, + storage::FileSystemContext* context, base::File::Error* error_code) const OVERRIDE; virtual bool SupportsStreaming( - const fileapi::FileSystemURL& url) const OVERRIDE; + const storage::FileSystemURL& url) const OVERRIDE; virtual bool HasInplaceCopyImplementation( - fileapi::FileSystemType type) const OVERRIDE; + storage::FileSystemType type) const OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( - const fileapi::FileSystemURL& url, + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) const OVERRIDE; + storage::FileSystemContext* context) const OVERRIDE; - virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) const OVERRIDE; + storage::FileSystemContext* context) const OVERRIDE; - virtual fileapi::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; + virtual storage::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; private: // User mount points. - scoped_refptr<fileapi::ExternalMountPoints> mount_points_; + scoped_refptr<storage::ExternalMountPoints> mount_points_; scoped_ptr<PrivetFileSystemAsyncUtil> async_util_; }; diff --git a/chrome/browser/local_discovery/storage/privet_filesystem_operations.cc b/chrome/browser/local_discovery/storage/privet_filesystem_operations.cc index 66f1447..1439218 100644 --- a/chrome/browser/local_discovery/storage/privet_filesystem_operations.cc +++ b/chrome/browser/local_discovery/storage/privet_filesystem_operations.cc @@ -18,8 +18,8 @@ PrivetFileSystemOperationFactory::~PrivetFileSystemOperationFactory() { } void PrivetFileSystemOperationFactory::GetFileInfo( - const fileapi::FileSystemURL& url, - const fileapi::AsyncFileUtil::GetFileInfoCallback& callback) { + const storage::FileSystemURL& url, + const storage::AsyncFileUtil::GetFileInfoCallback& callback) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); PrivetFileSystemAsyncOperation* operation = new PrivetFileSystemDetailsOperation( @@ -29,8 +29,8 @@ void PrivetFileSystemOperationFactory::GetFileInfo( } void PrivetFileSystemOperationFactory::ReadDirectory( - const fileapi::FileSystemURL& url, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) { + const storage::FileSystemURL& url, + const storage::AsyncFileUtil::ReadDirectoryCallback& callback) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); PrivetFileSystemAsyncOperation* operation = new PrivetFileSystemListOperation( url.path(), browser_context_, this, &attribute_cache_, callback); @@ -109,7 +109,7 @@ PrivetFileSystemListOperation::PrivetFileSystemListOperation( content::BrowserContext* browser_context, PrivetFileSystemAsyncOperationContainer* container, PrivetFileSystemAttributeCache* attribute_cache, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback) + const storage::AsyncFileUtil::ReadDirectoryCallback& callback) : core_(full_path, browser_context, this), full_path_(full_path), container_(container), @@ -155,7 +155,7 @@ void PrivetFileSystemListOperation::OnStorageListResult( attribute_cache_->AddFileInfoFromJSON(full_path_, value); - fileapi::AsyncFileUtil::EntryList entry_list; + storage::AsyncFileUtil::EntryList entry_list; const base::ListValue* entries; if (!value->GetList(kPrivetListEntries, &entries)) { @@ -178,12 +178,12 @@ void PrivetFileSystemListOperation::OnStorageListResult( entry_value->GetString(kPrivetListKeyType, &type); entry_value->GetInteger(kPrivetListKeySize, &size); - fileapi::DirectoryEntry entry( - name, - (type == kPrivetListTypeDir) ? - fileapi::DirectoryEntry::DIRECTORY : fileapi::DirectoryEntry::FILE, - size, - base::Time() /* TODO(noamsml) */); + storage::DirectoryEntry entry(name, + (type == kPrivetListTypeDir) + ? storage::DirectoryEntry::DIRECTORY + : storage::DirectoryEntry::FILE, + size, + base::Time() /* TODO(noamsml) */); entry_list.push_back(entry); } @@ -194,13 +194,13 @@ void PrivetFileSystemListOperation::OnStorageListResult( void PrivetFileSystemListOperation::SignalError() { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); TriggerCallbackAndDestroy(base::File::FILE_ERROR_FAILED, - fileapi::AsyncFileUtil::EntryList(), + storage::AsyncFileUtil::EntryList(), false); } void PrivetFileSystemListOperation::TriggerCallbackAndDestroy( base::File::Error result, - const fileapi::AsyncFileUtil::EntryList& file_list, + const storage::AsyncFileUtil::EntryList& file_list, bool has_more) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); content::BrowserThread::PostTask( @@ -215,7 +215,7 @@ PrivetFileSystemDetailsOperation::PrivetFileSystemDetailsOperation( content::BrowserContext* browser_context, PrivetFileSystemAsyncOperationContainer* container, PrivetFileSystemAttributeCache* attribute_cache, - const fileapi::AsyncFileUtil::GetFileInfoCallback& callback) + const storage::AsyncFileUtil::GetFileInfoCallback& callback) : core_(full_path, browser_context, this), full_path_(full_path), container_(container), diff --git a/chrome/browser/local_discovery/storage/privet_filesystem_operations.h b/chrome/browser/local_discovery/storage/privet_filesystem_operations.h index 6701db4..c1a92b5 100644 --- a/chrome/browser/local_discovery/storage/privet_filesystem_operations.h +++ b/chrome/browser/local_discovery/storage/privet_filesystem_operations.h @@ -44,11 +44,11 @@ class PrivetFileSystemOperationFactory content::BrowserContext* browser_context); virtual ~PrivetFileSystemOperationFactory(); - void GetFileInfo(const fileapi::FileSystemURL& url, - const fileapi::AsyncFileUtil::GetFileInfoCallback& callback); + void GetFileInfo(const storage::FileSystemURL& url, + const storage::AsyncFileUtil::GetFileInfoCallback& callback); void ReadDirectory( - const fileapi::FileSystemURL& url, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback); + const storage::FileSystemURL& url, + const storage::AsyncFileUtil::ReadDirectoryCallback& callback); base::WeakPtr<PrivetFileSystemOperationFactory> GetWeakPtr() { return weak_factory_.GetWeakPtr(); @@ -114,7 +114,7 @@ class PrivetFileSystemListOperation content::BrowserContext* browser_context, PrivetFileSystemAsyncOperationContainer* container, PrivetFileSystemAttributeCache* attribute_cache, - const fileapi::AsyncFileUtil::ReadDirectoryCallback& callback); + const storage::AsyncFileUtil::ReadDirectoryCallback& callback); virtual ~PrivetFileSystemListOperation(); virtual void Start() OVERRIDE; @@ -127,14 +127,14 @@ class PrivetFileSystemListOperation void SignalError(); void TriggerCallbackAndDestroy( base::File::Error result, - const fileapi::AsyncFileUtil::EntryList& file_list, + const storage::AsyncFileUtil::EntryList& file_list, bool has_more); PrivetFileSystemAsyncOperationUtil core_; base::FilePath full_path_; PrivetFileSystemAsyncOperationContainer* container_; PrivetFileSystemAttributeCache* attribute_cache_; - fileapi::AsyncFileUtil::ReadDirectoryCallback callback_; + storage::AsyncFileUtil::ReadDirectoryCallback callback_; scoped_ptr<PrivetJSONOperation> list_operation_; }; @@ -148,7 +148,7 @@ class PrivetFileSystemDetailsOperation content::BrowserContext* browser_context, PrivetFileSystemAsyncOperationContainer* container, PrivetFileSystemAttributeCache* attribute_cache, - const fileapi::AsyncFileUtil::GetFileInfoCallback& callback); + const storage::AsyncFileUtil::GetFileInfoCallback& callback); virtual ~PrivetFileSystemDetailsOperation(); virtual void Start() OVERRIDE; @@ -166,7 +166,7 @@ class PrivetFileSystemDetailsOperation base::FilePath full_path_; PrivetFileSystemAsyncOperationContainer* container_; PrivetFileSystemAttributeCache* attribute_cache_; - fileapi::AsyncFileUtil::GetFileInfoCallback callback_; + storage::AsyncFileUtil::GetFileInfoCallback callback_; scoped_ptr<PrivetJSONOperation> list_operation_; }; diff --git a/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h b/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h index b148c29..fc1ee60 100644 --- a/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h +++ b/chrome/browser/media_galleries/fileapi/av_scanning_file_validator.h @@ -13,7 +13,7 @@ class FilePath; } // namespace base // This class supports AV scanning on post write validation. -class AVScanningFileValidator : public fileapi::CopyOrMoveFileValidator { +class AVScanningFileValidator : public storage::CopyOrMoveFileValidator { public: virtual ~AVScanningFileValidator(); diff --git a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc index 769b069..7dd94e0 100644 --- a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc @@ -22,10 +22,10 @@ #include "webkit/browser/fileapi/native_file_util.h" #include "webkit/common/blob/shareable_file_reference.h" -using fileapi::AsyncFileUtil; -using fileapi::FileSystemOperationContext; -using fileapi::FileSystemURL; -using webkit_blob::ShareableFileReference; +using storage::AsyncFileUtil; +using storage::FileSystemOperationContext; +using storage::FileSystemURL; +using storage::ShareableFileReference; namespace { @@ -104,7 +104,7 @@ base::FilePath CreateSnapshotFileOnBlockingPool( void OnDidCheckMediaForCreateSnapshotFile( const AsyncFileUtil::CreateSnapshotFileCallback& callback, const base::File::Info& file_info, - scoped_refptr<webkit_blob::ShareableFileReference> platform_file, + scoped_refptr<storage::ShareableFileReference> platform_file, base::File::Error error) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); base::FilePath platform_path(platform_file.get()->path()); @@ -123,7 +123,7 @@ void OnDidCreateSnapshotFile( const base::File::Info& file_info, const base::FilePath& platform_path) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - scoped_refptr<webkit_blob::ShareableFileReference> file = + scoped_refptr<storage::ShareableFileReference> file = ShareableFileReference::GetOrCreate( platform_path, ShareableFileReference::DELETE_ON_FINAL_RELEASE, @@ -224,7 +224,7 @@ DeviceMediaAsyncFileUtil::MediaPathFilterWrapper::FilterMediaEntries( const AsyncFileUtil::EntryList& file_list) { AsyncFileUtil::EntryList results; for (size_t i = 0; i < file_list.size(); ++i) { - const fileapi::DirectoryEntry& entry = file_list[i]; + const storage::DirectoryEntry& entry = file_list[i]; if (entry.is_directory || CheckFilePath(base::FilePath(entry.name))) { results.push_back(entry); } @@ -250,7 +250,7 @@ scoped_ptr<DeviceMediaAsyncFileUtil> DeviceMediaAsyncFileUtil::Create( } bool DeviceMediaAsyncFileUtil::SupportsStreaming( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); MTPDeviceAsyncDelegate* delegate = GetMTPDeviceDelegate(url); if (!delegate) @@ -442,24 +442,23 @@ void DeviceMediaAsyncFileUtil::CreateSnapshotFile( validate_media_files())); } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> DeviceMediaAsyncFileUtil::GetFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) { + storage::FileSystemContext* context) { MTPDeviceAsyncDelegate* delegate = GetMTPDeviceDelegate(url); if (!delegate) - return scoped_ptr<webkit_blob::FileStreamReader>(); + return scoped_ptr<storage::FileStreamReader>(); DCHECK(delegate->IsStreaming()); - return scoped_ptr<webkit_blob::FileStreamReader>( - new ReadaheadFileStreamReader( - new MTPFileStreamReader(context, - url, - offset, - expected_modification_time, - validate_media_files()))); + return scoped_ptr<storage::FileStreamReader>(new ReadaheadFileStreamReader( + new MTPFileStreamReader(context, + url, + offset, + expected_modification_time, + validate_media_files()))); } DeviceMediaAsyncFileUtil::DeviceMediaAsyncFileUtil( diff --git a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h index a68f58b..9609126 100644 --- a/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h +++ b/chrome/browser/media_galleries/fileapi/device_media_async_file_util.h @@ -13,12 +13,12 @@ #include "webkit/browser/fileapi/async_file_util.h" #include "webkit/common/blob/shareable_file_reference.h" -namespace fileapi { +namespace storage { class FileSystemOperationContext; class FileSystemURL; } -namespace webkit_blob { +namespace storage { class FileStreamReader; } @@ -27,7 +27,7 @@ enum MediaFileValidationType { APPLY_MEDIA_FILE_VALIDATION, }; -class DeviceMediaAsyncFileUtil : public fileapi::AsyncFileUtil { +class DeviceMediaAsyncFileUtil : public storage::AsyncFileUtil { public: virtual ~DeviceMediaAsyncFileUtil(); @@ -36,76 +36,74 @@ class DeviceMediaAsyncFileUtil : public fileapi::AsyncFileUtil { const base::FilePath& profile_path, MediaFileValidationType validation_type); - bool SupportsStreaming(const fileapi::FileSystemURL& url); + bool SupportsStreaming(const storage::FileSystemURL& url); // AsyncFileUtil overrides. virtual void CreateOrOpen( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) OVERRIDE; virtual void EnsureFileExists( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const EnsureFileExistsCallback& callback) OVERRIDE; virtual void CreateDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) OVERRIDE; virtual void GetFileInfo( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) OVERRIDE; virtual void ReadDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; - virtual void Touch( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - const base::Time& last_access_time, - const base::Time& last_modified_time, - const StatusCallback& callback) OVERRIDE; - virtual void Truncate( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - int64 length, - const StatusCallback& callback) OVERRIDE; + virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + const base::Time& last_access_time, + const base::Time& last_modified_time, + const StatusCallback& callback) OVERRIDE; + virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + int64 length, + const StatusCallback& callback) OVERRIDE; virtual void CopyFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) OVERRIDE; virtual void MoveFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) OVERRIDE; virtual void CopyInForeignFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) OVERRIDE; virtual void DeleteFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteRecursively( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void CreateSnapshotFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) OVERRIDE; // This method is called when existing Blobs are read. @@ -113,11 +111,11 @@ class DeviceMediaAsyncFileUtil : public fileapi::AsyncFileUtil { // underlying storage. The returned FileStreamReader must return an error // when the state of the underlying storage changes. Any errors associated // with reading this file are returned by the FileStreamReader itself. - virtual scoped_ptr<webkit_blob::FileStreamReader> GetFileStreamReader( - const fileapi::FileSystemURL& url, + virtual scoped_ptr<storage::FileStreamReader> GetFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context); + storage::FileSystemContext* context); private: class MediaPathFilterWrapper; diff --git a/chrome/browser/media_galleries/fileapi/iphoto_file_util.cc b/chrome/browser/media_galleries/fileapi/iphoto_file_util.cc index e54c3bb..2b5f805 100644 --- a/chrome/browser/media_galleries/fileapi/iphoto_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/iphoto_file_util.cc @@ -23,7 +23,7 @@ #include "webkit/common/fileapi/directory_entry.h" #include "webkit/common/fileapi/file_system_util.h" -using fileapi::DirectoryEntry; +using storage::DirectoryEntry; namespace iphoto { @@ -48,7 +48,7 @@ bool ContainsElement(const std::vector<T>& collection, const T& key) { } std::vector<std::string> GetVirtualPathComponents( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { ImportedMediaGalleryRegistry* imported_registry = ImportedMediaGalleryRegistry::GetInstance(); base::FilePath root = imported_registry->ImportedRoot().AppendASCII("iphoto"); @@ -58,7 +58,7 @@ std::vector<std::string> GetVirtualPathComponents( root.AppendRelativePath(url.path(), &virtual_path); std::vector<std::string> result; - fileapi::VirtualPath::GetComponentsUTF8Unsafe(virtual_path, &result); + storage::VirtualPath::GetComponentsUTF8Unsafe(virtual_path, &result); return result; } @@ -77,8 +77,8 @@ IPhotoFileUtil::~IPhotoFileUtil() { } void IPhotoFileUtil::GetFileInfoOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) { IPhotoDataProvider* data_provider = GetDataProvider(); // |data_provider| may be NULL if the file system was revoked before this @@ -94,8 +94,8 @@ void IPhotoFileUtil::GetFileInfoOnTaskRunnerThread( } void IPhotoFileUtil::ReadDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) { IPhotoDataProvider* data_provider = GetDataProvider(); // |data_provider| may be NULL if the file system was revoked before this @@ -111,8 +111,8 @@ void IPhotoFileUtil::ReadDirectoryOnTaskRunnerThread( } void IPhotoFileUtil::CreateSnapshotFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) { IPhotoDataProvider* data_provider = GetDataProvider(); // |data_provider| may be NULL if the file system was revoked before this @@ -129,8 +129,8 @@ void IPhotoFileUtil::CreateSnapshotFileOnTaskRunnerThread( } void IPhotoFileUtil::GetFileInfoWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback, bool valid_parse) { if (!valid_parse) { @@ -147,8 +147,8 @@ void IPhotoFileUtil::GetFileInfoWithFreshDataProvider( } void IPhotoFileUtil::ReadDirectoryWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback, bool valid_parse) { if (!valid_parse) { @@ -165,15 +165,15 @@ void IPhotoFileUtil::ReadDirectoryWithFreshDataProvider( } void IPhotoFileUtil::CreateSnapshotFileWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback, bool valid_parse) { if (!valid_parse) { if (!callback.is_null()) { base::File::Info file_info; base::FilePath platform_path; - scoped_refptr<webkit_blob::ShareableFileReference> file_ref; + scoped_refptr<storage::ShareableFileReference> file_ref; content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, @@ -189,8 +189,8 @@ void IPhotoFileUtil::CreateSnapshotFileWithFreshDataProvider( // Begin actual implementation. base::File::Error IPhotoFileUtil::GetFileInfoSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path) { std::vector<std::string> components = GetVirtualPathComponents(url); @@ -238,8 +238,8 @@ base::File::Error IPhotoFileUtil::GetFileInfoSync( } base::File::Error IPhotoFileUtil::ReadDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, EntryList* file_list) { DCHECK(file_list->empty()); std::vector<std::string> components = GetVirtualPathComponents(url); @@ -309,21 +309,20 @@ base::File::Error IPhotoFileUtil::ReadDirectorySync( } base::File::Error IPhotoFileUtil::DeleteDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) { + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) { return base::File::FILE_ERROR_SECURITY; } base::File::Error IPhotoFileUtil::DeleteFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) { + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) { return base::File::FILE_ERROR_SECURITY; } - base::File::Error IPhotoFileUtil::GetLocalFilePath( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::FilePath* local_file_path) { std::vector<std::string> components = GetVirtualPathComponents(url); diff --git a/chrome/browser/media_galleries/fileapi/iphoto_file_util.h b/chrome/browser/media_galleries/fileapi/iphoto_file_util.h index 421373f..ad5a8c3 100644 --- a/chrome/browser/media_galleries/fileapi/iphoto_file_util.h +++ b/chrome/browser/media_galleries/fileapi/iphoto_file_util.h @@ -37,51 +37,51 @@ class IPhotoFileUtil : public NativeMediaFileUtil { protected: // NativeMediaFileUtil overrides. virtual void GetFileInfoOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) OVERRIDE; virtual void ReadDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; virtual void CreateSnapshotFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) OVERRIDE; virtual base::File::Error GetFileInfoSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path) OVERRIDE; virtual base::File::Error ReadDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, EntryList* file_list) OVERRIDE; virtual base::File::Error DeleteDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) OVERRIDE; + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) OVERRIDE; virtual base::File::Error DeleteFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) OVERRIDE; + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) OVERRIDE; virtual base::File::Error GetLocalFilePath( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::FilePath* local_file_path) OVERRIDE; private: void GetFileInfoWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback, bool valid_parse); void ReadDirectoryWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback, bool valid_parse); virtual void CreateSnapshotFileWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback, bool valid_parse); diff --git a/chrome/browser/media_galleries/fileapi/iphoto_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/iphoto_file_util_unittest.cc index 13c7fb1..328d8bd 100644 --- a/chrome/browser/media_galleries/fileapi/iphoto_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/iphoto_file_util_unittest.cc @@ -30,9 +30,9 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" -using fileapi::FileSystemOperationContext; -using fileapi::FileSystemOperation; -using fileapi::FileSystemURL; +using storage::FileSystemOperationContext; +using storage::FileSystemOperation; +using storage::FileSystemURL; namespace iphoto { @@ -51,7 +51,7 @@ void ReadDirectoryTestHelperCallback( run_loop->Quit(); } -void ReadDirectoryTestHelper(fileapi::FileSystemOperationRunner* runner, +void ReadDirectoryTestHelper(storage::FileSystemOperationRunner* runner, const FileSystemURL& url, FileSystemOperation::FileEntryList* contents, bool* completed) { @@ -146,16 +146,16 @@ class TestMediaFileSystemBackend : public MediaFileSystemBackend { MediaFileSystemBackend::MediaTaskRunner().get()), test_file_util_(iphoto_file_util) {} - virtual fileapi::AsyncFileUtil* - GetAsyncFileUtil(fileapi::FileSystemType type) OVERRIDE { - if (type != fileapi::kFileSystemTypeIphoto) + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE { + if (type != storage::kFileSystemTypeIphoto) return NULL; return test_file_util_.get(); } private: - scoped_ptr<fileapi::AsyncFileUtil> test_file_util_; + scoped_ptr<storage::AsyncFileUtil> test_file_util_; }; class IPhotoFileUtilTest : public testing::Test { @@ -188,7 +188,7 @@ class IPhotoFileUtilTest : public testing::Test { ASSERT_TRUE(profile_dir_.CreateUniqueTempDir()); ImportedMediaGalleryRegistry::GetInstance()->Initialize(); - scoped_refptr<quota::SpecialStoragePolicy> storage_policy = + scoped_refptr<storage::SpecialStoragePolicy> storage_policy = new content::MockSpecialStoragePolicy(); // Initialize fake IPhotoDataProvider on media task runner thread. @@ -203,20 +203,20 @@ class IPhotoFileUtilTest : public testing::Test { event.Wait(); media_path_filter_.reset(new MediaPathFilter()); - ScopedVector<fileapi::FileSystemBackend> additional_providers; + ScopedVector<storage::FileSystemBackend> additional_providers; additional_providers.push_back(new TestMediaFileSystemBackend( profile_dir_.path(), new TestIPhotoFileUtil(media_path_filter_.get(), iphoto_data_provider_.get()))); - file_system_context_ = new fileapi::FileSystemContext( + file_system_context_ = new storage::FileSystemContext( base::MessageLoopProxy::current().get(), base::MessageLoopProxy::current().get(), - fileapi::ExternalMountPoints::CreateRefCounted().get(), + storage::ExternalMountPoints::CreateRefCounted().get(), storage_policy.get(), NULL, additional_providers.Pass(), - std::vector<fileapi::URLRequestAutoMountHandler>(), + std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(), content::CreateAllowFileAccessOptions()); } @@ -237,15 +237,16 @@ class IPhotoFileUtilTest : public testing::Test { virtual_path = virtual_path.AppendASCII("iphoto"); virtual_path = virtual_path.AppendASCII(path); return file_system_context_->CreateCrackedFileSystemURL( - GURL("http://www.example.com"), fileapi::kFileSystemTypeIphoto, + GURL("http://www.example.com"), + storage::kFileSystemTypeIphoto, virtual_path); } - fileapi::FileSystemOperationRunner* operation_runner() const { + storage::FileSystemOperationRunner* operation_runner() const { return file_system_context_->operation_runner(); } - scoped_refptr<fileapi::FileSystemContext> file_system_context() const { + scoped_refptr<storage::FileSystemContext> file_system_context() const { return file_system_context_; } @@ -260,7 +261,7 @@ class IPhotoFileUtilTest : public testing::Test { base::ScopedTempDir profile_dir_; base::ScopedTempDir fake_library_dir_; - scoped_refptr<fileapi::FileSystemContext> file_system_context_; + scoped_refptr<storage::FileSystemContext> file_system_context_; scoped_ptr<MediaPathFilter> media_path_filter_; scoped_ptr<TestIPhotoDataProvider> iphoto_data_provider_; diff --git a/chrome/browser/media_galleries/fileapi/itunes_data_provider.cc b/chrome/browser/media_galleries/fileapi/itunes_data_provider.cc index c485df9..e095551 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_data_provider.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_data_provider.cc @@ -96,7 +96,7 @@ bool CheckLocaleStringAutoAddPath( base::FilePath localized_auto_add_path = media_path.Append(base::FilePath::FromUTF8Unsafe(it->second)); - if (!fileapi::NativeFileUtil::DirectoryExists(localized_auto_add_path)) + if (!storage::NativeFileUtil::DirectoryExists(localized_auto_add_path)) return false; *result_path = localized_auto_add_path; @@ -113,7 +113,7 @@ base::FilePath GetAutoAddPath(const base::FilePath& library_path) { // Test 'universal' path first. base::FilePath universal_auto_add_path = media_path.AppendASCII("Automatically Add to iTunes.localized"); - if (fileapi::NativeFileUtil::DirectoryExists(universal_auto_add_path)) + if (storage::NativeFileUtil::DirectoryExists(universal_auto_add_path)) return universal_auto_add_path; // Test user locale. Localized directory names encoded in UTF-8. diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util.cc b/chrome/browser/media_galleries/fileapi/itunes_file_util.cc index 27c94a1..3bbe037 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_file_util.cc @@ -21,7 +21,7 @@ #include "webkit/common/blob/shareable_file_reference.h" #include "webkit/common/fileapi/file_system_util.h" -using fileapi::DirectoryEntry; +using storage::DirectoryEntry; namespace itunes { @@ -35,7 +35,7 @@ base::File::Error MakeDirectoryFileInfo(base::File::Info* file_info) { } std::vector<std::string> GetVirtualPathComponents( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { ImportedMediaGalleryRegistry* imported_registry = ImportedMediaGalleryRegistry::GetInstance(); base::FilePath root = imported_registry->ImportedRoot().AppendASCII("itunes"); @@ -45,7 +45,7 @@ std::vector<std::string> GetVirtualPathComponents( root.AppendRelativePath(url.path(), &virtual_path); std::vector<std::string> result; - fileapi::VirtualPath::GetComponentsUTF8Unsafe(virtual_path, &result); + storage::VirtualPath::GetComponentsUTF8Unsafe(virtual_path, &result); return result; } @@ -66,8 +66,8 @@ ITunesFileUtil::~ITunesFileUtil() { } void ITunesFileUtil::GetFileInfoOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) { ITunesDataProvider* data_provider = GetDataProvider(); // |data_provider| may be NULL if the file system was revoked before this @@ -83,8 +83,8 @@ void ITunesFileUtil::GetFileInfoOnTaskRunnerThread( } void ITunesFileUtil::ReadDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) { ITunesDataProvider* data_provider = GetDataProvider(); // |data_provider| may be NULL if the file system was revoked before this @@ -100,8 +100,8 @@ void ITunesFileUtil::ReadDirectoryOnTaskRunnerThread( } void ITunesFileUtil::CreateSnapshotFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) { ITunesDataProvider* data_provider = GetDataProvider(); // |data_provider| may be NULL if the file system was revoked before this @@ -124,8 +124,8 @@ void ITunesFileUtil::CreateSnapshotFileOnTaskRunnerThread( // /iTunes Media/Music/<Artist>/<Album>/<Track> - tracks // base::File::Error ITunesFileUtil::GetFileInfoSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path) { std::vector<std::string> components = GetVirtualPathComponents(url); @@ -140,7 +140,7 @@ base::File::Error ITunesFileUtil::GetFileInfoSync( base::FilePath file_path = GetDataProvider()->library_path(); if (platform_path) *platform_path = file_path; - return fileapi::NativeFileUtil::GetFileInfo(file_path, file_info); + return storage::NativeFileUtil::GetFileInfo(file_path, file_info); } if (components[0] != kITunesMediaDir) @@ -185,8 +185,8 @@ base::File::Error ITunesFileUtil::GetFileInfoSync( } base::File::Error ITunesFileUtil::ReadDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, EntryList* file_list) { DCHECK(file_list->empty()); std::vector<std::string> components = GetVirtualPathComponents(url); @@ -282,23 +282,23 @@ base::File::Error ITunesFileUtil::ReadDirectorySync( } base::File::Error ITunesFileUtil::DeleteDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) { + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) { return base::File::FILE_ERROR_SECURITY; } base::File::Error ITunesFileUtil::DeleteFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) { + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) { return base::File::FILE_ERROR_SECURITY; } base::File::Error ITunesFileUtil::CreateSnapshotFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path, - scoped_refptr<webkit_blob::ShareableFileReference>* file_ref) { + scoped_refptr<storage::ShareableFileReference>* file_ref) { std::vector<std::string> components = GetVirtualPathComponents(url); if (components.size() != 1 || components[0] != kITunesLibraryXML) { return NativeMediaFileUtil::CreateSnapshotFileSync(context, url, file_info, @@ -311,13 +311,13 @@ base::File::Error ITunesFileUtil::CreateSnapshotFileSync( // file. The only way to get here is by way of // CreateSnapshotFileWithFreshDataProvider() so the file has already been // parsed and deemed valid. - *file_ref = scoped_refptr<webkit_blob::ShareableFileReference>(); + *file_ref = scoped_refptr<storage::ShareableFileReference>(); return GetFileInfoSync(context, url, file_info, platform_path); } base::File::Error ITunesFileUtil::GetLocalFilePath( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::FilePath* local_file_path) { std::vector<std::string> components = GetVirtualPathComponents(url); @@ -355,8 +355,8 @@ base::File::Error ITunesFileUtil::GetLocalFilePath( } void ITunesFileUtil::GetFileInfoWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback, bool valid_parse) { if (!valid_parse) { @@ -374,8 +374,8 @@ void ITunesFileUtil::GetFileInfoWithFreshDataProvider( } void ITunesFileUtil::ReadDirectoryWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback, bool valid_parse) { if (!valid_parse) { @@ -392,15 +392,15 @@ void ITunesFileUtil::ReadDirectoryWithFreshDataProvider( } void ITunesFileUtil::CreateSnapshotFileWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback, bool valid_parse) { if (!valid_parse) { if (!callback.is_null()) { base::File::Info file_info; base::FilePath platform_path; - scoped_refptr<webkit_blob::ShareableFileReference> file_ref; + scoped_refptr<storage::ShareableFileReference> file_ref; content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util.h b/chrome/browser/media_galleries/fileapi/itunes_file_util.h index 77b6cdb..039cb65 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_file_util.h +++ b/chrome/browser/media_galleries/fileapi/itunes_file_util.h @@ -28,57 +28,57 @@ class ITunesFileUtil : public NativeMediaFileUtil { protected: // NativeMediaFileUtil overrides. virtual void GetFileInfoOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) OVERRIDE; virtual void ReadDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; virtual void CreateSnapshotFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) OVERRIDE; virtual base::File::Error GetFileInfoSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path) OVERRIDE; virtual base::File::Error ReadDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, EntryList* file_list) OVERRIDE; virtual base::File::Error DeleteDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) OVERRIDE; + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) OVERRIDE; virtual base::File::Error DeleteFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) OVERRIDE; + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) OVERRIDE; virtual base::File::Error CreateSnapshotFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path, - scoped_refptr<webkit_blob::ShareableFileReference>* file_ref) OVERRIDE; + scoped_refptr<storage::ShareableFileReference>* file_ref) OVERRIDE; virtual base::File::Error GetLocalFilePath( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::FilePath* local_file_path) OVERRIDE; private: void GetFileInfoWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback, bool valid_parse); void ReadDirectoryWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback, bool valid_parse); virtual void CreateSnapshotFileWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback, bool valid_parse); diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc index 81d9083..a79e15a 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc @@ -29,9 +29,9 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" -using fileapi::FileSystemOperationContext; -using fileapi::FileSystemOperation; -using fileapi::FileSystemURL; +using storage::FileSystemOperationContext; +using storage::FileSystemOperation; +using storage::FileSystemURL; namespace itunes { @@ -49,7 +49,7 @@ void ReadDirectoryTestHelperCallback( run_loop->Quit(); } -void ReadDirectoryTestHelper(fileapi::FileSystemOperationRunner* runner, +void ReadDirectoryTestHelper(storage::FileSystemOperationRunner* runner, const FileSystemURL& url, FileSystemOperation::FileEntryList* contents, bool* completed) { @@ -120,16 +120,16 @@ class TestMediaFileSystemBackend : public MediaFileSystemBackend { MediaFileSystemBackend::MediaTaskRunner().get()), test_file_util_(itunes_file_util) {} - virtual fileapi::AsyncFileUtil* - GetAsyncFileUtil(fileapi::FileSystemType type) OVERRIDE { - if (type != fileapi::kFileSystemTypeItunes) + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE { + if (type != storage::kFileSystemTypeItunes) return NULL; return test_file_util_.get(); } private: - scoped_ptr<fileapi::AsyncFileUtil> test_file_util_; + scoped_ptr<storage::AsyncFileUtil> test_file_util_; }; class ItunesFileUtilTest : public testing::Test { @@ -156,7 +156,7 @@ class ItunesFileUtilTest : public testing::Test { ASSERT_TRUE(profile_dir_.CreateUniqueTempDir()); ImportedMediaGalleryRegistry::GetInstance()->Initialize(); - scoped_refptr<quota::SpecialStoragePolicy> storage_policy = + scoped_refptr<storage::SpecialStoragePolicy> storage_policy = new content::MockSpecialStoragePolicy(); // Initialize fake ItunesDataProvider on media task runner thread. @@ -171,20 +171,20 @@ class ItunesFileUtilTest : public testing::Test { event.Wait(); media_path_filter_.reset(new MediaPathFilter()); - ScopedVector<fileapi::FileSystemBackend> additional_providers; + ScopedVector<storage::FileSystemBackend> additional_providers; additional_providers.push_back(new TestMediaFileSystemBackend( profile_dir_.path(), new TestITunesFileUtil(media_path_filter_.get(), itunes_data_provider_.get()))); - file_system_context_ = new fileapi::FileSystemContext( + file_system_context_ = new storage::FileSystemContext( base::MessageLoopProxy::current().get(), base::MessageLoopProxy::current().get(), - fileapi::ExternalMountPoints::CreateRefCounted().get(), + storage::ExternalMountPoints::CreateRefCounted().get(), storage_policy.get(), NULL, additional_providers.Pass(), - std::vector<fileapi::URLRequestAutoMountHandler>(), + std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(), content::CreateAllowFileAccessOptions()); } @@ -205,15 +205,16 @@ class ItunesFileUtilTest : public testing::Test { virtual_path = virtual_path.AppendASCII("itunes"); virtual_path = virtual_path.AppendASCII(path); return file_system_context_->CreateCrackedFileSystemURL( - GURL("http://www.example.com"), fileapi::kFileSystemTypeItunes, + GURL("http://www.example.com"), + storage::kFileSystemTypeItunes, virtual_path); } - fileapi::FileSystemOperationRunner* operation_runner() const { + storage::FileSystemOperationRunner* operation_runner() const { return file_system_context_->operation_runner(); } - scoped_refptr<fileapi::FileSystemContext> file_system_context() const { + scoped_refptr<storage::FileSystemContext> file_system_context() const { return file_system_context_; } @@ -228,7 +229,7 @@ class ItunesFileUtilTest : public testing::Test { base::ScopedTempDir profile_dir_; base::ScopedTempDir fake_library_dir_; - scoped_refptr<fileapi::FileSystemContext> file_system_context_; + scoped_refptr<storage::FileSystemContext> file_system_context_; scoped_ptr<MediaPathFilter> media_path_filter_; scoped_ptr<TestITunesDataProvider> itunes_data_provider_; diff --git a/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc b/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc index f9248c3..b160135 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc +++ b/chrome/browser/media_galleries/fileapi/media_file_system_backend.cc @@ -49,8 +49,8 @@ #include "chrome/browser/media_galleries/fileapi/iphoto_file_util.h" #endif // defined(OS_MACOSX) -using fileapi::FileSystemContext; -using fileapi::FileSystemURL; +using storage::FileSystemContext; +using storage::FileSystemURL; namespace { @@ -179,11 +179,11 @@ std::string MediaFileSystemBackend::ConstructMountName( // static bool MediaFileSystemBackend::AttemptAutoMountForURLRequest( const net::URLRequest* url_request, - const fileapi::FileSystemURL& filesystem_url, + const storage::FileSystemURL& filesystem_url, const std::string& storage_domain, const base::Callback<void(base::File::Error result)>& callback) { if (storage_domain.empty() || - filesystem_url.type() != fileapi::kFileSystemTypeExternal || + filesystem_url.type() != storage::kFileSystemTypeExternal || storage_domain != filesystem_url.origin().host()) { return false; } @@ -213,17 +213,16 @@ bool MediaFileSystemBackend::AttemptAutoMountForURLRequest( return true; } -bool MediaFileSystemBackend::CanHandleType( - fileapi::FileSystemType type) const { +bool MediaFileSystemBackend::CanHandleType(storage::FileSystemType type) const { switch (type) { - case fileapi::kFileSystemTypeNativeMedia: - case fileapi::kFileSystemTypeDeviceMedia: + case storage::kFileSystemTypeNativeMedia: + case storage::kFileSystemTypeDeviceMedia: #if defined(OS_WIN) || defined(OS_MACOSX) - case fileapi::kFileSystemTypePicasa: - case fileapi::kFileSystemTypeItunes: + case storage::kFileSystemTypePicasa: + case storage::kFileSystemTypeItunes: #endif // defined(OS_WIN) || defined(OS_MACOSX) #if defined(OS_MACOSX) - case fileapi::kFileSystemTypeIphoto: + case storage::kFileSystemTypeIphoto: #endif // defined(OS_MACOSX) return true; default: @@ -231,12 +230,12 @@ bool MediaFileSystemBackend::CanHandleType( } } -void MediaFileSystemBackend::Initialize(fileapi::FileSystemContext* context) { +void MediaFileSystemBackend::Initialize(storage::FileSystemContext* context) { } void MediaFileSystemBackend::ResolveURL( const FileSystemURL& url, - fileapi::OpenFileSystemMode mode, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback) { // We never allow opening a new FileSystem via usual ResolveURL. base::MessageLoopProxy::current()->PostTask( @@ -247,21 +246,21 @@ void MediaFileSystemBackend::ResolveURL( base::File::FILE_ERROR_SECURITY)); } -fileapi::AsyncFileUtil* MediaFileSystemBackend::GetAsyncFileUtil( - fileapi::FileSystemType type) { +storage::AsyncFileUtil* MediaFileSystemBackend::GetAsyncFileUtil( + storage::FileSystemType type) { switch (type) { - case fileapi::kFileSystemTypeNativeMedia: + case storage::kFileSystemTypeNativeMedia: return native_media_file_util_.get(); - case fileapi::kFileSystemTypeDeviceMedia: + case storage::kFileSystemTypeDeviceMedia: return device_media_async_file_util_.get(); #if defined(OS_WIN) || defined(OS_MACOSX) - case fileapi::kFileSystemTypeItunes: + case storage::kFileSystemTypeItunes: return itunes_file_util_.get(); - case fileapi::kFileSystemTypePicasa: + case storage::kFileSystemTypePicasa: return picasa_file_util_.get(); #endif // defined(OS_WIN) || defined(OS_MACOSX) #if defined(OS_MACOSX) - case fileapi::kFileSystemTypeIphoto: + case storage::kFileSystemTypeIphoto: return iphoto_file_util_.get(); #endif // defined(OS_MACOSX) default: @@ -270,16 +269,17 @@ fileapi::AsyncFileUtil* MediaFileSystemBackend::GetAsyncFileUtil( return NULL; } -fileapi::CopyOrMoveFileValidatorFactory* +storage::CopyOrMoveFileValidatorFactory* MediaFileSystemBackend::GetCopyOrMoveFileValidatorFactory( - fileapi::FileSystemType type, base::File::Error* error_code) { + storage::FileSystemType type, + base::File::Error* error_code) { DCHECK(error_code); *error_code = base::File::FILE_OK; switch (type) { - case fileapi::kFileSystemTypeNativeMedia: - case fileapi::kFileSystemTypeDeviceMedia: - case fileapi::kFileSystemTypeIphoto: - case fileapi::kFileSystemTypeItunes: + case storage::kFileSystemTypeNativeMedia: + case storage::kFileSystemTypeDeviceMedia: + case storage::kFileSystemTypeIphoto: + case storage::kFileSystemTypeItunes: if (!media_copy_or_move_file_validator_factory_) { *error_code = base::File::FILE_ERROR_SECURITY; return NULL; @@ -291,21 +291,20 @@ MediaFileSystemBackend::GetCopyOrMoveFileValidatorFactory( return NULL; } -fileapi::FileSystemOperation* -MediaFileSystemBackend::CreateFileSystemOperation( +storage::FileSystemOperation* MediaFileSystemBackend::CreateFileSystemOperation( const FileSystemURL& url, FileSystemContext* context, base::File::Error* error_code) const { - scoped_ptr<fileapi::FileSystemOperationContext> operation_context( - new fileapi::FileSystemOperationContext( - context, media_task_runner_.get())); - return fileapi::FileSystemOperation::Create( + scoped_ptr<storage::FileSystemOperationContext> operation_context( + new storage::FileSystemOperationContext(context, + media_task_runner_.get())); + return storage::FileSystemOperation::Create( url, context, operation_context.Pass()); } bool MediaFileSystemBackend::SupportsStreaming( - const fileapi::FileSystemURL& url) const { - if (url.type() == fileapi::kFileSystemTypeDeviceMedia) { + const storage::FileSystemURL& url) const { + if (url.type() == storage::kFileSystemTypeDeviceMedia) { DCHECK(device_media_async_file_util_); return device_media_async_file_util_->SupportsStreaming(url); } @@ -314,51 +313,52 @@ bool MediaFileSystemBackend::SupportsStreaming( } bool MediaFileSystemBackend::HasInplaceCopyImplementation( - fileapi::FileSystemType type) const { - DCHECK(type == fileapi::kFileSystemTypeNativeMedia || - type == fileapi::kFileSystemTypeDeviceMedia || - type == fileapi::kFileSystemTypeItunes || - type == fileapi::kFileSystemTypePicasa || - type == fileapi::kFileSystemTypeIphoto); + storage::FileSystemType type) const { + DCHECK(type == storage::kFileSystemTypeNativeMedia || + type == storage::kFileSystemTypeDeviceMedia || + type == storage::kFileSystemTypeItunes || + type == storage::kFileSystemTypePicasa || + type == storage::kFileSystemTypeIphoto); return true; } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> MediaFileSystemBackend::CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, FileSystemContext* context) const { - if (url.type() == fileapi::kFileSystemTypeDeviceMedia) { + if (url.type() == storage::kFileSystemTypeDeviceMedia) { DCHECK(device_media_async_file_util_); - scoped_ptr<webkit_blob::FileStreamReader> reader = + scoped_ptr<storage::FileStreamReader> reader = device_media_async_file_util_->GetFileStreamReader( url, offset, expected_modification_time, context); DCHECK(reader); return reader.Pass(); } - return scoped_ptr<webkit_blob::FileStreamReader>( - webkit_blob::FileStreamReader::CreateForLocalFile( + return scoped_ptr<storage::FileStreamReader>( + storage::FileStreamReader::CreateForLocalFile( context->default_file_task_runner(), - url.path(), offset, expected_modification_time)); + url.path(), + offset, + expected_modification_time)); } -scoped_ptr<fileapi::FileStreamWriter> +scoped_ptr<storage::FileStreamWriter> MediaFileSystemBackend::CreateFileStreamWriter( const FileSystemURL& url, int64 offset, FileSystemContext* context) const { - return scoped_ptr<fileapi::FileStreamWriter>( - fileapi::FileStreamWriter::CreateForLocalFile( + return scoped_ptr<storage::FileStreamWriter>( + storage::FileStreamWriter::CreateForLocalFile( context->default_file_task_runner(), url.path(), offset, - fileapi::FileStreamWriter::OPEN_EXISTING_FILE)); + storage::FileStreamWriter::OPEN_EXISTING_FILE)); } -fileapi::FileSystemQuotaUtil* -MediaFileSystemBackend::GetQuotaUtil() { +storage::FileSystemQuotaUtil* MediaFileSystemBackend::GetQuotaUtil() { // No quota support. return NULL; } diff --git a/chrome/browser/media_galleries/fileapi/media_file_system_backend.h b/chrome/browser/media_galleries/fileapi/media_file_system_backend.h index ca562a4..eb44eca 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_system_backend.h +++ b/chrome/browser/media_galleries/fileapi/media_file_system_backend.h @@ -18,7 +18,7 @@ namespace base { class SequencedTaskRunner; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -29,7 +29,7 @@ class URLRequest; class MediaPathFilter; class DeviceMediaAsyncFileUtil; -class MediaFileSystemBackend : public fileapi::FileSystemBackend { +class MediaFileSystemBackend : public storage::FileSystemBackend { public: static const char kMediaTaskRunnerName[]; @@ -49,40 +49,39 @@ class MediaFileSystemBackend : public fileapi::FileSystemBackend { static bool AttemptAutoMountForURLRequest( const net::URLRequest* url_request, - const fileapi::FileSystemURL& filesystem_url, + const storage::FileSystemURL& filesystem_url, const std::string& storage_domain, const base::Callback<void(base::File::Error result)>& callback); // FileSystemBackend implementation. - virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; - virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE; - virtual void ResolveURL(const fileapi::FileSystemURL& url, - fileapi::OpenFileSystemMode mode, + virtual bool CanHandleType(storage::FileSystemType type) const OVERRIDE; + virtual void Initialize(storage::FileSystemContext* context) OVERRIDE; + virtual void ResolveURL(const storage::FileSystemURL& url, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback) OVERRIDE; - virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( - fileapi::FileSystemType type) OVERRIDE; - virtual fileapi::CopyOrMoveFileValidatorFactory* - GetCopyOrMoveFileValidatorFactory( - fileapi::FileSystemType type, - base::File::Error* error_code) OVERRIDE; - virtual fileapi::FileSystemOperation* CreateFileSystemOperation( - const fileapi::FileSystemURL& url, - fileapi::FileSystemContext* context, + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE; + virtual storage::CopyOrMoveFileValidatorFactory* + GetCopyOrMoveFileValidatorFactory(storage::FileSystemType type, + base::File::Error* error_code) OVERRIDE; + virtual storage::FileSystemOperation* CreateFileSystemOperation( + const storage::FileSystemURL& url, + storage::FileSystemContext* context, base::File::Error* error_code) const OVERRIDE; virtual bool SupportsStreaming( - const fileapi::FileSystemURL& url) const OVERRIDE; + const storage::FileSystemURL& url) const OVERRIDE; virtual bool HasInplaceCopyImplementation( - fileapi::FileSystemType type) const OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( - const fileapi::FileSystemURL& url, + storage::FileSystemType type) const OVERRIDE; + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) const OVERRIDE; - virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + storage::FileSystemContext* context) const OVERRIDE; + virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) const OVERRIDE; - virtual fileapi::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; + storage::FileSystemContext* context) const OVERRIDE; + virtual storage::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; private: // Store the profile path. We need this to create temporary snapshot files. @@ -91,17 +90,17 @@ class MediaFileSystemBackend : public fileapi::FileSystemBackend { scoped_refptr<base::SequencedTaskRunner> media_task_runner_; scoped_ptr<MediaPathFilter> media_path_filter_; - scoped_ptr<fileapi::CopyOrMoveFileValidatorFactory> + scoped_ptr<storage::CopyOrMoveFileValidatorFactory> media_copy_or_move_file_validator_factory_; - scoped_ptr<fileapi::AsyncFileUtil> native_media_file_util_; + scoped_ptr<storage::AsyncFileUtil> native_media_file_util_; scoped_ptr<DeviceMediaAsyncFileUtil> device_media_async_file_util_; #if defined(OS_WIN) || defined(OS_MACOSX) - scoped_ptr<fileapi::AsyncFileUtil> picasa_file_util_; - scoped_ptr<fileapi::AsyncFileUtil> itunes_file_util_; + scoped_ptr<storage::AsyncFileUtil> picasa_file_util_; + scoped_ptr<storage::AsyncFileUtil> itunes_file_util_; #endif // defined(OS_WIN) || defined(OS_MACOSX) #if defined(OS_MACOSX) - scoped_ptr<fileapi::AsyncFileUtil> iphoto_file_util_; + scoped_ptr<storage::AsyncFileUtil> iphoto_file_util_; #endif // defined(OS_MACOSX) DISALLOW_COPY_AND_ASSIGN(MediaFileSystemBackend); diff --git a/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc b/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc index 530701f..d7fda25 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc +++ b/chrome/browser/media_galleries/fileapi/media_file_validator_browsertest.cc @@ -107,7 +107,7 @@ class MediaFileValidatorTest : public InProcessBrowserTest { base::FilePath src_path = base.AppendASCII("src_fs"); ASSERT_TRUE(base::CreateDirectory(src_path)); - ScopedVector<fileapi::FileSystemBackend> additional_providers; + ScopedVector<storage::FileSystemBackend> additional_providers; additional_providers.push_back(new content::TestFileSystemBackend( base::MessageLoopProxy::current().get(), src_path)); additional_providers.push_back(new MediaFileSystemBackend( @@ -117,7 +117,8 @@ class MediaFileValidatorTest : public InProcessBrowserTest { NULL, additional_providers.Pass(), base); move_src_ = file_system_context_->CreateCrackedFileSystemURL( - GURL(kOrigin), fileapi::kFileSystemTypeTest, + GURL(kOrigin), + storage::kFileSystemTypeTest, base::FilePath::FromUTF8Unsafe(filename)); test_file_size_ = content.size(); @@ -128,14 +129,16 @@ class MediaFileValidatorTest : public InProcessBrowserTest { base::FilePath dest_path = base.AppendASCII("dest_fs"); ASSERT_TRUE(base::CreateDirectory(dest_path)); std::string dest_fsid = - fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForPath( - fileapi::kFileSystemTypeNativeMedia, std::string(), dest_path, + storage::IsolatedContext::GetInstance()->RegisterFileSystemForPath( + storage::kFileSystemTypeNativeMedia, + std::string(), + dest_path, NULL); size_t extension_index = filename.find_last_of("."); ASSERT_NE(std::string::npos, extension_index); std::string extension = filename.substr(extension_index); - std::string dest_root_fs_url = fileapi::GetIsolatedFileSystemRootURIString( + std::string dest_root_fs_url = storage::GetIsolatedFileSystemRootURIString( GURL(kOrigin), dest_fsid, "dest_fs/"); move_dest_ = file_system_context_->CrackURL(GURL( dest_root_fs_url + "move_dest" + extension)); @@ -170,7 +173,7 @@ class MediaFileValidatorTest : public InProcessBrowserTest { // Helper that checks a file has the |expected_size|, which may be // |kNoFileSize| if the file should not exist. |callback| is called // with success/failure. - void CheckFile(fileapi::FileSystemURL url, + void CheckFile(storage::FileSystemURL url, int64 expected_size, const base::Callback<void(bool success)>& callback) { operation_runner()->GetMetadata(url, @@ -196,10 +199,12 @@ class MediaFileValidatorTest : public InProcessBrowserTest { // |move_src_| to |move_dest_|. void OnTestFilesReady(bool expected_result, bool test_files_ready) { ASSERT_TRUE(test_files_ready); - operation_runner()->Move( - move_src_, move_dest_, fileapi::FileSystemOperation::OPTION_NONE, - base::Bind(&MediaFileValidatorTest::OnMoveResult, - base::Unretained(this), expected_result)); + operation_runner()->Move(move_src_, + move_dest_, + storage::FileSystemOperation::OPTION_NONE, + base::Bind(&MediaFileValidatorTest::OnMoveResult, + base::Unretained(this), + expected_result)); } // Check that the move succeeded/failed based on expectation and then @@ -222,18 +227,18 @@ class MediaFileValidatorTest : public InProcessBrowserTest { loop_runner_->QuitClosure()); } - fileapi::FileSystemOperationRunner* operation_runner() { + storage::FileSystemOperationRunner* operation_runner() { return file_system_context_->operation_runner(); } base::ScopedTempDir base_dir_; - scoped_refptr<fileapi::FileSystemContext> file_system_context_; + scoped_refptr<storage::FileSystemContext> file_system_context_; int test_file_size_; - fileapi::FileSystemURL move_src_; - fileapi::FileSystemURL move_dest_; + storage::FileSystemURL move_src_; + storage::FileSystemURL move_dest_; scoped_refptr<content::MessageLoopRunner> loop_runner_; diff --git a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc index 480dd64..df629ad 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc +++ b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.cc @@ -12,19 +12,19 @@ namespace { -class InvalidFileValidator : public fileapi::CopyOrMoveFileValidator { +class InvalidFileValidator : public storage::CopyOrMoveFileValidator { public: virtual ~InvalidFileValidator() {} virtual void StartPreWriteValidation( - const fileapi::CopyOrMoveFileValidator::ResultCallback& - result_callback) OVERRIDE { + const storage::CopyOrMoveFileValidator::ResultCallback& result_callback) + OVERRIDE { result_callback.Run(base::File::FILE_ERROR_SECURITY); } virtual void StartPostWriteValidation( const base::FilePath& dest_platform_path, - const fileapi::CopyOrMoveFileValidator::ResultCallback& - result_callback) OVERRIDE { + const storage::CopyOrMoveFileValidator::ResultCallback& result_callback) + OVERRIDE { result_callback.Run(base::File::FILE_ERROR_SECURITY); } @@ -41,9 +41,9 @@ class InvalidFileValidator : public fileapi::CopyOrMoveFileValidator { MediaFileValidatorFactory::MediaFileValidatorFactory() {} MediaFileValidatorFactory::~MediaFileValidatorFactory() {} -fileapi::CopyOrMoveFileValidator* +storage::CopyOrMoveFileValidator* MediaFileValidatorFactory::CreateCopyOrMoveFileValidator( - const fileapi::FileSystemURL& src, + const storage::FileSystemURL& src, const base::FilePath& platform_path) { base::FilePath src_path = src.virtual_path(); if (SupportedImageTypeValidator::SupportsFileType(src_path)) diff --git a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.h b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.h index 1da7f03..c979587 100644 --- a/chrome/browser/media_galleries/fileapi/media_file_validator_factory.h +++ b/chrome/browser/media_galleries/fileapi/media_file_validator_factory.h @@ -12,7 +12,7 @@ namespace base { class FilePath; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -20,15 +20,16 @@ class FileSystemURL; // strategies (depending on the file type) to attempt to verify that the file // is a valid media file. class MediaFileValidatorFactory - : public fileapi::CopyOrMoveFileValidatorFactory { + : public storage::CopyOrMoveFileValidatorFactory { public: MediaFileValidatorFactory(); virtual ~MediaFileValidatorFactory(); // CopyOrMoveFileValidatorFactory implementation. - virtual fileapi::CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( - const fileapi::FileSystemURL& src, - const base::FilePath& platform_path) OVERRIDE; + virtual storage::CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( + const storage::FileSystemURL& src, + const base::FilePath& platform_path) OVERRIDE; + private: DISALLOW_COPY_AND_ASSIGN(MediaFileValidatorFactory); }; diff --git a/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h b/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h index 05dee8a..bc897bb 100644 --- a/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h +++ b/chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h @@ -31,8 +31,8 @@ class MTPDeviceAsyncDelegate { // A callback to be called when ReadDirectory method call succeeds. typedef base::Callback< - void(const fileapi::AsyncFileUtil::EntryList& file_list, - bool has_more)> ReadDirectorySuccessCallback; + void(const storage::AsyncFileUtil::EntryList& file_list, bool has_more)> + ReadDirectorySuccessCallback; // A callback to be called when GetFileInfo/ReadDirectory/CreateSnapshot // method call fails. diff --git a/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc index 1d68870..ef87ac2 100644 --- a/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc +++ b/chrome/browser/media_galleries/fileapi/mtp_device_map_service.cc @@ -85,7 +85,7 @@ MTPDeviceAsyncDelegate* MTPDeviceMapService::GetMTPDeviceAsyncDelegate( const std::string& filesystem_id) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); base::FilePath device_path; - if (!fileapi::ExternalMountPoints::GetSystemInstance()->GetRegisteredPath( + if (!storage::ExternalMountPoints::GetSystemInstance()->GetRegisteredPath( filesystem_id, &device_path)) { return NULL; } diff --git a/chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.cc b/chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.cc index ef3803b..e79882b 100644 --- a/chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.cc +++ b/chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.cc @@ -16,13 +16,13 @@ #include "net/base/net_errors.h" #include "webkit/browser/fileapi/file_system_context.h" -using webkit_blob::FileStreamReader; +using storage::FileStreamReader; namespace { // Called on the IO thread. MTPDeviceAsyncDelegate* GetMTPDeviceDelegate( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); return MTPDeviceMapService::GetInstance()->GetMTPDeviceAsyncDelegate( url.filesystem_id()); @@ -41,7 +41,9 @@ void CallInt64CompletionCallbackWithPlatformFileError( } void ReadBytes( - const fileapi::FileSystemURL& url, net::IOBuffer* buf, int64 offset, + const storage::FileSystemURL& url, + net::IOBuffer* buf, + int64 offset, int buf_len, const MTPDeviceAsyncDelegate::ReadBytesSuccessCallback& success_callback, const net::CompletionCallback& error_callback) { @@ -63,8 +65,8 @@ void ReadBytes( } // namespace MTPFileStreamReader::MTPFileStreamReader( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, + storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, int64 initial_offset, const base::Time& expected_modification_time, bool do_media_header_validation) diff --git a/chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h b/chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h index 1b09717..ae2b14b 100644 --- a/chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h +++ b/chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h @@ -17,15 +17,15 @@ namespace base { class FilePath; } -namespace fileapi { +namespace storage { class FileSystemContext; } class MTPFileStreamReader - : public NON_EXPORTED_BASE(webkit_blob::FileStreamReader) { + : public NON_EXPORTED_BASE(storage::FileStreamReader) { public: - MTPFileStreamReader(fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, + MTPFileStreamReader(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, int64 initial_offset, const base::Time& expected_modification_time, bool do_media_header_validation); @@ -52,8 +52,8 @@ class MTPFileStreamReader void FinishGetLength(const net::Int64CompletionCallback& callback, const base::File::Info& file_info); - scoped_refptr<fileapi::FileSystemContext> file_system_context_; - fileapi::FileSystemURL url_; + scoped_refptr<storage::FileSystemContext> file_system_context_; + storage::FileSystemURL url_; int64 current_offset_; const base::Time expected_modification_time_; diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util.cc index b1fb85f..4e9bf6e 100644 --- a/chrome/browser/media_galleries/fileapi/native_media_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util.cc @@ -25,7 +25,7 @@ namespace { // Returns true if the current thread is capable of doing IO. -bool IsOnTaskRunnerThread(fileapi::FileSystemOperationContext* context) { +bool IsOnTaskRunnerThread(storage::FileSystemOperationContext* context) { return context->task_runner()->RunsTasksOnCurrentThread(); } @@ -47,12 +47,12 @@ base::File::Error IsMediaHeader(const char* buf, size_t length) { } void HoldFileRef( - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + const scoped_refptr<storage::ShareableFileReference>& file_ref) { } void DidOpenSnapshot( - const fileapi::AsyncFileUtil::CreateOrOpenCallback& callback, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref, + const storage::AsyncFileUtil::CreateOrOpenCallback& callback, + const scoped_refptr<storage::ShareableFileReference>& file_ref, base::File file) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); if (!file.IsValid()) { @@ -99,11 +99,11 @@ base::File::Error NativeMediaFileUtil::BufferIsMediaHeader( void NativeMediaFileUtil::CreatedSnapshotFileForCreateOrOpen( base::SequencedTaskRunner* media_task_runner, int file_flags, - const fileapi::AsyncFileUtil::CreateOrOpenCallback& callback, + const storage::AsyncFileUtil::CreateOrOpenCallback& callback, base::File::Error result, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + const scoped_refptr<storage::ShareableFileReference>& file_ref) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); if (result != base::File::FILE_OK) { callback.Run(base::File(), base::Closure()); @@ -112,15 +112,14 @@ void NativeMediaFileUtil::CreatedSnapshotFileForCreateOrOpen( base::PostTaskAndReplyWithResult( media_task_runner, FROM_HERE, - base::Bind(&fileapi::NativeFileUtil::CreateOrOpen, - platform_path, - file_flags), + base::Bind( + &storage::NativeFileUtil::CreateOrOpen, platform_path, file_flags), base::Bind(&DidOpenSnapshot, callback, file_ref)); } void NativeMediaFileUtil::CreateOrOpen( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); @@ -142,21 +141,21 @@ void NativeMediaFileUtil::CreateOrOpen( } void NativeMediaFileUtil::EnsureFileExists( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const EnsureFileExistsCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); callback.Run(base::File::FILE_ERROR_SECURITY, false); } void NativeMediaFileUtil::CreateDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - fileapi::FileSystemOperationContext* context_ptr = context.get(); + storage::FileSystemOperationContext* context_ptr = context.get(); const bool success = context_ptr->task_runner()->PostTask( FROM_HERE, base::Bind(&NativeMediaFileUtil::CreateDirectoryOnTaskRunnerThread, @@ -166,11 +165,11 @@ void NativeMediaFileUtil::CreateDirectory( } void NativeMediaFileUtil::GetFileInfo( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - fileapi::FileSystemOperationContext* context_ptr = context.get(); + storage::FileSystemOperationContext* context_ptr = context.get(); const bool success = context_ptr->task_runner()->PostTask( FROM_HERE, base::Bind(&NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread, @@ -180,11 +179,11 @@ void NativeMediaFileUtil::GetFileInfo( } void NativeMediaFileUtil::ReadDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - fileapi::FileSystemOperationContext* context_ptr = context.get(); + storage::FileSystemOperationContext* context_ptr = context.get(); const bool success = context_ptr->task_runner()->PostTask( FROM_HERE, base::Bind(&NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread, @@ -194,8 +193,8 @@ void NativeMediaFileUtil::ReadDirectory( } void NativeMediaFileUtil::Touch( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time, const StatusCallback& callback) { @@ -204,8 +203,8 @@ void NativeMediaFileUtil::Touch( } void NativeMediaFileUtil::Truncate( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int64 length, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); @@ -213,14 +212,14 @@ void NativeMediaFileUtil::Truncate( } void NativeMediaFileUtil::CopyFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - fileapi::FileSystemOperationContext* context_ptr = context.get(); + storage::FileSystemOperationContext* context_ptr = context.get(); const bool success = context_ptr->task_runner()->PostTask( FROM_HERE, base::Bind(&NativeMediaFileUtil::CopyOrMoveFileLocalOnTaskRunnerThread, @@ -230,13 +229,13 @@ void NativeMediaFileUtil::CopyFileLocal( } void NativeMediaFileUtil::MoveFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - fileapi::FileSystemOperationContext* context_ptr = context.get(); + storage::FileSystemOperationContext* context_ptr = context.get(); const bool success = context_ptr->task_runner()->PostTask( FROM_HERE, base::Bind(&NativeMediaFileUtil::CopyOrMoveFileLocalOnTaskRunnerThread, @@ -246,12 +245,12 @@ void NativeMediaFileUtil::MoveFileLocal( } void NativeMediaFileUtil::CopyInForeignFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - fileapi::FileSystemOperationContext* context_ptr = context.get(); + storage::FileSystemOperationContext* context_ptr = context.get(); const bool success = context_ptr->task_runner()->PostTask( FROM_HERE, base::Bind(&NativeMediaFileUtil::CopyInForeignFileOnTaskRunnerThread, @@ -261,11 +260,11 @@ void NativeMediaFileUtil::CopyInForeignFile( } void NativeMediaFileUtil::DeleteFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - fileapi::FileSystemOperationContext* context_ptr = context.get(); + storage::FileSystemOperationContext* context_ptr = context.get(); const bool success = context_ptr->task_runner()->PostTask( FROM_HERE, base::Bind(&NativeMediaFileUtil::DeleteFileOnTaskRunnerThread, @@ -276,11 +275,11 @@ void NativeMediaFileUtil::DeleteFile( // This is needed to support Copy and Move. void NativeMediaFileUtil::DeleteDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - fileapi::FileSystemOperationContext* context_ptr = context.get(); + storage::FileSystemOperationContext* context_ptr = context.get(); const bool success = context_ptr->task_runner()->PostTask( FROM_HERE, base::Bind(&NativeMediaFileUtil::DeleteDirectoryOnTaskRunnerThread, @@ -290,19 +289,19 @@ void NativeMediaFileUtil::DeleteDirectory( } void NativeMediaFileUtil::DeleteRecursively( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); callback.Run(base::File::FILE_ERROR_INVALID_OPERATION); } void NativeMediaFileUtil::CreateSnapshotFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); - fileapi::FileSystemOperationContext* context_ptr = context.get(); + storage::FileSystemOperationContext* context_ptr = context.get(); const bool success = context_ptr->task_runner()->PostTask( FROM_HERE, base::Bind(&NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread, @@ -312,8 +311,8 @@ void NativeMediaFileUtil::CreateSnapshotFile( } void NativeMediaFileUtil::CreateDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) { @@ -327,8 +326,8 @@ void NativeMediaFileUtil::CreateDirectoryOnTaskRunnerThread( } void NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) { DCHECK(IsOnTaskRunnerThread(context.get())); base::File::Info file_info; @@ -341,8 +340,8 @@ void NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread( } void NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) { DCHECK(IsOnTaskRunnerThread(context.get())); EntryList entry_list; @@ -355,9 +354,9 @@ void NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread( } void NativeMediaFileUtil::CopyOrMoveFileLocalOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, bool copy, const StatusCallback& callback) { @@ -371,9 +370,9 @@ void NativeMediaFileUtil::CopyOrMoveFileLocalOnTaskRunnerThread( } void NativeMediaFileUtil::CopyInForeignFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) { DCHECK(IsOnTaskRunnerThread(context.get())); base::File::Error error = @@ -385,8 +384,8 @@ void NativeMediaFileUtil::CopyInForeignFileOnTaskRunnerThread( } void NativeMediaFileUtil::DeleteFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK(IsOnTaskRunnerThread(context.get())); base::File::Error error = DeleteFileSync(context.get(), url); @@ -397,8 +396,8 @@ void NativeMediaFileUtil::DeleteFileOnTaskRunnerThread( } void NativeMediaFileUtil::DeleteDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) { DCHECK(IsOnTaskRunnerThread(context.get())); base::File::Error error = DeleteDirectorySync(context.get(), url); @@ -409,13 +408,13 @@ void NativeMediaFileUtil::DeleteDirectoryOnTaskRunnerThread( } void NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) { DCHECK(IsOnTaskRunnerThread(context.get())); base::File::Info file_info; base::FilePath platform_path; - scoped_refptr<webkit_blob::ShareableFileReference> file_ref; + scoped_refptr<storage::ShareableFileReference> file_ref; base::File::Error error = CreateSnapshotFileSync( context.get(), url, &file_info, &platform_path, &file_ref); content::BrowserThread::PostTask( @@ -425,22 +424,22 @@ void NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread( } base::File::Error NativeMediaFileUtil::CreateDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, bool exclusive, bool recursive) { base::FilePath file_path; base::File::Error error = GetLocalFilePath(context, url, &file_path); if (error != base::File::FILE_OK) return error; - return fileapi::NativeFileUtil::CreateDirectory(file_path, exclusive, - recursive); + return storage::NativeFileUtil::CreateDirectory( + file_path, exclusive, recursive); } base::File::Error NativeMediaFileUtil::CopyOrMoveFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, bool copy) { DCHECK(IsOnTaskRunnerThread(context)); @@ -452,7 +451,7 @@ base::File::Error NativeMediaFileUtil::CopyOrMoveFileSync( &src_file_path); if (error != base::File::FILE_OK) return error; - if (fileapi::NativeFileUtil::DirectoryExists(src_file_path)) + if (storage::NativeFileUtil::DirectoryExists(src_file_path)) return base::File::FILE_ERROR_NOT_A_FILE; base::FilePath dest_file_path; @@ -460,7 +459,7 @@ base::File::Error NativeMediaFileUtil::CopyOrMoveFileSync( if (error != base::File::FILE_OK) return error; base::File::Info file_info; - error = fileapi::NativeFileUtil::GetFileInfo(dest_file_path, &file_info); + error = storage::NativeFileUtil::GetFileInfo(dest_file_path, &file_info); if (error != base::File::FILE_OK && error != base::File::FILE_ERROR_NOT_FOUND) { return error; @@ -470,15 +469,17 @@ base::File::Error NativeMediaFileUtil::CopyOrMoveFileSync( if (!media_path_filter_->Match(dest_file_path)) return base::File::FILE_ERROR_SECURITY; - return fileapi::NativeFileUtil::CopyOrMoveFile( - src_file_path, dest_file_path, option, - fileapi::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, copy)); + return storage::NativeFileUtil::CopyOrMoveFile( + src_file_path, + dest_file_path, + option, + storage::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, copy)); } base::File::Error NativeMediaFileUtil::CopyInForeignFileSync( - fileapi::FileSystemOperationContext* context, + storage::FileSystemOperationContext* context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url) { + const storage::FileSystemURL& dest_url) { DCHECK(IsOnTaskRunnerThread(context)); if (src_file_path.empty()) return base::File::FILE_ERROR_INVALID_OPERATION; @@ -488,16 +489,17 @@ base::File::Error NativeMediaFileUtil::CopyInForeignFileSync( GetFilteredLocalFilePath(context, dest_url, &dest_file_path); if (error != base::File::FILE_OK) return error; - return fileapi::NativeFileUtil::CopyOrMoveFile( - src_file_path, dest_file_path, - fileapi::FileSystemOperation::OPTION_NONE, - fileapi::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, + return storage::NativeFileUtil::CopyOrMoveFile( + src_file_path, + dest_file_path, + storage::FileSystemOperation::OPTION_NONE, + storage::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, true /* copy */)); } base::File::Error NativeMediaFileUtil::GetFileInfoSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path) { DCHECK(context); @@ -510,7 +512,7 @@ base::File::Error NativeMediaFileUtil::GetFileInfoSync( return error; if (base::IsLink(file_path)) return base::File::FILE_ERROR_NOT_FOUND; - error = fileapi::NativeFileUtil::GetFileInfo(file_path, file_info); + error = storage::NativeFileUtil::GetFileInfo(file_path, file_info); if (error != base::File::FILE_OK) return error; @@ -524,8 +526,8 @@ base::File::Error NativeMediaFileUtil::GetFileInfoSync( } base::File::Error NativeMediaFileUtil::GetLocalFilePath( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::FilePath* local_file_path) { DCHECK(local_file_path); DCHECK(url.is_valid()); @@ -538,9 +540,9 @@ base::File::Error NativeMediaFileUtil::GetLocalFilePath( } base::File::Error NativeMediaFileUtil::ReadDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, - EntryList* file_list) { + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, + EntryList* file_list) { DCHECK(IsOnTaskRunnerThread(context)); DCHECK(file_list); DCHECK(file_list->empty()); @@ -574,7 +576,7 @@ base::File::Error NativeMediaFileUtil::ReadDirectorySync( if (!info.IsDirectory() && !media_path_filter_->Match(enum_path)) continue; - fileapi::DirectoryEntry entry; + storage::DirectoryEntry entry; entry.is_directory = info.IsDirectory(); entry.name = enum_path.BaseName().value(); entry.size = info.GetSize(); @@ -587,8 +589,8 @@ base::File::Error NativeMediaFileUtil::ReadDirectorySync( } base::File::Error NativeMediaFileUtil::DeleteFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) { + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) { DCHECK(IsOnTaskRunnerThread(context)); base::File::Info file_info; base::FilePath file_path; @@ -598,26 +600,26 @@ base::File::Error NativeMediaFileUtil::DeleteFileSync( return error; if (file_info.is_directory) return base::File::FILE_ERROR_NOT_A_FILE; - return fileapi::NativeFileUtil::DeleteFile(file_path); + return storage::NativeFileUtil::DeleteFile(file_path); } base::File::Error NativeMediaFileUtil::DeleteDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) { + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) { DCHECK(IsOnTaskRunnerThread(context)); base::FilePath file_path; base::File::Error error = GetLocalFilePath(context, url, &file_path); if (error != base::File::FILE_OK) return error; - return fileapi::NativeFileUtil::DeleteDirectory(file_path); + return storage::NativeFileUtil::DeleteDirectory(file_path); } base::File::Error NativeMediaFileUtil::CreateSnapshotFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path, - scoped_refptr<webkit_blob::ShareableFileReference>* file_ref) { + scoped_refptr<storage::ShareableFileReference>* file_ref) { DCHECK(IsOnTaskRunnerThread(context)); base::File::Error error = GetFileInfoSync(context, url, file_info, platform_path); @@ -627,14 +629,14 @@ base::File::Error NativeMediaFileUtil::CreateSnapshotFileSync( error = NativeMediaFileUtil::IsMediaFile(*platform_path); // We're just returning the local file information. - *file_ref = scoped_refptr<webkit_blob::ShareableFileReference>(); + *file_ref = scoped_refptr<storage::ShareableFileReference>(); return error; } base::File::Error NativeMediaFileUtil::GetFilteredLocalFilePath( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& file_system_url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& file_system_url, base::FilePath* local_file_path) { DCHECK(IsOnTaskRunnerThread(context)); base::FilePath file_path; @@ -651,8 +653,8 @@ base::File::Error NativeMediaFileUtil::GetFilteredLocalFilePath( base::File::Error NativeMediaFileUtil::GetFilteredLocalFilePathForExistingFileOrDirectory( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& file_system_url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& file_system_url, base::File::Error failure_error, base::FilePath* local_file_path) { DCHECK(IsOnTaskRunnerThread(context)); diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util.h b/chrome/browser/media_galleries/fileapi/native_media_file_util.h index 0329be5..3c63568 100644 --- a/chrome/browser/media_galleries/fileapi/native_media_file_util.h +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util.h @@ -18,7 +18,7 @@ class MediaPathFilter; // This class handles native file system operations with media type filtering. // To support virtual file systems it implements the AsyncFileUtil interface // from scratch and provides synchronous override points. -class NativeMediaFileUtil : public fileapi::AsyncFileUtil { +class NativeMediaFileUtil : public storage::AsyncFileUtil { public: explicit NativeMediaFileUtil(MediaPathFilter* media_path_filter); virtual ~NativeMediaFileUtil(); @@ -35,168 +35,166 @@ class NativeMediaFileUtil : public fileapi::AsyncFileUtil { static void CreatedSnapshotFileForCreateOrOpen( base::SequencedTaskRunner* media_task_runner, int file_flags, - const fileapi::AsyncFileUtil::CreateOrOpenCallback& callback, + const storage::AsyncFileUtil::CreateOrOpenCallback& callback, base::File::Error result, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); + const scoped_refptr<storage::ShareableFileReference>& file_ref); // AsyncFileUtil overrides. virtual void CreateOrOpen( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, int file_flags, const CreateOrOpenCallback& callback) OVERRIDE; virtual void EnsureFileExists( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const EnsureFileExistsCallback& callback) OVERRIDE; virtual void CreateDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) OVERRIDE; virtual void GetFileInfo( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) OVERRIDE; virtual void ReadDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; - virtual void Touch( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - const base::Time& last_access_time, - const base::Time& last_modified_time, - const StatusCallback& callback) OVERRIDE; - virtual void Truncate( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, - int64 length, - const StatusCallback& callback) OVERRIDE; + virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + const base::Time& last_access_time, + const base::Time& last_modified_time, + const StatusCallback& callback) OVERRIDE; + virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, + int64 length, + const StatusCallback& callback) OVERRIDE; virtual void CopyFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) OVERRIDE; virtual void MoveFileLocal( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) OVERRIDE; virtual void CopyInForeignFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) OVERRIDE; virtual void DeleteFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteDirectory( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void DeleteRecursively( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; virtual void CreateSnapshotFile( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback) OVERRIDE; protected: virtual void CreateDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback); virtual void GetFileInfoOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback); virtual void ReadDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback); virtual void CopyOrMoveFileLocalOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, bool copy, const StatusCallback& callback); virtual void CopyInForeignFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, + scoped_ptr<storage::FileSystemOperationContext> context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback); virtual void DeleteFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback); virtual void DeleteDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const StatusCallback& callback); virtual void CreateSnapshotFileOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const CreateSnapshotFileCallback& callback); // The following methods should only be called on the task runner thread. // Necessary for copy/move to succeed. virtual base::File::Error CreateDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, bool exclusive, bool recursive); virtual base::File::Error CopyOrMoveFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, bool copy); virtual base::File::Error CopyInForeignFileSync( - fileapi::FileSystemOperationContext* context, + storage::FileSystemOperationContext* context, const base::FilePath& src_file_path, - const fileapi::FileSystemURL& dest_url); + const storage::FileSystemURL& dest_url); virtual base::File::Error GetFileInfoSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path); // Called by GetFileInfoSync. Meant to be overridden by subclasses that // have special mappings from URLs to platform paths (virtual filesystems). virtual base::File::Error GetLocalFilePath( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& file_system_url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& file_system_url, base::FilePath* local_file_path); virtual base::File::Error ReadDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, EntryList* file_list); virtual base::File::Error DeleteFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url); + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url); // Necessary for move to succeed. virtual base::File::Error DeleteDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url); + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url); virtual base::File::Error CreateSnapshotFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path, - scoped_refptr<webkit_blob::ShareableFileReference>* file_ref); + scoped_refptr<storage::ShareableFileReference>* file_ref); MediaPathFilter* media_path_filter() { return media_path_filter_; @@ -207,8 +205,8 @@ class NativeMediaFileUtil : public fileapi::AsyncFileUtil { // consideration. If the media_path_filter() check fails, return // Fila::FILE_ERROR_SECURITY. |local_file_path| does not have to exist. base::File::Error GetFilteredLocalFilePath( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& file_system_url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& file_system_url, base::FilePath* local_file_path); // Like GetLocalFilePath(), but if the file does not exist, then return @@ -218,12 +216,11 @@ class NativeMediaFileUtil : public fileapi::AsyncFileUtil { // If the media_path_filter() check fails, return |failure_error|. // If |local_file_path| is a directory, return File::FILE_OK. base::File::Error GetFilteredLocalFilePathForExistingFileOrDirectory( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& file_system_url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& file_system_url, base::File::Error failure_error, base::FilePath* local_file_path); - // Not owned, owned by the backend which owns this. MediaPathFilter* const media_path_filter_; diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc index 1e2579d..57f4920 100644 --- a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc @@ -29,8 +29,8 @@ #define FPL(x) FILE_PATH_LITERAL(x) -using fileapi::FileSystemOperation; -using fileapi::FileSystemURL; +using storage::FileSystemOperation; +using storage::FileSystemURL; namespace { @@ -119,26 +119,26 @@ class NativeMediaFileUtilTest : public testing::Test { ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); ASSERT_TRUE(base::CreateDirectory(root_path())); - scoped_refptr<quota::SpecialStoragePolicy> storage_policy = + scoped_refptr<storage::SpecialStoragePolicy> storage_policy = new content::MockSpecialStoragePolicy(); - ScopedVector<fileapi::FileSystemBackend> additional_providers; + ScopedVector<storage::FileSystemBackend> additional_providers; additional_providers.push_back(new MediaFileSystemBackend( data_dir_.path(), base::MessageLoopProxy::current().get())); - file_system_context_ = new fileapi::FileSystemContext( + file_system_context_ = new storage::FileSystemContext( base::MessageLoopProxy::current().get(), base::MessageLoopProxy::current().get(), - fileapi::ExternalMountPoints::CreateRefCounted().get(), + storage::ExternalMountPoints::CreateRefCounted().get(), storage_policy.get(), NULL, additional_providers.Pass(), - std::vector<fileapi::URLRequestAutoMountHandler>(), + std::vector<storage::URLRequestAutoMountHandler>(), data_dir_.path(), content::CreateAllowFileAccessOptions()); filesystem_id_ = isolated_context()->RegisterFileSystemForPath( - fileapi::kFileSystemTypeNativeMedia, std::string(), root_path(), NULL); + storage::kFileSystemTypeNativeMedia, std::string(), root_path(), NULL); isolated_context()->AddReference(filesystem_id_); } @@ -149,19 +149,19 @@ class NativeMediaFileUtilTest : public testing::Test { } protected: - fileapi::FileSystemContext* file_system_context() { + storage::FileSystemContext* file_system_context() { return file_system_context_.get(); } FileSystemURL CreateURL(const base::FilePath::CharType* test_case_path) { return file_system_context_->CreateCrackedFileSystemURL( origin(), - fileapi::kFileSystemTypeIsolated, + storage::kFileSystemTypeIsolated, GetVirtualPath(test_case_path)); } - fileapi::IsolatedContext* isolated_context() { - return fileapi::IsolatedContext::GetInstance(); + storage::IsolatedContext* isolated_context() { + return storage::IsolatedContext::GetInstance(); } base::FilePath root_path() { @@ -179,11 +179,9 @@ class NativeMediaFileUtilTest : public testing::Test { return GURL("http://example.com"); } - fileapi::FileSystemType type() { - return fileapi::kFileSystemTypeNativeMedia; - } + storage::FileSystemType type() { return storage::kFileSystemTypeNativeMedia; } - fileapi::FileSystemOperationRunner* operation_runner() { + storage::FileSystemOperationRunner* operation_runner() { return file_system_context_->operation_runner(); } @@ -192,7 +190,7 @@ class NativeMediaFileUtilTest : public testing::Test { content::TestBrowserThread io_thread_; base::ScopedTempDir data_dir_; - scoped_refptr<fileapi::FileSystemContext> file_system_context_; + scoped_refptr<storage::FileSystemContext> file_system_context_; std::string filesystem_id_; @@ -304,9 +302,10 @@ TEST_F(NativeMediaFileUtilTest, CopySourceFiltering) { expectation = base::File::FILE_ERROR_INVALID_OPERATION; } operation_runner()->Copy( - url, dest_url, - fileapi::FileSystemOperation::OPTION_NONE, - fileapi::FileSystemOperationRunner::CopyProgressCallback(), + url, + dest_url, + storage::FileSystemOperation::OPTION_NONE, + storage::FileSystemOperationRunner::CopyProgressCallback(), base::Bind(&ExpectEqHelper, test_name, expectation)); base::MessageLoop::current()->RunUntilIdle(); } @@ -369,9 +368,10 @@ TEST_F(NativeMediaFileUtilTest, CopyDestFiltering) { } } operation_runner()->Copy( - src_url, url, - fileapi::FileSystemOperation::OPTION_NONE, - fileapi::FileSystemOperationRunner::CopyProgressCallback(), + src_url, + url, + storage::FileSystemOperation::OPTION_NONE, + storage::FileSystemOperationRunner::CopyProgressCallback(), base::Bind(&ExpectEqHelper, test_name, expectation)); base::MessageLoop::current()->RunUntilIdle(); } @@ -409,7 +409,9 @@ TEST_F(NativeMediaFileUtilTest, MoveSourceFiltering) { expectation = base::File::FILE_ERROR_INVALID_OPERATION; } operation_runner()->Move( - url, dest_url, fileapi::FileSystemOperation::OPTION_NONE, + url, + dest_url, + storage::FileSystemOperation::OPTION_NONE, base::Bind(&ExpectEqHelper, test_name, expectation)); base::MessageLoop::current()->RunUntilIdle(); } @@ -474,7 +476,9 @@ TEST_F(NativeMediaFileUtilTest, MoveDestFiltering) { } } operation_runner()->Move( - src_url, url, fileapi::FileSystemOperation::OPTION_NONE, + src_url, + url, + storage::FileSystemOperation::OPTION_NONE, base::Bind(&ExpectEqHelper, test_name, expectation)); base::MessageLoop::current()->RunUntilIdle(); } @@ -544,7 +548,7 @@ void CreateSnapshotCallback( base::File::Error result, const base::File::Info&, const base::FilePath&, - const scoped_refptr<webkit_blob::ShareableFileReference>&) { + const scoped_refptr<storage::ShareableFileReference>&) { *error = result; } diff --git a/chrome/browser/media_galleries/fileapi/picasa_file_util.cc b/chrome/browser/media_galleries/fileapi/picasa_file_util.cc index 2965b9b..ee2905d 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_file_util.cc @@ -24,9 +24,9 @@ #include "webkit/common/fileapi/file_system_util.h" using base::FilePath; -using fileapi::DirectoryEntry; -using fileapi::FileSystemOperationContext; -using fileapi::FileSystemURL; +using storage::DirectoryEntry; +using storage::FileSystemOperationContext; +using storage::FileSystemURL; namespace picasa { @@ -50,7 +50,7 @@ base::File::Error FindAlbumInfo(const std::string& key, } std::vector<std::string> GetVirtualPathComponents( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { ImportedMediaGalleryRegistry* imported_registry = ImportedMediaGalleryRegistry::GetInstance(); base::FilePath root = imported_registry->ImportedRoot().AppendASCII("picasa"); @@ -60,12 +60,12 @@ std::vector<std::string> GetVirtualPathComponents( root.AppendRelativePath(url.path(), &virtual_path); std::vector<std::string> result; - fileapi::VirtualPath::GetComponentsUTF8Unsafe(virtual_path, &result); + storage::VirtualPath::GetComponentsUTF8Unsafe(virtual_path, &result); return result; } PicasaDataProvider::DataType GetDataTypeForURL( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { std::vector<std::string> components = GetVirtualPathComponents(url); if (components.size() >= 2 && components[0] == kPicasaDirAlbums) return PicasaDataProvider::ALBUMS_IMAGES_DATA; @@ -86,8 +86,8 @@ PicasaFileUtil::PicasaFileUtil(MediaPathFilter* media_path_filter) PicasaFileUtil::~PicasaFileUtil() {} void PicasaFileUtil::GetFileInfoOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) { PicasaDataProvider* data_provider = GetDataProvider(); // |data_provider| may be NULL if the file system was revoked before this @@ -106,8 +106,8 @@ void PicasaFileUtil::GetFileInfoOnTaskRunnerThread( } void PicasaFileUtil::ReadDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) { PicasaDataProvider* data_provider = GetDataProvider(); // |data_provider| may be NULL if the file system was revoked before this @@ -184,8 +184,8 @@ base::File::Error PicasaFileUtil::GetFileInfoSync( } base::File::Error PicasaFileUtil::ReadDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, EntryList* file_list) { DCHECK(context); DCHECK(file_list); @@ -256,11 +256,11 @@ base::File::Error PicasaFileUtil::ReadDirectorySync( for (AlbumImages::const_iterator it = album_images->begin(); it != album_images->end(); ++it) { - fileapi::DirectoryEntry entry; + storage::DirectoryEntry entry; base::File::Info info; // Simply skip files that we can't get info on. - if (fileapi::NativeFileUtil::GetFileInfo(it->second, &info) != + if (storage::NativeFileUtil::GetFileInfo(it->second, &info) != base::File::FILE_OK) { continue; } @@ -291,14 +291,14 @@ base::File::Error PicasaFileUtil::ReadDirectorySync( } base::File::Error PicasaFileUtil::DeleteDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) { + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) { return base::File::FILE_ERROR_SECURITY; } base::File::Error PicasaFileUtil::DeleteFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) { + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) { return base::File::FILE_ERROR_SECURITY; } @@ -369,8 +369,8 @@ base::File::Error PicasaFileUtil::GetLocalFilePath( } void PicasaFileUtil::GetFileInfoWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback, bool success) { if (!success) { @@ -385,8 +385,8 @@ void PicasaFileUtil::GetFileInfoWithFreshDataProvider( } void PicasaFileUtil::ReadDirectoryWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback, bool success) { if (!success) { diff --git a/chrome/browser/media_galleries/fileapi/picasa_file_util.h b/chrome/browser/media_galleries/fileapi/picasa_file_util.h index 4b77c24..490516c 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_file_util.h +++ b/chrome/browser/media_galleries/fileapi/picasa_file_util.h @@ -33,42 +33,42 @@ class PicasaFileUtil : public NativeMediaFileUtil { protected: // NativeMediaFileUtil overrides. virtual void GetFileInfoOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback) OVERRIDE; virtual void ReadDirectoryOnTaskRunnerThread( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; virtual base::File::Error GetFileInfoSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::File::Info* file_info, base::FilePath* platform_path) OVERRIDE; virtual base::File::Error ReadDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, EntryList* file_list) OVERRIDE; virtual base::File::Error DeleteDirectorySync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) OVERRIDE; + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) OVERRIDE; virtual base::File::Error DeleteFileSync( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url) OVERRIDE; + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url) OVERRIDE; virtual base::File::Error GetLocalFilePath( - fileapi::FileSystemOperationContext* context, - const fileapi::FileSystemURL& url, + storage::FileSystemOperationContext* context, + const storage::FileSystemURL& url, base::FilePath* local_file_path) OVERRIDE; private: void GetFileInfoWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const GetFileInfoCallback& callback, bool success); void ReadDirectoryWithFreshDataProvider( - scoped_ptr<fileapi::FileSystemOperationContext> context, - const fileapi::FileSystemURL& url, + scoped_ptr<storage::FileSystemOperationContext> context, + const storage::FileSystemURL& url, const ReadDirectoryCallback& callback, bool success); diff --git a/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc index c8b1710..f793b35 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc @@ -37,9 +37,9 @@ #include "webkit/browser/fileapi/isolated_context.h" #include "webkit/common/blob/shareable_file_reference.h" -using fileapi::FileSystemOperationContext; -using fileapi::FileSystemOperation; -using fileapi::FileSystemURL; +using storage::FileSystemOperationContext; +using storage::FileSystemOperation; +using storage::FileSystemURL; namespace picasa { @@ -142,7 +142,7 @@ void ReadDirectoryTestHelperCallback( run_loop->Quit(); } -void ReadDirectoryTestHelper(fileapi::FileSystemOperationRunner* runner, +void ReadDirectoryTestHelper(storage::FileSystemOperationRunner* runner, const FileSystemURL& url, FileSystemOperation::FileEntryList* contents, bool* completed) { @@ -171,7 +171,7 @@ void CreateSnapshotFileTestHelperCallback( base::File::Error result, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + const scoped_refptr<storage::ShareableFileReference>& file_ref) { DCHECK(run_loop); DCHECK(error); DCHECK(platform_path_result); @@ -207,16 +207,16 @@ class TestMediaFileSystemBackend : public MediaFileSystemBackend { MediaFileSystemBackend::MediaTaskRunner().get()), test_file_util_(picasa_file_util) {} - virtual fileapi::AsyncFileUtil* - GetAsyncFileUtil(fileapi::FileSystemType type) OVERRIDE { - if (type != fileapi::kFileSystemTypePicasa) + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE { + if (type != storage::kFileSystemTypePicasa) return NULL; return test_file_util_.get(); } private: - scoped_ptr<fileapi::AsyncFileUtil> test_file_util_; + scoped_ptr<storage::AsyncFileUtil> test_file_util_; }; class PicasaFileUtilTest : public testing::Test { @@ -230,7 +230,7 @@ class PicasaFileUtilTest : public testing::Test { ASSERT_TRUE(profile_dir_.CreateUniqueTempDir()); ImportedMediaGalleryRegistry::GetInstance()->Initialize(); - scoped_refptr<quota::SpecialStoragePolicy> storage_policy = + scoped_refptr<storage::SpecialStoragePolicy> storage_policy = new content::MockSpecialStoragePolicy(); SynchronouslyRunOnMediaTaskRunner(base::Bind( @@ -238,20 +238,20 @@ class PicasaFileUtilTest : public testing::Test { media_path_filter_.reset(new MediaPathFilter()); - ScopedVector<fileapi::FileSystemBackend> additional_providers; + ScopedVector<storage::FileSystemBackend> additional_providers; additional_providers.push_back(new TestMediaFileSystemBackend( profile_dir_.path(), new TestPicasaFileUtil(media_path_filter_.get(), picasa_data_provider_.get()))); - file_system_context_ = new fileapi::FileSystemContext( + file_system_context_ = new storage::FileSystemContext( base::MessageLoopProxy::current().get(), base::MessageLoopProxy::current().get(), - fileapi::ExternalMountPoints::CreateRefCounted().get(), + storage::ExternalMountPoints::CreateRefCounted().get(), storage_policy.get(), NULL, additional_providers.Pass(), - std::vector<fileapi::URLRequestAutoMountHandler>(), + std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(), content::CreateAllowFileAccessOptions()); } @@ -363,15 +363,16 @@ class PicasaFileUtilTest : public testing::Test { virtual_path = virtual_path.AppendASCII("picasa"); virtual_path = virtual_path.AppendASCII(path); return file_system_context_->CreateCrackedFileSystemURL( - GURL("http://www.example.com"), fileapi::kFileSystemTypePicasa, + GURL("http://www.example.com"), + storage::kFileSystemTypePicasa, virtual_path); } - fileapi::FileSystemOperationRunner* operation_runner() const { + storage::FileSystemOperationRunner* operation_runner() const { return file_system_context_->operation_runner(); } - scoped_refptr<fileapi::FileSystemContext> file_system_context() const { + scoped_refptr<storage::FileSystemContext> file_system_context() const { return file_system_context_; } @@ -381,7 +382,7 @@ class PicasaFileUtilTest : public testing::Test { base::ScopedTempDir profile_dir_; - scoped_refptr<fileapi::FileSystemContext> file_system_context_; + scoped_refptr<storage::FileSystemContext> file_system_context_; scoped_ptr<PicasaDataProvider> picasa_data_provider_; scoped_ptr<MediaPathFilter> media_path_filter_; @@ -583,7 +584,7 @@ TEST_F(PicasaFileUtilTest, AlbumContents) { base::RunLoop loop; base::File::Error error; base::FilePath platform_path_result; - fileapi::FileSystemOperationRunner::SnapshotFileCallback snapshot_callback = + storage::FileSystemOperationRunner::SnapshotFileCallback snapshot_callback = base::Bind(&CreateSnapshotFileTestHelperCallback, &loop, &error, diff --git a/chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.cc b/chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.cc index e2acb94..2aaa2ed 100644 --- a/chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.cc +++ b/chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.cc @@ -11,7 +11,7 @@ #include "net/base/io_buffer.h" #include "net/base/net_errors.h" -using webkit_blob::FileStreamReader; +using storage::FileStreamReader; namespace { diff --git a/chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.h b/chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.h index b6ef754..44ec7aa 100644 --- a/chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.h +++ b/chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.h @@ -13,10 +13,10 @@ // Wraps a source FileStreamReader with a readahead buffer. class ReadaheadFileStreamReader - : public NON_EXPORTED_BASE(webkit_blob::FileStreamReader) { + : public NON_EXPORTED_BASE(storage::FileStreamReader) { public: // Takes ownership of |source|. - explicit ReadaheadFileStreamReader(webkit_blob::FileStreamReader* source); + explicit ReadaheadFileStreamReader(storage::FileStreamReader* source); virtual ~ReadaheadFileStreamReader(); @@ -38,7 +38,7 @@ class ReadaheadFileStreamReader void OnFinishReadFromSource(net::IOBuffer* buffer, int result); // This is reset to NULL upon encountering a read error or EOF. - scoped_ptr<webkit_blob::FileStreamReader> source_; + scoped_ptr<storage::FileStreamReader> source_; // This stores the error or EOF from the source FileStreamReader. Its // value is undefined if |source_| is non-NULL. diff --git a/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc b/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc index 24cc894..9d8ebde 100644 --- a/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc +++ b/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.cc @@ -19,10 +19,8 @@ SafeAudioVideoChecker::SafeAudioVideoChecker( base::File file, - const fileapi::CopyOrMoveFileValidator::ResultCallback& callback) - : state_(INITIAL_STATE), - file_(file.Pass()), - callback_(callback) { + const storage::CopyOrMoveFileValidator::ResultCallback& callback) + : state_(INITIAL_STATE), file_(file.Pass()), callback_(callback) { DCHECK(!callback.is_null()); } diff --git a/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.h b/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.h index c791e6ed..9fbfb87 100644 --- a/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.h +++ b/chrome/browser/media_galleries/fileapi/safe_audio_video_checker.h @@ -26,7 +26,7 @@ class SafeAudioVideoChecker : public content::UtilityProcessHostClient { // Takes responsibility for closing |file|. SafeAudioVideoChecker( base::File file, - const fileapi::CopyOrMoveFileValidator::ResultCallback& callback); + const storage::CopyOrMoveFileValidator::ResultCallback& callback); // Must be called on the IO thread. void Start(); @@ -55,7 +55,7 @@ class SafeAudioVideoChecker : public content::UtilityProcessHostClient { base::File file_; - const fileapi::CopyOrMoveFileValidator::ResultCallback callback_; + const storage::CopyOrMoveFileValidator::ResultCallback callback_; base::WeakPtr<content::UtilityProcessHost> utility_process_host_; diff --git a/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.cc b/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.cc index 6efb849..6501064 100644 --- a/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.cc +++ b/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.cc @@ -63,7 +63,7 @@ bool SupportedAudioVideoChecker::SupportsFileType(const base::FilePath& path) { } void SupportedAudioVideoChecker::StartPreWriteValidation( - const fileapi::CopyOrMoveFileValidator::ResultCallback& result_callback) { + const storage::CopyOrMoveFileValidator::ResultCallback& result_callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK(callback_.is_null()); callback_ = result_callback; diff --git a/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h b/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h index 7d319cc..55f306c 100644 --- a/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h +++ b/chrome/browser/media_galleries/fileapi/supported_audio_video_checker.h @@ -36,7 +36,7 @@ class SupportedAudioVideoChecker : public AVScanningFileValidator { void OnFileOpen(base::File file); base::FilePath path_; - fileapi::CopyOrMoveFileValidator::ResultCallback callback_; + storage::CopyOrMoveFileValidator::ResultCallback callback_; scoped_refptr<SafeAudioVideoChecker> safe_checker_; base::WeakPtrFactory<SupportedAudioVideoChecker> weak_factory_; diff --git a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc index 53ac37c..f216570 100644 --- a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc +++ b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc @@ -51,9 +51,8 @@ class ImageDecoderDelegateAdapter : public ImageDecoder::Delegate { public: ImageDecoderDelegateAdapter( scoped_ptr<std::string> data, - const fileapi::CopyOrMoveFileValidator::ResultCallback& callback) - : data_(data.Pass()), - callback_(callback) { + const storage::CopyOrMoveFileValidator::ResultCallback& callback) + : data_(data.Pass()), callback_(callback) { DCHECK(data_); } @@ -75,7 +74,7 @@ class ImageDecoderDelegateAdapter : public ImageDecoder::Delegate { private: scoped_ptr<std::string> data_; - fileapi::CopyOrMoveFileValidator::ResultCallback callback_; + storage::CopyOrMoveFileValidator::ResultCallback callback_; DISALLOW_COPY_AND_ASSIGN(ImageDecoderDelegateAdapter); }; diff --git a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h index 75dea9c..670a8af 100644 --- a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h +++ b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.h @@ -35,7 +35,7 @@ class SupportedImageTypeValidator : public AVScanningFileValidator { base::FilePath path_; scoped_refptr<ImageDecoder> decoder_; - fileapi::CopyOrMoveFileValidator::ResultCallback callback_; + storage::CopyOrMoveFileValidator::ResultCallback callback_; base::WeakPtrFactory<SupportedImageTypeValidator> weak_factory_; DISALLOW_COPY_AND_ASSIGN(SupportedImageTypeValidator); diff --git a/chrome/browser/media_galleries/imported_media_gallery_registry.cc b/chrome/browser/media_galleries/imported_media_gallery_registry.cc index 5acc6b2..a1c6cf4 100644 --- a/chrome/browser/media_galleries/imported_media_gallery_registry.cc +++ b/chrome/browser/media_galleries/imported_media_gallery_registry.cc @@ -17,7 +17,7 @@ #include "webkit/common/fileapi/file_system_mount_option.h" using base::Bind; -using fileapi::ExternalMountPoints; +using storage::ExternalMountPoints; namespace { @@ -55,7 +55,9 @@ bool ImportedMediaGalleryRegistry::RegisterPicasaFilesystemOnUIThread( if (root.empty()) return false; result = ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( - fs_name, fileapi::kFileSystemTypePicasa, fileapi::FileSystemMountOption(), + fs_name, + storage::kFileSystemTypePicasa, + storage::FileSystemMountOption(), root.AppendASCII("picasa")); if (!result) return result; @@ -90,7 +92,9 @@ bool ImportedMediaGalleryRegistry::RegisterITunesFilesystemOnUIThread( if (root.empty()) return false; result = ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( - fs_name, fileapi::kFileSystemTypeItunes, fileapi::FileSystemMountOption(), + fs_name, + storage::kFileSystemTypeItunes, + storage::FileSystemMountOption(), root.AppendASCII("itunes")); if (!result) return result; @@ -127,7 +131,9 @@ bool ImportedMediaGalleryRegistry::RegisterIPhotoFilesystemOnUIThread( if (root.empty()) return false; result = ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( - fs_name, fileapi::kFileSystemTypeIphoto, fileapi::FileSystemMountOption(), + fs_name, + storage::kFileSystemTypeIphoto, + storage::FileSystemMountOption(), root.AppendASCII("iphoto")); if (!result) return result; diff --git a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc index 947068f..2cc3f19 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc +++ b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.cc @@ -342,7 +342,7 @@ void MTPDeviceDelegateImplLinux::GetFileInfo( if (it != file_info_cache_.end()) { // TODO(thestig): This code is repeated in several places. Combine them. // e.g. c/b/media_galleries/win/mtp_device_operations_util.cc - const fileapi::DirectoryEntry& cached_file_entry = it->second; + const storage::DirectoryEntry& cached_file_entry = it->second; base::File::Info info; info.size = cached_file_entry.size; info.is_directory = cached_file_entry.is_directory; @@ -750,7 +750,7 @@ void MTPDeviceDelegateImplLinux::OnDidGetFileInfoToCreateSnapshotFile( void MTPDeviceDelegateImplLinux::OnDidReadDirectory( uint32 dir_id, const ReadDirectorySuccessCallback& success_callback, - const fileapi::AsyncFileUtil::EntryList& file_list, + const storage::AsyncFileUtil::EntryList& file_list, bool has_more) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); @@ -769,10 +769,10 @@ void MTPDeviceDelegateImplLinux::OnDidReadDirectory( for (size_t i = 0; i < dir_path_parts.size(); ++i) dir_path = dir_path.Append(dir_path_parts[i]); - fileapi::AsyncFileUtil::EntryList normalized_file_list; + storage::AsyncFileUtil::EntryList normalized_file_list; for (size_t i = 0; i < file_list.size(); ++i) { normalized_file_list.push_back(file_list[i]); - fileapi::DirectoryEntry& entry = normalized_file_list.back(); + storage::DirectoryEntry& entry = normalized_file_list.back(); // |entry.name| has the file id encoded in it. Decode here. size_t separator_idx = entry.name.find_last_of(','); @@ -834,7 +834,7 @@ void MTPDeviceDelegateImplLinux::OnDidReadBytes( void MTPDeviceDelegateImplLinux::OnDidFillFileCache( const base::FilePath& path, - const fileapi::AsyncFileUtil::EntryList& /* file_list */, + const storage::AsyncFileUtil::EntryList& /* file_list */, bool has_more) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK(path.IsParent(pending_tasks_.front().path)); diff --git a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h index 770c060..8136004 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h +++ b/chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h @@ -61,7 +61,7 @@ class MTPDeviceDelegateImplLinux : public MTPDeviceAsyncDelegate { typedef std::map<uint32, MTPFileNode*> FileIdToMTPFileNodeMap; // Maps file paths to file info. - typedef std::map<base::FilePath, fileapi::DirectoryEntry> FileInfoCache; + typedef std::map<base::FilePath, storage::DirectoryEntry> FileInfoCache; // Should only be called by CreateMTPDeviceAsyncDelegate() factory call. // Defer the device initializations until the first file operation request. @@ -186,7 +186,7 @@ class MTPDeviceDelegateImplLinux : public MTPDeviceAsyncDelegate { // |has_more| is true if there are more file entries to read. void OnDidReadDirectory(uint32 dir_id, const ReadDirectorySuccessCallback& success_callback, - const fileapi::AsyncFileUtil::EntryList& file_list, + const storage::AsyncFileUtil::EntryList& file_list, bool has_more); // Called when WriteDataIntoSnapshotFile() succeeds. @@ -216,7 +216,7 @@ class MTPDeviceDelegateImplLinux : public MTPDeviceAsyncDelegate { // Called when FillFileCache() succeeds. void OnDidFillFileCache(const base::FilePath& path, - const fileapi::AsyncFileUtil::EntryList& file_list, + const storage::AsyncFileUtil::EntryList& file_list, bool has_more); // Called when FillFileCache() fails. diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc b/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc index 0282c8a..b2e27e4 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc +++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.cc @@ -182,12 +182,12 @@ void MTPDeviceTaskHelper::OnDidReadDirectory( if (error) return HandleDeviceError(error_callback, base::File::FILE_ERROR_FAILED); - fileapi::AsyncFileUtil::EntryList entries; + storage::AsyncFileUtil::EntryList entries; base::FilePath current; MTPDeviceObjectEnumerator file_enum(file_entries); while (!(current = file_enum.Next()).empty()) { - fileapi::DirectoryEntry entry; - entry.name = fileapi::VirtualPath::BaseName(current).value(); + storage::DirectoryEntry entry; + entry.name = storage::VirtualPath::BaseName(current).value(); uint32 file_id = 0; bool ret = file_enum.GetEntryId(&file_id); DCHECK(ret); diff --git a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h index f24251e..f250536 100644 --- a/chrome/browser/media_galleries/linux/mtp_device_task_helper.h +++ b/chrome/browser/media_galleries/linux/mtp_device_task_helper.h @@ -33,7 +33,7 @@ class MTPDeviceTaskHelper { // NOTE: The file names in the entry list have their file id appended at the // end. e.g. foo.jpg with file id 45 becomes foo.jpg,45. - typedef base::Callback<void(const fileapi::AsyncFileUtil::EntryList& entries, + typedef base::Callback<void(const storage::AsyncFileUtil::EntryList& entries, bool has_more)> ReadDirectorySuccessCallback; typedef MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback; diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm index 8bd2167..567d1c1 100644 --- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm +++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.mm @@ -370,7 +370,7 @@ void MTPDeviceDelegateImplMac::NotifyReadDir() { // where we find the entry for the directory, then read out all first-level // children. We then break when the DirName is greater than the read_path, // as that means we've passed the subdir we're reading. - fileapi::AsyncFileUtil::EntryList entry_list; + storage::AsyncFileUtil::EntryList entry_list; bool found_path = false; for (size_t i = 0; i < file_paths_.size(); ++i) { if (file_paths_[i] == read_path) { @@ -388,7 +388,7 @@ void MTPDeviceDelegateImplMac::NotifyReadDir() { base::FilePath relative_path; read_path.AppendRelativePath(file_paths_[i], &relative_path); base::File::Info info = file_info_[file_paths_[i].value()]; - fileapi::DirectoryEntry entry; + storage::DirectoryEntry entry; entry.name = relative_path.value(); entry.is_directory = info.is_directory; entry.size = info.size; diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm index 17c23ad..b32235b 100644 --- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm +++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm @@ -203,7 +203,7 @@ class MTPDeviceDelegateImplMacTest : public testing::Test { } void OnReadDir(base::WaitableEvent* event, - const fileapi::AsyncFileUtil::EntryList& files, + const storage::AsyncFileUtil::EntryList& files, bool has_more) { error_ = base::File::FILE_OK; ASSERT_FALSE(has_more); @@ -212,7 +212,7 @@ class MTPDeviceDelegateImplMacTest : public testing::Test { } void OverlappedOnReadDir(base::WaitableEvent* event, - const fileapi::AsyncFileUtil::EntryList& files, + const storage::AsyncFileUtil::EntryList& files, bool has_more) { overlapped_error_ = base::File::FILE_OK; ASSERT_FALSE(has_more); @@ -294,10 +294,10 @@ class MTPDeviceDelegateImplMacTest : public testing::Test { base::File::Error error_; base::File::Info info_; - fileapi::AsyncFileUtil::EntryList file_list_; + storage::AsyncFileUtil::EntryList file_list_; base::File::Error overlapped_error_; - fileapi::AsyncFileUtil::EntryList overlapped_file_list_; + storage::AsyncFileUtil::EntryList overlapped_file_list_; private: DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplMacTest); diff --git a/chrome/browser/media_galleries/media_file_system_registry.cc b/chrome/browser/media_galleries/media_file_system_registry.cc index ad06354..dadead5 100644 --- a/chrome/browser/media_galleries/media_file_system_registry.cc +++ b/chrome/browser/media_galleries/media_file_system_registry.cc @@ -46,7 +46,7 @@ using content::BrowserThread; using content::NavigationController; using content::RenderProcessHost; using content::WebContents; -using fileapi::ExternalMountPoints; +using storage::ExternalMountPoints; using storage_monitor::MediaStorageUtil; using storage_monitor::StorageInfo; using storage_monitor::StorageMonitor; @@ -703,8 +703,10 @@ class MediaFileSystemRegistry::MediaFileSystemContextImpl result = registry->RegisterIPhotoFilesystemOnUIThread(fs_name, path); } else { result = ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( - fs_name, fileapi::kFileSystemTypeNativeMedia, - fileapi::FileSystemMountOption(), path); + fs_name, + storage::kFileSystemTypeNativeMedia, + storage::FileSystemMountOption(), + path); } return result; } @@ -718,8 +720,10 @@ class MediaFileSystemRegistry::MediaFileSystemContextImpl // Sanity checks for |path|. CHECK(MediaStorageUtil::CanCreateFileSystem(device_id, path)); bool result = ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( - fs_name, fileapi::kFileSystemTypeDeviceMedia, - fileapi::FileSystemMountOption(), path); + fs_name, + storage::kFileSystemTypeDeviceMedia, + storage::FileSystemMountOption(), + path); CHECK(result); BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( &MTPDeviceMapService::RegisterMTPFileSystem, diff --git a/chrome/browser/media_galleries/media_file_system_registry.h b/chrome/browser/media_galleries/media_file_system_registry.h index d6d0d16..8c120d4 100644 --- a/chrome/browser/media_galleries/media_file_system_registry.h +++ b/chrome/browser/media_galleries/media_file_system_registry.h @@ -36,7 +36,7 @@ namespace extensions { class Extension; } -namespace fileapi { +namespace storage { class IsolatedContext; } diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc index 0f21438..e21a4a2 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc @@ -180,7 +180,7 @@ base::File::Error GetFileInfoOnBlockingPoolThread( base::File::Error ReadDirectoryOnBlockingPoolThread( const MTPDeviceDelegateImplWin::StorageDeviceInfo& device_info, const base::FilePath& root, - fileapi::AsyncFileUtil::EntryList* entries) { + storage::AsyncFileUtil::EntryList* entries) { base::ThreadRestrictions::AssertIOAllowed(); DCHECK(!root.empty()); DCHECK(entries); @@ -200,9 +200,9 @@ base::File::Error ReadDirectoryOnBlockingPoolThread( return error; while (!(current = file_enum->Next()).empty()) { - fileapi::DirectoryEntry entry; + storage::DirectoryEntry entry; entry.is_directory = file_enum->IsDirectory(); - entry.name = fileapi::VirtualPath::BaseName(current).value(); + entry.name = storage::VirtualPath::BaseName(current).value(); entry.size = file_enum->Size(); entry.last_modified_time = file_enum->LastModifiedTime(); entries->push_back(entry); @@ -402,8 +402,8 @@ void MTPDeviceDelegateImplWin::ReadDirectory( const ErrorCallback& error_callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK(!root.empty()); - fileapi::AsyncFileUtil::EntryList* entries = - new fileapi::AsyncFileUtil::EntryList; + storage::AsyncFileUtil::EntryList* entries = + new storage::AsyncFileUtil::EntryList; EnsureInitAndRunTask( PendingTaskInfo(FROM_HERE, base::Bind(&ReadDirectoryOnBlockingPoolThread, @@ -546,7 +546,7 @@ void MTPDeviceDelegateImplWin::OnGetFileInfo( void MTPDeviceDelegateImplWin::OnDidReadDirectory( const ReadDirectorySuccessCallback& success_callback, const ErrorCallback& error_callback, - fileapi::AsyncFileUtil::EntryList* file_list, + storage::AsyncFileUtil::EntryList* file_list, base::File::Error error) { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK(file_list); diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h index e88b7c2..f4f53ff 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h @@ -159,7 +159,7 @@ class MTPDeviceDelegateImplWin : public MTPDeviceAsyncDelegate { // is invoked to notify the caller about the platform file |error|. void OnDidReadDirectory(const ReadDirectorySuccessCallback& success_callback, const ErrorCallback& error_callback, - fileapi::AsyncFileUtil::EntryList* file_list, + storage::AsyncFileUtil::EntryList* file_list, base::File::Error error); // Called when the get file stream request completes. diff --git a/chrome/browser/net/sqlite_channel_id_store.cc b/chrome/browser/net/sqlite_channel_id_store.cc index 15bad3d..374a5dc 100644 --- a/chrome/browser/net/sqlite_channel_id_store.cc +++ b/chrome/browser/net/sqlite_channel_id_store.cc @@ -36,7 +36,7 @@ class SQLiteChannelIDStore::Backend Backend( const base::FilePath& path, const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, - quota::SpecialStoragePolicy* special_storage_policy) + storage::SpecialStoragePolicy* special_storage_policy) : path_(path), num_pending_(0), force_keep_session_state_(false), @@ -130,7 +130,7 @@ class SQLiteChannelIDStore::Backend scoped_refptr<base::SequencedTaskRunner> background_task_runner_; - scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; + scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; // Indicates if the kill-database callback has been scheduled. bool corruption_detected_; @@ -610,10 +610,10 @@ void SQLiteChannelIDStore::Backend::SetForceKeepSessionState() { SQLiteChannelIDStore::SQLiteChannelIDStore( const base::FilePath& path, const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, - quota::SpecialStoragePolicy* special_storage_policy) - : backend_(new Backend(path, - background_task_runner, - special_storage_policy)) {} + storage::SpecialStoragePolicy* special_storage_policy) + : backend_( + new Backend(path, background_task_runner, special_storage_policy)) { +} void SQLiteChannelIDStore::Load( const LoadedCallback& loaded_callback) { diff --git a/chrome/browser/net/sqlite_channel_id_store.h b/chrome/browser/net/sqlite_channel_id_store.h index 13fe532..e9eba39 100644 --- a/chrome/browser/net/sqlite_channel_id_store.h +++ b/chrome/browser/net/sqlite_channel_id_store.h @@ -15,7 +15,7 @@ class FilePath; class SequencedTaskRunner; } -namespace quota { +namespace storage { class SpecialStoragePolicy; } @@ -31,7 +31,7 @@ class SQLiteChannelIDStore SQLiteChannelIDStore( const base::FilePath& path, const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, - quota::SpecialStoragePolicy* special_storage_policy); + storage::SpecialStoragePolicy* special_storage_policy); // net::DefaultChannelIDStore::PersistentStore: virtual void Load(const LoadedCallback& loaded_callback) OVERRIDE; diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc index 263ccbb..d8ee11c 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl.cc @@ -372,7 +372,7 @@ content::BrowserPluginGuestManager* OffTheRecordProfileImpl::GetGuestManager() { #endif } -quota::SpecialStoragePolicy* +storage::SpecialStoragePolicy* OffTheRecordProfileImpl::GetSpecialStoragePolicy() { return GetExtensionSpecialStoragePolicy(); } diff --git a/chrome/browser/profiles/off_the_record_profile_impl.h b/chrome/browser/profiles/off_the_record_profile_impl.h index 0eaf87f..750d5193 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.h +++ b/chrome/browser/profiles/off_the_record_profile_impl.h @@ -103,7 +103,7 @@ class OffTheRecordProfileImpl : public Profile { bool in_memory) OVERRIDE; virtual content::ResourceContext* GetResourceContext() OVERRIDE; virtual content::BrowserPluginGuestManager* GetGuestManager() OVERRIDE; - virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; + virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; virtual content::PushMessagingService* GetPushMessagingService() OVERRIDE; virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() OVERRIDE; diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h index eb65083..87a4c5f 100644 --- a/chrome/browser/profiles/profile.h +++ b/chrome/browser/profiles/profile.h @@ -49,7 +49,7 @@ namespace content { class WebUI; } -namespace fileapi { +namespace storage { class FileSystemContext; } diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 9520058..bfe1a9b 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -1144,7 +1144,7 @@ DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() { GetDownloadManagerDelegate(); } -quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { +storage::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { #if defined(ENABLE_EXTENSIONS) return GetExtensionSpecialStoragePolicy(); #else diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h index 3869b9a..907b474 100644 --- a/chrome/browser/profiles/profile_impl.h +++ b/chrome/browser/profiles/profile_impl.h @@ -90,7 +90,7 @@ class ProfileImpl : public Profile { bool in_memory) OVERRIDE; virtual content::ResourceContext* GetResourceContext() OVERRIDE; virtual content::BrowserPluginGuestManager* GetGuestManager() OVERRIDE; - virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; + virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; virtual content::PushMessagingService* GetPushMessagingService() OVERRIDE; virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() OVERRIDE; diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index 014b6a8..11a6fae 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc @@ -120,25 +120,25 @@ ProfileImplIOData::Handle::~Handle() { } void ProfileImplIOData::Handle::Init( - const base::FilePath& cookie_path, - const base::FilePath& channel_id_path, - const base::FilePath& cache_path, - int cache_max_size, - const base::FilePath& media_cache_path, - int media_cache_max_size, - const base::FilePath& extensions_cookie_path, - const base::FilePath& profile_path, - const base::FilePath& infinite_cache_path, - chrome_browser_net::Predictor* predictor, - content::CookieStoreConfig::SessionCookieMode session_cookie_mode, - quota::SpecialStoragePolicy* special_storage_policy, - scoped_ptr<domain_reliability::DomainReliabilityMonitor> - domain_reliability_monitor, - const base::Callback<void(bool)>& data_reduction_proxy_unavailable, - scoped_ptr<DataReductionProxyChromeConfigurator> - data_reduction_proxy_chrome_configurator, - scoped_ptr<data_reduction_proxy::DataReductionProxyParams> - data_reduction_proxy_params) { + const base::FilePath& cookie_path, + const base::FilePath& channel_id_path, + const base::FilePath& cache_path, + int cache_max_size, + const base::FilePath& media_cache_path, + int media_cache_max_size, + const base::FilePath& extensions_cookie_path, + const base::FilePath& profile_path, + const base::FilePath& infinite_cache_path, + chrome_browser_net::Predictor* predictor, + content::CookieStoreConfig::SessionCookieMode session_cookie_mode, + storage::SpecialStoragePolicy* special_storage_policy, + scoped_ptr<domain_reliability::DomainReliabilityMonitor> + domain_reliability_monitor, + const base::Callback<void(bool)>& data_reduction_proxy_unavailable, + scoped_ptr<DataReductionProxyChromeConfigurator> + data_reduction_proxy_chrome_configurator, + scoped_ptr<data_reduction_proxy::DataReductionProxyParams> + data_reduction_proxy_params) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!io_data_->lazy_params_); DCHECK(predictor); diff --git a/chrome/browser/profiles/profile_impl_io_data.h b/chrome/browser/profiles/profile_impl_io_data.h index 3c871bf..4283d30 100644 --- a/chrome/browser/profiles/profile_impl_io_data.h +++ b/chrome/browser/profiles/profile_impl_io_data.h @@ -43,9 +43,9 @@ class ProxyConfig; class SDCHManager; } // namespace net -namespace quota { +namespace storage { class SpecialStoragePolicy; -} // namespace quota +} // namespace storage class DataReductionProxyChromeConfigurator; @@ -58,27 +58,26 @@ class ProfileImplIOData : public ProfileIOData { // Init() must be called before ~Handle(). It records most of the // parameters needed to construct a ChromeURLRequestContextGetter. - void Init(const base::FilePath& cookie_path, - const base::FilePath& channel_id_path, - const base::FilePath& cache_path, - int cache_max_size, - const base::FilePath& media_cache_path, - int media_cache_max_size, - const base::FilePath& extensions_cookie_path, - const base::FilePath& profile_path, - const base::FilePath& infinite_cache_path, - chrome_browser_net::Predictor* predictor, - content::CookieStoreConfig::SessionCookieMode - session_cookie_mode, - quota::SpecialStoragePolicy* special_storage_policy, - scoped_ptr<domain_reliability::DomainReliabilityMonitor> - domain_reliability_monitor, - const base::Callback<void(bool)>& - data_reduction_proxy_unavailable, - scoped_ptr<DataReductionProxyChromeConfigurator> - data_reduction_proxy_chrome_configurator, - scoped_ptr<data_reduction_proxy::DataReductionProxyParams> - data_reduction_proxy_params); + void Init( + const base::FilePath& cookie_path, + const base::FilePath& channel_id_path, + const base::FilePath& cache_path, + int cache_max_size, + const base::FilePath& media_cache_path, + int media_cache_max_size, + const base::FilePath& extensions_cookie_path, + const base::FilePath& profile_path, + const base::FilePath& infinite_cache_path, + chrome_browser_net::Predictor* predictor, + content::CookieStoreConfig::SessionCookieMode session_cookie_mode, + storage::SpecialStoragePolicy* special_storage_policy, + scoped_ptr<domain_reliability::DomainReliabilityMonitor> + domain_reliability_monitor, + const base::Callback<void(bool)>& data_reduction_proxy_unavailable, + scoped_ptr<DataReductionProxyChromeConfigurator> + data_reduction_proxy_chrome_configurator, + scoped_ptr<data_reduction_proxy::DataReductionProxyParams> + data_reduction_proxy_params); // These Create*ContextGetter() functions are only exposed because the // circular relationship between Profile, ProfileIOData::Handle, and the @@ -175,7 +174,7 @@ class ProfileImplIOData : public ProfileIOData { base::FilePath extensions_cookie_path; base::FilePath infinite_cache_path; content::CookieStoreConfig::SessionCookieMode session_cookie_mode; - scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy; + scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy; }; ProfileImplIOData(); diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc index f2d83fe..02c49e6 100644 --- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc +++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc @@ -116,8 +116,8 @@ std::string PepperIsolatedFileSystemMessageFilter::CreateCrxFileSystem( // First level directory for isolated filesystem to lookup. std::string kFirstLevelDirectory("crxfs"); - return fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForPath( - fileapi::kFileSystemTypeNativeLocal, + return storage::IsolatedContext::GetInstance()->RegisterFileSystemForPath( + storage::kFileSystemTypeNativeLocal, std::string(), extension->path(), &kFirstLevelDirectory); @@ -193,8 +193,8 @@ int32_t PepperIsolatedFileSystemMessageFilter::OpenPluginPrivateFileSystem( const std::string& root_name = ppapi::IsolatedFileSystemTypeToRootName( PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE); const std::string& fsid = - fileapi::IsolatedContext::GetInstance()->RegisterFileSystemForVirtualPath( - fileapi::kFileSystemTypePluginPrivate, root_name, base::FilePath()); + storage::IsolatedContext::GetInstance()->RegisterFileSystemForVirtualPath( + storage::kFileSystemTypePluginPrivate, root_name, base::FilePath()); // Grant full access of isolated filesystem to renderer process. content::ChildProcessSecurityPolicy* policy = diff --git a/chrome/browser/sessions/session_data_deleter.cc b/chrome/browser/sessions/session_data_deleter.cc index 2eba98c..9f8248f 100644 --- a/chrome/browser/sessions/session_data_deleter.cc +++ b/chrome/browser/sessions/session_data_deleter.cc @@ -29,7 +29,7 @@ void CookieDeleted(bool success) { class SessionDataDeleter : public base::RefCountedThreadSafe<SessionDataDeleter> { public: - SessionDataDeleter(quota::SpecialStoragePolicy* storage_policy, + SessionDataDeleter(storage::SpecialStoragePolicy* storage_policy, bool delete_only_by_session_only_policy); void Run(content::StoragePartition* storage_partition, @@ -59,17 +59,18 @@ class SessionDataDeleter void DeleteSessionOnlyOriginCookies(const net::CookieList& cookies); scoped_refptr<net::CookieMonster> cookie_monster_; - scoped_refptr<quota::SpecialStoragePolicy> storage_policy_; + scoped_refptr<storage::SpecialStoragePolicy> storage_policy_; const bool delete_only_by_session_only_policy_; DISALLOW_COPY_AND_ASSIGN(SessionDataDeleter); }; SessionDataDeleter::SessionDataDeleter( - quota::SpecialStoragePolicy* storage_policy, + storage::SpecialStoragePolicy* storage_policy, bool delete_only_by_session_only_policy) : storage_policy_(storage_policy), - delete_only_by_session_only_policy_(delete_only_by_session_only_policy) {} + delete_only_by_session_only_policy_(delete_only_by_session_only_policy) { +} void SessionDataDeleter::Run(content::StoragePartition* storage_partition, ProfileIOData* profile_io_data) { diff --git a/chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.cc b/chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.cc index d0d4c0f..4ff5ad9 100644 --- a/chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.cc @@ -39,8 +39,7 @@ namespace drive_backend { namespace { -fileapi::FileSystemURL URL(const GURL& origin, - const std::string& path) { +storage::FileSystemURL URL(const GURL& origin, const std::string& path) { return CreateSyncableFileSystemURL( origin, base::FilePath::FromUTF8Unsafe(path)); } @@ -155,7 +154,7 @@ class ConflictResolverTest : public testing::Test { return file_id; } - void CreateLocalFile(const fileapi::FileSystemURL& url) { + void CreateLocalFile(const storage::FileSystemURL& url) { remote_change_processor_->UpdateLocalFileMetadata( url, FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, SYNC_FILE_TYPE_FILE)); @@ -189,9 +188,8 @@ class ConflictResolverTest : public testing::Test { return status; } - SyncStatusCode RunLocalToRemoteSyncer( - const fileapi::FileSystemURL& url, - const FileChange& file_change) { + SyncStatusCode RunLocalToRemoteSyncer(const storage::FileSystemURL& url, + const FileChange& file_change) { SyncStatusCode status = SYNC_STATUS_UNKNOWN; base::FilePath local_path = base::FilePath(FILE_PATH_LITERAL("dummy")); if (file_change.IsAddOrUpdate()) @@ -384,7 +382,7 @@ TEST_F(ConflictResolverTest, ResolveConflict_RemoteFolderOnLocalFile) { RunRemoteToLocalSyncerUntilIdle(); const std::string kTitle = "foo"; - fileapi::FileSystemURL kURL = URL(kOrigin, kTitle); + storage::FileSystemURL kURL = URL(kOrigin, kTitle); // Create a file on local and sync it. CreateLocalFile(kURL); @@ -431,7 +429,7 @@ TEST_F(ConflictResolverTest, ResolveConflict_RemoteNestedFolderOnLocalFile) { RunRemoteToLocalSyncerUntilIdle(); const std::string kTitle = "foo"; - fileapi::FileSystemURL kURL = URL(kOrigin, kTitle); + storage::FileSystemURL kURL = URL(kOrigin, kTitle); // Create a file on local and sync it. CreateLocalFile(kURL); diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc b/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc index d04e358..8b6c72a 100644 --- a/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc @@ -41,7 +41,7 @@ namespace sync_file_system { namespace drive_backend { -typedef fileapi::FileSystemOperation::FileEntryList FileEntryList; +typedef storage::FileSystemOperation::FileEntryList FileEntryList; namespace { @@ -55,9 +55,9 @@ void SetValueAndCallClosure(const base::Closure& closure, void SetSyncStatusAndUrl(const base::Closure& closure, SyncStatusCode* status_out, - fileapi::FileSystemURL* url_out, + storage::FileSystemURL* url_out, SyncStatusCode status, - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { *status_out = status; *url_out = url; closure.Run(); @@ -165,12 +165,12 @@ class DriveBackendSyncTest : public testing::Test, } protected: - fileapi::FileSystemURL CreateURL(const std::string& app_id, + storage::FileSystemURL CreateURL(const std::string& app_id, const base::FilePath::StringType& path) { return CreateURL(app_id, base::FilePath(path)); } - fileapi::FileSystemURL CreateURL(const std::string& app_id, + storage::FileSystemURL CreateURL(const std::string& app_id, const base::FilePath& path) { GURL origin = extensions::Extension::GetBaseURLFromExtensionId(app_id); return CreateSyncableFileSystemURL(origin, path); @@ -273,7 +273,7 @@ class DriveBackendSyncTest : public testing::Test, void AddOrUpdateLocalFile(const std::string& app_id, const base::FilePath::StringType& path, const std::string& content) { - fileapi::FileSystemURL url(CreateURL(app_id, path)); + storage::FileSystemURL url(CreateURL(app_id, path)); ASSERT_TRUE(ContainsKey(file_systems_, app_id)); EXPECT_EQ(base::File::FILE_OK, file_systems_[app_id]->CreateFile(url)); int64 bytes_written = file_systems_[app_id]->WriteString(url, content); @@ -303,7 +303,7 @@ class DriveBackendSyncTest : public testing::Test, SyncStatusCode ProcessLocalChange() { SyncStatusCode status = SYNC_STATUS_UNKNOWN; - fileapi::FileSystemURL url; + storage::FileSystemURL url; base::RunLoop run_loop; local_sync_service_->ProcessLocalChange(base::Bind( &SetSyncStatusAndUrl, run_loop.QuitClosure(), &status, &url)); @@ -313,7 +313,7 @@ class DriveBackendSyncTest : public testing::Test, SyncStatusCode ProcessRemoteChange() { SyncStatusCode status = SYNC_STATUS_UNKNOWN; - fileapi::FileSystemURL url; + storage::FileSystemURL url; base::RunLoop run_loop; remote_sync_service_->ProcessRemoteChange(base::Bind( &SetSyncStatusAndUrl, run_loop.QuitClosure(), &status, &url)); @@ -462,18 +462,18 @@ class DriveBackendSyncTest : public testing::Test, remote_entry_by_title[remote_entry->title()] = remote_entry; } - fileapi::FileSystemURL url(CreateURL(app_id, path)); + storage::FileSystemURL url(CreateURL(app_id, path)); FileEntryList local_entries; EXPECT_EQ(base::File::FILE_OK, file_system->ReadDirectory(url, &local_entries)); for (FileEntryList::iterator itr = local_entries.begin(); itr != local_entries.end(); ++itr) { - const fileapi::DirectoryEntry& local_entry = *itr; - fileapi::FileSystemURL entry_url( + const storage::DirectoryEntry& local_entry = *itr; + storage::FileSystemURL entry_url( CreateURL(app_id, path.Append(local_entry.name))); std::string title = - fileapi::VirtualPath::BaseName(entry_url.path()).AsUTF8Unsafe(); + storage::VirtualPath::BaseName(entry_url.path()).AsUTF8Unsafe(); SCOPED_TRACE(testing::Message() << "Verifying entry: " << title); ASSERT_TRUE(ContainsKey(remote_entry_by_title, title)); @@ -500,7 +500,7 @@ class DriveBackendSyncTest : public testing::Test, const base::FilePath& path, const std::string& file_id, CannedSyncableFileSystem* file_system) { - fileapi::FileSystemURL url(CreateURL(app_id, path)); + storage::FileSystemURL url(CreateURL(app_id, path)); std::string file_content; EXPECT_EQ(google_apis::HTTP_SUCCESS, fake_drive_service_helper_->ReadFile(file_id, &file_content)); @@ -522,7 +522,7 @@ class DriveBackendSyncTest : public testing::Test, size_t result = 1; while (!folders.empty()) { - fileapi::FileSystemURL url(CreateURL(app_id, folders.top())); + storage::FileSystemURL url(CreateURL(app_id, folders.top())); folders.pop(); FileEntryList entries; diff --git a/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.cc b/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.cc index f3098e3..6584a08 100644 --- a/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.cc +++ b/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.cc @@ -66,7 +66,7 @@ void FakeSyncWorker::UninstallOrigin(const GURL& origin, void FakeSyncWorker::ProcessRemoteChange( const SyncFileCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); - callback.Run(SYNC_STATUS_OK, fileapi::FileSystemURL()); + callback.Run(SYNC_STATUS_OK, storage::FileSystemURL()); } void FakeSyncWorker::SetRemoteChangeProcessor( @@ -137,12 +137,11 @@ void FakeSyncWorker::PromoteDemotedChanges(const base::Closure& callback) { callback.Run(); } -void FakeSyncWorker::ApplyLocalChange( - const FileChange& local_change, - const base::FilePath& local_path, - const SyncFileMetadata& local_metadata, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) { +void FakeSyncWorker::ApplyLocalChange(const FileChange& local_change, + const base::FilePath& local_path, + const SyncFileMetadata& local_metadata, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); callback.Run(SYNC_STATUS_OK); } diff --git a/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h b/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h index 59a2af3..7ede698 100644 --- a/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h +++ b/chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h @@ -29,7 +29,7 @@ class DriveServiceInterface; class DriveUploaderInterface; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -74,12 +74,11 @@ class FakeSyncWorker : public SyncWorkerInterface { virtual scoped_ptr<base::ListValue> DumpDatabase() OVERRIDE; virtual void SetSyncEnabled(bool enabled) OVERRIDE; virtual void PromoteDemotedChanges(const base::Closure& callback) OVERRIDE; - virtual void ApplyLocalChange( - const FileChange& local_change, - const base::FilePath& local_path, - const SyncFileMetadata& local_metadata, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) OVERRIDE; + virtual void ApplyLocalChange(const FileChange& local_change, + const base::FilePath& local_path, + const SyncFileMetadata& local_metadata, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) OVERRIDE; virtual void ActivateService(RemoteServiceState service_state, const std::string& description) OVERRIDE; virtual void DeactivateService(const std::string& description) OVERRIDE; diff --git a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc index dc4f62b..9fab328 100644 --- a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc +++ b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc @@ -75,7 +75,7 @@ LocalToRemoteSyncer::LocalToRemoteSyncer(SyncEngineContext* sync_context, const SyncFileMetadata& local_metadata, const FileChange& local_change, const base::FilePath& local_path, - const fileapi::FileSystemURL& url) + const storage::FileSystemURL& url) : sync_context_(sync_context), local_change_(local_change), local_is_missing_(IsLocalFileMissing(local_metadata, local_change)), @@ -156,7 +156,7 @@ void LocalToRemoteSyncer::RunPreflight(scoped_ptr<SyncTaskToken> token) { } std::vector<base::FilePath::StringType> missing_components; - fileapi::VirtualPath::GetComponents(missing_entries, &missing_components); + storage::VirtualPath::GetComponents(missing_entries, &missing_components); if (!missing_components.empty()) { if (local_is_missing_) { @@ -364,7 +364,7 @@ void LocalToRemoteSyncer::HandleConflict(scoped_ptr<SyncTaskToken> token) { } const FileDetails& remote_details = remote_file_metadata.details(); - base::FilePath title = fileapi::VirtualPath::BaseName(target_path_); + base::FilePath title = storage::VirtualPath::BaseName(target_path_); if (!remote_details.missing() && remote_details.file_kind() == FILE_KIND_FOLDER && remote_details.title() == title.AsUTF8Unsafe() && @@ -575,7 +575,7 @@ void LocalToRemoteSyncer::DidUpdateDatabaseForUploadExistingFile( } const FileDetails& details = file.details(); - base::FilePath title = fileapi::VirtualPath::BaseName(target_path_); + base::FilePath title = storage::VirtualPath::BaseName(target_path_); if (!details.missing() && details.file_kind() == FILE_KIND_FILE && details.title() == title.AsUTF8Unsafe() && @@ -646,7 +646,7 @@ void LocalToRemoteSyncer::UploadNewFile(scoped_ptr<SyncTaskToken> token) { DCHECK(remote_parent_folder_tracker_); sync_action_ = SYNC_ACTION_ADDED; - base::FilePath title = fileapi::VirtualPath::BaseName(target_path_); + base::FilePath title = storage::VirtualPath::BaseName(target_path_); drive_uploader()->UploadNewFile( remote_parent_folder_tracker_->file_id(), local_path_, @@ -690,7 +690,7 @@ void LocalToRemoteSyncer::CreateRemoteFolder( scoped_ptr<SyncTaskToken> token) { DCHECK(remote_parent_folder_tracker_); - base::FilePath title = fileapi::VirtualPath::BaseName(target_path_); + base::FilePath title = storage::VirtualPath::BaseName(target_path_); sync_action_ = SYNC_ACTION_ADDED; DCHECK(!folder_creator_); diff --git a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h index b9841cf..e02e2d4 100644 --- a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h +++ b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.h @@ -46,11 +46,11 @@ class LocalToRemoteSyncer : public SyncTask { const SyncFileMetadata& local_metadata, const FileChange& local_change, const base::FilePath& local_path, - const fileapi::FileSystemURL& url); + const storage::FileSystemURL& url); virtual ~LocalToRemoteSyncer(); virtual void RunPreflight(scoped_ptr<SyncTaskToken> token) OVERRIDE; - const fileapi::FileSystemURL& url() const { return url_; } + const storage::FileSystemURL& url() const { return url_; } const base::FilePath& target_path() const { return target_path_; } SyncAction sync_action() const { return sync_action_; } bool needs_remote_change_listing() const { @@ -113,7 +113,7 @@ class LocalToRemoteSyncer : public SyncTask { FileChange local_change_; bool local_is_missing_; base::FilePath local_path_; - fileapi::FileSystemURL url_; + storage::FileSystemURL url_; SyncAction sync_action_; scoped_ptr<FileTracker> remote_file_tracker_; diff --git a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc index de81551..525b5bc 100644 --- a/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer_unittest.cc @@ -40,8 +40,7 @@ namespace drive_backend { namespace { -fileapi::FileSystemURL URL(const GURL& origin, - const std::string& path) { +storage::FileSystemURL URL(const GURL& origin, const std::string& path) { return CreateSyncableFileSystemURL( origin, base::FilePath::FromUTF8Unsafe(path)); } @@ -167,7 +166,7 @@ class LocalToRemoteSyncerTest : public testing::Test { } SyncStatusCode RunLocalToRemoteSyncer(FileChange file_change, - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { SyncStatusCode status = SYNC_STATUS_UNKNOWN; base::FilePath local_path = base::FilePath::FromUTF8Unsafe("dummy"); scoped_ptr<LocalToRemoteSyncer> syncer(new LocalToRemoteSyncer( diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc b/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc index b339136..1091a20 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/metadata_db_migration_util_unittest.cc @@ -71,8 +71,8 @@ TEST(DriveMetadataDBMigrationUtilTest, RollbackFromV4ToV3) { { leveldb::Options options; options.create_if_missing = true; - std::string db_dir = fileapi::FilePathToString( - base_dir.path().Append(kDatabaseName)); + std::string db_dir = + storage::FilePathToString(base_dir.path().Append(kDatabaseName)); leveldb::Status status = leveldb::DB::Open(options, db_dir, &db_ptr); ASSERT_TRUE(status.ok()); } diff --git a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.cc b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.cc index 6ae9736e..9024d93 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.cc +++ b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.cc @@ -31,7 +31,7 @@ RemoteChangeProcessorOnWorker::~RemoteChangeProcessorOnWorker() { } void RemoteChangeProcessorOnWorker::PrepareForProcessRemoteChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const PrepareChangeCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); @@ -49,7 +49,7 @@ void RemoteChangeProcessorOnWorker::PrepareForProcessRemoteChange( void RemoteChangeProcessorOnWorker::ApplyRemoteChange( const FileChange& change, const base::FilePath& local_path, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); @@ -67,7 +67,7 @@ void RemoteChangeProcessorOnWorker::ApplyRemoteChange( } void RemoteChangeProcessorOnWorker::FinalizeRemoteSync( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, bool clear_local_changes, const base::Closure& completion_callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); @@ -85,7 +85,7 @@ void RemoteChangeProcessorOnWorker::FinalizeRemoteSync( } void RemoteChangeProcessorOnWorker::RecordFakeLocalChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileChange& change, const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); diff --git a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.h b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.h index 4ee1bcd..533d3d4 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.h +++ b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_on_worker.h @@ -33,19 +33,18 @@ class RemoteChangeProcessorOnWorker : public RemoteChangeProcessor { virtual ~RemoteChangeProcessorOnWorker(); virtual void PrepareForProcessRemoteChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const PrepareChangeCallback& callback) OVERRIDE; - virtual void ApplyRemoteChange( - const FileChange& change, - const base::FilePath& local_path, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) OVERRIDE; + virtual void ApplyRemoteChange(const FileChange& change, + const base::FilePath& local_path, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) OVERRIDE; virtual void FinalizeRemoteSync( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, bool clear_local_changes, const base::Closure& completion_callback) OVERRIDE; virtual void RecordFakeLocalChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileChange& change, const SyncStatusCallback& callback) OVERRIDE; diff --git a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.cc b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.cc index 550aad9..e3ee4db 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.cc +++ b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.cc @@ -15,7 +15,7 @@ RemoteChangeProcessorWrapper::RemoteChangeProcessorWrapper( : remote_change_processor_(remote_change_processor) {} void RemoteChangeProcessorWrapper::PrepareForProcessRemoteChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const RemoteChangeProcessor::PrepareChangeCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); remote_change_processor_->PrepareForProcessRemoteChange(url, callback); @@ -24,7 +24,7 @@ void RemoteChangeProcessorWrapper::PrepareForProcessRemoteChange( void RemoteChangeProcessorWrapper::ApplyRemoteChange( const FileChange& change, const base::FilePath& local_path, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); remote_change_processor_->ApplyRemoteChange( @@ -32,7 +32,7 @@ void RemoteChangeProcessorWrapper::ApplyRemoteChange( } void RemoteChangeProcessorWrapper::FinalizeRemoteSync( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, bool clear_local_changes, const base::Closure& completion_callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); @@ -41,7 +41,7 @@ void RemoteChangeProcessorWrapper::FinalizeRemoteSync( } void RemoteChangeProcessorWrapper::RecordFakeLocalChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileChange& change, const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); diff --git a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.h b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.h index b26ab00..714dfba 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.h +++ b/chrome/browser/sync_file_system/drive_backend/remote_change_processor_wrapper.h @@ -23,24 +23,21 @@ class RemoteChangeProcessorWrapper RemoteChangeProcessor* remote_change_processor); void PrepareForProcessRemoteChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const RemoteChangeProcessor::PrepareChangeCallback& callback); - void ApplyRemoteChange( - const FileChange& change, - const base::FilePath& local_path, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback); - - void FinalizeRemoteSync( - const fileapi::FileSystemURL& url, - bool clear_local_changes, - const base::Closure& completion_callback); - - void RecordFakeLocalChange( - const fileapi::FileSystemURL& url, - const FileChange& change, - const SyncStatusCallback& callback); + void ApplyRemoteChange(const FileChange& change, + const base::FilePath& local_path, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback); + + void FinalizeRemoteSync(const storage::FileSystemURL& url, + bool clear_local_changes, + const base::Closure& completion_callback); + + void RecordFakeLocalChange(const storage::FileSystemURL& url, + const FileChange& change, + const SyncStatusCallback& callback); private: RemoteChangeProcessor* remote_change_processor_; diff --git a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.cc b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.cc index ead79df..9ac8cfb 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.cc +++ b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.cc @@ -33,10 +33,9 @@ namespace drive_backend { namespace { -bool BuildFileSystemURL( - MetadataDatabase* metadata_database, - const FileTracker& tracker, - fileapi::FileSystemURL* url) { +bool BuildFileSystemURL(MetadataDatabase* metadata_database, + const FileTracker& tracker, + storage::FileSystemURL* url) { base::FilePath path; if (!metadata_database->BuildPathForTracker( tracker.tracker_id(), &path)) @@ -80,16 +79,14 @@ scoped_ptr<FileMetadata> GetFileMetadata(MetadataDatabase* database, // Creates a temporary file in |dir_path|. This must be called on an // IO-allowed task runner, and the runner must be given as |file_task_runner|. -webkit_blob::ScopedFile CreateTemporaryFile( - base::TaskRunner* file_task_runner) { +storage::ScopedFile CreateTemporaryFile(base::TaskRunner* file_task_runner) { base::FilePath temp_file_path; if (!base::CreateTemporaryFile(&temp_file_path)) - return webkit_blob::ScopedFile(); + return storage::ScopedFile(); - return webkit_blob::ScopedFile( - temp_file_path, - webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT, - file_task_runner); + return storage::ScopedFile(temp_file_path, + storage::ScopedFile::DELETE_ON_SCOPE_OUT, + file_task_runner); } } // namespace @@ -690,7 +687,7 @@ void RemoteToLocalSyncer::DeleteLocalFile(scoped_ptr<SyncTaskToken> token) { void RemoteToLocalSyncer::DownloadFile(scoped_ptr<SyncTaskToken> token) { DCHECK(sync_context_->GetWorkerTaskRunner()->RunsTasksOnCurrentThread()); - webkit_blob::ScopedFile file = CreateTemporaryFile( + storage::ScopedFile file = CreateTemporaryFile( make_scoped_refptr(sync_context_->GetWorkerTaskRunner())); base::FilePath path = file.path(); @@ -704,7 +701,7 @@ void RemoteToLocalSyncer::DownloadFile(scoped_ptr<SyncTaskToken> token) { } void RemoteToLocalSyncer::DidDownloadFile(scoped_ptr<SyncTaskToken> token, - webkit_blob::ScopedFile file, + storage::ScopedFile file, google_apis::GDataErrorCode error, const base::FilePath&) { DCHECK(sync_context_->GetWorkerTaskRunner()->RunsTasksOnCurrentThread()); @@ -737,7 +734,7 @@ void RemoteToLocalSyncer::DidDownloadFile(scoped_ptr<SyncTaskToken> token, } void RemoteToLocalSyncer::DidApplyDownload(scoped_ptr<SyncTaskToken> token, - webkit_blob::ScopedFile, + storage::ScopedFile, SyncStatusCode status) { SyncCompleted(token.Pass(), status); } diff --git a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h index d24f399..9bd7ac2 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h +++ b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h @@ -29,7 +29,7 @@ class FileResource; class ResourceEntry; } -namespace webkit_blob { +namespace storage { class ScopedFile; } @@ -49,7 +49,7 @@ class RemoteToLocalSyncer : public SyncTask { virtual void RunPreflight(scoped_ptr<SyncTaskToken> token) OVERRIDE; void RunExclusive(scoped_ptr<SyncTaskToken> token); - const fileapi::FileSystemURL& url() const { return url_; } + const storage::FileSystemURL& url() const { return url_; } SyncAction sync_action() const { return sync_action_; } bool is_sync_root_deletion() const { return sync_root_deletion_; } @@ -174,11 +174,11 @@ class RemoteToLocalSyncer : public SyncTask { void DeleteLocalFile(scoped_ptr<SyncTaskToken> token); void DownloadFile(scoped_ptr<SyncTaskToken> token); void DidDownloadFile(scoped_ptr<SyncTaskToken> token, - webkit_blob::ScopedFile file, + storage::ScopedFile file, google_apis::GDataErrorCode error, const base::FilePath&); void DidApplyDownload(scoped_ptr<SyncTaskToken> token, - webkit_blob::ScopedFile, + storage::ScopedFile, SyncStatusCode status); void CreateFolder(scoped_ptr<SyncTaskToken> token); @@ -196,7 +196,7 @@ class RemoteToLocalSyncer : public SyncTask { scoped_ptr<FileTracker> dirty_tracker_; scoped_ptr<FileMetadata> remote_metadata_; - fileapi::FileSystemURL url_; + storage::FileSystemURL url_; SyncAction sync_action_; bool prepared_; diff --git a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer_unittest.cc b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer_unittest.cc index 8ae6b50..d556faa 100644 --- a/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer_unittest.cc @@ -37,8 +37,7 @@ namespace drive_backend { namespace { -fileapi::FileSystemURL URL(const GURL& origin, - const std::string& path) { +storage::FileSystemURL URL(const GURL& origin, const std::string& path) { return CreateSyncableFileSystemURL( origin, base::FilePath::FromUTF8Unsafe(path)); } @@ -167,13 +166,13 @@ class RemoteToLocalSyncerTest : public testing::Test { fake_drive_helper_->DeleteResource(file_id)); } - void CreateLocalFolder(const fileapi::FileSystemURL& url) { + void CreateLocalFolder(const storage::FileSystemURL& url) { remote_change_processor_->UpdateLocalFileMetadata( url, FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, SYNC_FILE_TYPE_DIRECTORY)); } - void CreateLocalFile(const fileapi::FileSystemURL& url) { + void CreateLocalFile(const storage::FileSystemURL& url) { remote_change_processor_->UpdateLocalFileMetadata( url, FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, SYNC_FILE_TYPE_FILE)); @@ -228,7 +227,7 @@ class RemoteToLocalSyncerTest : public testing::Test { return status; } - void AppendExpectedChange(const fileapi::FileSystemURL& url, + void AppendExpectedChange(const storage::FileSystemURL& url, FileChange::ChangeType change_type, SyncFileType file_type) { expected_changes_[url].push_back(FileChange(change_type, file_type)); diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc index f85825f..bab91aa 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc @@ -108,7 +108,7 @@ class SyncEngine::WorkerObserver : public SyncWorkerInterface::Observer { item_count)); } - virtual void OnFileStatusChanged(const fileapi::FileSystemURL& url, + virtual void OnFileStatusChanged(const storage::FileSystemURL& url, SyncFileStatus file_status, SyncAction sync_action, SyncDirection direction) OVERRIDE { @@ -459,12 +459,12 @@ void SyncEngine::UninstallOrigin( void SyncEngine::ProcessRemoteChange(const SyncFileCallback& callback) { if (GetCurrentState() == REMOTE_SERVICE_DISABLED) { - callback.Run(SYNC_STATUS_SYNC_DISABLED, fileapi::FileSystemURL()); + callback.Run(SYNC_STATUS_SYNC_DISABLED, storage::FileSystemURL()); return; } base::Closure abort_closure = - base::Bind(callback, SYNC_STATUS_ABORT, fileapi::FileSystemURL()); + base::Bind(callback, SYNC_STATUS_ABORT, storage::FileSystemURL()); if (!sync_worker_) { abort_closure.Run(); @@ -606,12 +606,11 @@ void SyncEngine::PromoteDemotedChanges(const base::Closure& callback) { relayed_callback)); } -void SyncEngine::ApplyLocalChange( - const FileChange& local_change, - const base::FilePath& local_path, - const SyncFileMetadata& local_metadata, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) { +void SyncEngine::ApplyLocalChange(const FileChange& local_change, + const base::FilePath& local_path, + const SyncFileMetadata& local_metadata, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) { if (GetCurrentState() == REMOTE_SERVICE_DISABLED) { callback.Run(SYNC_STATUS_SYNC_DISABLED); return; @@ -762,7 +761,7 @@ void SyncEngine::OnPendingFileListUpdated(int item_count) { OnRemoteChangeQueueUpdated(item_count)); } -void SyncEngine::OnFileStatusChanged(const fileapi::FileSystemURL& url, +void SyncEngine::OnFileStatusChanged(const storage::FileSystemURL& url, SyncFileStatus file_status, SyncAction sync_action, SyncDirection direction) { diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.h b/chrome/browser/sync_file_system/drive_backend/sync_engine.h index e8e354a..eb628d8 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.h @@ -128,12 +128,11 @@ class SyncEngine : public RemoteFileSyncService, virtual void PromoteDemotedChanges(const base::Closure& callback) OVERRIDE; // LocalChangeProcessor overrides. - virtual void ApplyLocalChange( - const FileChange& local_change, - const base::FilePath& local_path, - const SyncFileMetadata& local_metadata, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) OVERRIDE; + virtual void ApplyLocalChange(const FileChange& local_change, + const base::FilePath& local_path, + const SyncFileMetadata& local_metadata, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) OVERRIDE; // drive::DriveNotificationObserver overrides. virtual void OnNotificationReceived() OVERRIDE; @@ -174,7 +173,7 @@ class SyncEngine : public RemoteFileSyncService, // Called by WorkerObserver. void OnPendingFileListUpdated(int item_count); - void OnFileStatusChanged(const fileapi::FileSystemURL& url, + void OnFileStatusChanged(const storage::FileSystemURL& url, SyncFileStatus file_status, SyncAction sync_action, SyncDirection direction); diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine_unittest.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine_unittest.cc index d4d85f1..790d51f 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_engine_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_engine_unittest.cc @@ -223,7 +223,7 @@ TEST_F(SyncEngineTest, UpdateServiceState) { TEST_F(SyncEngineTest, ProcessRemoteChange) { SyncStatusCode sync_status; - fileapi::FileSystemURL url; + storage::FileSystemURL url; sync_engine()->ProcessRemoteChange(CreateResultReceiver(&sync_status, &url)); WaitForWorkerTaskRunner(); EXPECT_EQ(SYNC_STATUS_OK, sync_status); diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc index 6a1672f..b14cfea 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc @@ -12,7 +12,7 @@ #include "chrome/browser/sync_file_system/drive_backend/sync_task_token.h" #include "chrome/browser/sync_file_system/sync_file_metadata.h" -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace sync_file_system { namespace drive_backend { diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager_unittest.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_manager_unittest.cc index 2ea02be..27d6f97 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager_unittest.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager_unittest.cc @@ -19,7 +19,7 @@ #include "webkit/common/fileapi/file_system_util.h" #define MAKE_PATH(path) \ - base::FilePath(fileapi::VirtualPath::GetNormalizedFilePath( \ + base::FilePath(storage::VirtualPath::GetNormalizedFilePath( \ base::FilePath(FILE_PATH_LITERAL(path)))) namespace sync_file_system { @@ -268,7 +268,7 @@ class BlockerUpdateTestHelper : public SyncTask { scoped_ptr<BlockingFactor> blocking_factor(new BlockingFactor); blocking_factor->app_id = app_id_; blocking_factor->paths.push_back( - base::FilePath(fileapi::VirtualPath::GetNormalizedFilePath( + base::FilePath(storage::VirtualPath::GetNormalizedFilePath( base::FilePath::FromUTF8Unsafe(updating_to)))); SyncTaskManager::UpdateBlockingFactor( diff --git a/chrome/browser/sync_file_system/drive_backend/sync_worker.cc b/chrome/browser/sync_file_system/drive_backend/sync_worker.cc index 1afde61bd..c754dbd 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_worker.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_worker.cc @@ -244,12 +244,11 @@ void SyncWorker::PromoteDemotedChanges(const base::Closure& callback) { callback.Run(); } -void SyncWorker::ApplyLocalChange( - const FileChange& local_change, - const base::FilePath& local_path, - const SyncFileMetadata& local_metadata, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) { +void SyncWorker::ApplyLocalChange(const FileChange& local_change, + const base::FilePath& local_path, + const SyncFileMetadata& local_metadata, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); LocalToRemoteSyncer* syncer = new LocalToRemoteSyncer( @@ -515,7 +514,7 @@ void SyncWorker::DidProcessRemoteChange(RemoteToLocalSyncer* syncer, if (syncer->sync_action() == SYNC_ACTION_DELETED && syncer->url().is_valid() && - fileapi::VirtualPath::IsRootPath(syncer->url().path())) { + storage::VirtualPath::IsRootPath(syncer->url().path())) { RegisterOrigin(syncer->url().origin(), base::Bind(&EmptyStatusCallback)); } should_check_conflict_ = true; @@ -531,7 +530,7 @@ void SyncWorker::DidApplyLocalChange(LocalToRemoteSyncer* syncer, if ((status == SYNC_STATUS_OK || status == SYNC_STATUS_RETRY) && syncer->url().is_valid() && syncer->sync_action() != SYNC_ACTION_NONE) { - fileapi::FileSystemURL updated_url = syncer->url(); + storage::FileSystemURL updated_url = syncer->url(); if (!syncer->target_path().empty()) { updated_url = CreateSyncableFileSystemURL(syncer->url().origin(), syncer->target_path()); diff --git a/chrome/browser/sync_file_system/drive_backend/sync_worker.h b/chrome/browser/sync_file_system/drive_backend/sync_worker.h index 9a567c1..deb0ee5 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_worker.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_worker.h @@ -29,7 +29,7 @@ class DriveServiceInterface; class DriveUploaderInterface; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -89,12 +89,11 @@ class SyncWorker : public SyncWorkerInterface, virtual scoped_ptr<base::ListValue> DumpDatabase() OVERRIDE; virtual void SetSyncEnabled(bool enabled) OVERRIDE; virtual void PromoteDemotedChanges(const base::Closure& callback) OVERRIDE; - virtual void ApplyLocalChange( - const FileChange& local_change, - const base::FilePath& local_path, - const SyncFileMetadata& local_metadata, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) OVERRIDE; + virtual void ApplyLocalChange(const FileChange& local_change, + const base::FilePath& local_path, + const SyncFileMetadata& local_metadata, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) OVERRIDE; virtual void ActivateService(RemoteServiceState service_state, const std::string& description) OVERRIDE; virtual void DeactivateService(const std::string& description) OVERRIDE; diff --git a/chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h b/chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h index cf32f51..c114ccd 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h @@ -26,7 +26,7 @@ class DriveServiceInterface; class DriveUploaderInterface; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -47,7 +47,7 @@ class SyncWorkerInterface { class Observer { public: virtual void OnPendingFileListUpdated(int item_count) = 0; - virtual void OnFileStatusChanged(const fileapi::FileSystemURL& url, + virtual void OnFileStatusChanged(const storage::FileSystemURL& url, SyncFileStatus file_status, SyncAction sync_action, SyncDirection direction) = 0; @@ -88,12 +88,11 @@ class SyncWorkerInterface { virtual void PromoteDemotedChanges(const base::Closure& callback) = 0; // See LocalChangeProcessor for the details. - virtual void ApplyLocalChange( - const FileChange& local_change, - const base::FilePath& local_path, - const SyncFileMetadata& local_metadata, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) = 0; + virtual void ApplyLocalChange(const FileChange& local_change, + const base::FilePath& local_path, + const SyncFileMetadata& local_metadata, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) = 0; virtual void ActivateService(RemoteServiceState service_state, const std::string& description) = 0; diff --git a/chrome/browser/sync_file_system/fake_remote_change_processor.cc b/chrome/browser/sync_file_system/fake_remote_change_processor.cc index ce53a41..56316a9 100644 --- a/chrome/browser/sync_file_system/fake_remote_change_processor.cc +++ b/chrome/browser/sync_file_system/fake_remote_change_processor.cc @@ -25,11 +25,11 @@ FakeRemoteChangeProcessor::~FakeRemoteChangeProcessor() { } void FakeRemoteChangeProcessor::PrepareForProcessRemoteChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const PrepareChangeCallback& callback) { SyncFileMetadata local_metadata; - if (fileapi::VirtualPath::IsRootPath(url.path())) { + if (storage::VirtualPath::IsRootPath(url.path())) { // Origin root directory case. local_metadata = SyncFileMetadata( SYNC_FILE_TYPE_DIRECTORY, 0, base::Time::Now()); @@ -66,12 +66,12 @@ void FakeRemoteChangeProcessor::PrepareForProcessRemoteChange( void FakeRemoteChangeProcessor::ApplyRemoteChange( const FileChange& change, const base::FilePath& local_path, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const SyncStatusCallback& callback) { SyncStatusCode status = SYNC_STATUS_UNKNOWN; - base::FilePath ancestor = fileapi::VirtualPath::DirName(url.path()); + base::FilePath ancestor = storage::VirtualPath::DirName(url.path()); while (true) { - fileapi::FileSystemURL ancestor_url = + storage::FileSystemURL ancestor_url = CreateSyncableFileSystemURL(url.origin(), ancestor); if (!ancestor_url.is_valid()) break; @@ -87,7 +87,7 @@ void FakeRemoteChangeProcessor::ApplyRemoteChange( } } - base::FilePath ancestor_parent = fileapi::VirtualPath::DirName(ancestor); + base::FilePath ancestor_parent = storage::VirtualPath::DirName(ancestor); if (ancestor == ancestor_parent) break; ancestor = ancestor_parent; @@ -101,14 +101,14 @@ void FakeRemoteChangeProcessor::ApplyRemoteChange( } void FakeRemoteChangeProcessor::FinalizeRemoteSync( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, bool clear_local_changes, const base::Closure& completion_callback) { base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, completion_callback); } void FakeRemoteChangeProcessor::RecordFakeLocalChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileChange& change, const SyncStatusCallback& callback) { local_changes_[url].Update(change); @@ -117,7 +117,7 @@ void FakeRemoteChangeProcessor::RecordFakeLocalChange( } void FakeRemoteChangeProcessor::UpdateLocalFileMetadata( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileChange& change) { if (change.IsAddOrUpdate()) { local_file_metadata_[url] = SyncFileMetadata( @@ -129,7 +129,7 @@ void FakeRemoteChangeProcessor::UpdateLocalFileMetadata( } void FakeRemoteChangeProcessor::ClearLocalChanges( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { local_changes_.erase(url); } @@ -143,7 +143,7 @@ void FakeRemoteChangeProcessor::VerifyConsistency( EXPECT_EQ(expected_changes.size(), applied_changes_.size()); for (URLToFileChangesMap::const_iterator itr = applied_changes_.begin(); itr != applied_changes_.end(); ++itr) { - const fileapi::FileSystemURL& url = itr->first; + const storage::FileSystemURL& url = itr->first; URLToFileChangesMap::const_iterator found = expected_changes.find(url); if (found == expected_changes.end()) { EXPECT_TRUE(found != expected_changes.end()) diff --git a/chrome/browser/sync_file_system/fake_remote_change_processor.h b/chrome/browser/sync_file_system/fake_remote_change_processor.h index 7e5d247..cc56d28 100644 --- a/chrome/browser/sync_file_system/fake_remote_change_processor.h +++ b/chrome/browser/sync_file_system/fake_remote_change_processor.h @@ -17,7 +17,7 @@ namespace base { class FilePath; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -27,38 +27,39 @@ class FileChange; class FakeRemoteChangeProcessor : public RemoteChangeProcessor { public: - typedef std::map<fileapi::FileSystemURL, std::vector<FileChange>, - fileapi::FileSystemURL::Comparator> URLToFileChangesMap; - typedef std::map<fileapi::FileSystemURL, FileChangeList, - fileapi::FileSystemURL::Comparator> URLToFileChangeList; - typedef std::map<fileapi::FileSystemURL, SyncFileMetadata, - fileapi::FileSystemURL::Comparator> URLToFileMetadata; + typedef std::map<storage::FileSystemURL, + std::vector<FileChange>, + storage::FileSystemURL::Comparator> URLToFileChangesMap; + typedef std::map<storage::FileSystemURL, + FileChangeList, + storage::FileSystemURL::Comparator> URLToFileChangeList; + typedef std::map<storage::FileSystemURL, + SyncFileMetadata, + storage::FileSystemURL::Comparator> URLToFileMetadata; FakeRemoteChangeProcessor(); virtual ~FakeRemoteChangeProcessor(); // RemoteChangeProcessor overrides. virtual void PrepareForProcessRemoteChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const PrepareChangeCallback& callback) OVERRIDE; - virtual void ApplyRemoteChange( - const FileChange& change, - const base::FilePath& local_path, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) OVERRIDE; + virtual void ApplyRemoteChange(const FileChange& change, + const base::FilePath& local_path, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) OVERRIDE; virtual void FinalizeRemoteSync( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, bool clear_local_changes, const base::Closure& completion_callback) OVERRIDE; virtual void RecordFakeLocalChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileChange& change, const SyncStatusCallback& callback) OVERRIDE; - void UpdateLocalFileMetadata( - const fileapi::FileSystemURL& url, - const FileChange& change); - void ClearLocalChanges(const fileapi::FileSystemURL& url); + void UpdateLocalFileMetadata(const storage::FileSystemURL& url, + const FileChange& change); + void ClearLocalChanges(const storage::FileSystemURL& url); const URLToFileChangesMap& GetAppliedRemoteChanges() const; diff --git a/chrome/browser/sync_file_system/file_status_observer.h b/chrome/browser/sync_file_system/file_status_observer.h index fc60bb4..c9a546e 100644 --- a/chrome/browser/sync_file_system/file_status_observer.h +++ b/chrome/browser/sync_file_system/file_status_observer.h @@ -10,7 +10,7 @@ #include "chrome/browser/sync_file_system/sync_direction.h" #include "chrome/browser/sync_file_system/sync_file_status.h" -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -21,7 +21,7 @@ class FileStatusObserver { FileStatusObserver() {} virtual ~FileStatusObserver() {} - virtual void OnFileStatusChanged(const fileapi::FileSystemURL& url, + virtual void OnFileStatusChanged(const storage::FileSystemURL& url, SyncFileStatus sync_status, SyncAction action_taken, SyncDirection direction) = 0; diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc index 1d3ef2f..868fa43 100644 --- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc +++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc @@ -34,11 +34,11 @@ #include "webkit/common/blob/shareable_file_reference.h" using base::File; -using fileapi::FileSystemContext; -using fileapi::FileSystemOperationRunner; -using fileapi::FileSystemURL; -using fileapi::FileSystemURLSet; -using quota::QuotaManager; +using storage::FileSystemContext; +using storage::FileSystemOperationRunner; +using storage::FileSystemURL; +using storage::FileSystemURLSet; +using storage::QuotaManager; using content::MockBlobURLRequestContext; using content::ScopedTextBlob; @@ -104,7 +104,7 @@ void OnCreateSnapshotFileAndVerifyData( base::File::Error result, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& /* file_ref */) { + const scoped_refptr<storage::ShareableFileReference>& /* file_ref */) { if (result != base::File::FILE_OK) { callback.Run(result); return; @@ -124,7 +124,7 @@ void OnCreateSnapshotFile( base::File::Error result, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { + const scoped_refptr<storage::ShareableFileReference>& file_ref) { DCHECK(!file_ref.get()); DCHECK(file_info_out); DCHECK(platform_path_out); @@ -133,12 +133,11 @@ void OnCreateSnapshotFile( callback.Run(result); } -void OnReadDirectory( - CannedSyncableFileSystem::FileEntryList* entries_out, - const CannedSyncableFileSystem::StatusCallback& callback, - base::File::Error error, - const fileapi::FileSystemOperation::FileEntryList& entries, - bool has_more) { +void OnReadDirectory(CannedSyncableFileSystem::FileEntryList* entries_out, + const CannedSyncableFileSystem::StatusCallback& callback, + base::File::Error error, + const storage::FileSystemOperation::FileEntryList& entries, + bool has_more) { DCHECK(entries_out); entries_out->reserve(entries_out->size() + entries.size()); std::copy(entries.begin(), entries.end(), std::back_inserter(*entries_out)); @@ -187,10 +186,12 @@ class WriteHelper { DISALLOW_COPY_AND_ASSIGN(WriteHelper); }; -void DidGetUsageAndQuota(const quota::StatusCallback& callback, - int64* usage_out, int64* quota_out, - quota::QuotaStatusCode status, - int64 usage, int64 quota) { +void DidGetUsageAndQuota(const storage::StatusCallback& callback, + int64* usage_out, + int64* quota_out, + storage::QuotaStatusCode status, + int64 usage, + int64 quota) { *usage_out = usage; *quota_out = quota; callback.Run(status); @@ -211,7 +212,7 @@ CannedSyncableFileSystem::CannedSyncableFileSystem( base::SingleThreadTaskRunner* io_task_runner, base::SingleThreadTaskRunner* file_task_runner) : origin_(origin), - type_(fileapi::kFileSystemTypeSyncable), + type_(storage::kFileSystemTypeSyncable), result_(base::File::FILE_OK), sync_status_(sync_file_system::SYNC_STATUS_OK), env_override_(env_override), @@ -228,7 +229,7 @@ void CannedSyncableFileSystem::SetUp(QuotaMode quota_mode) { ASSERT_FALSE(is_filesystem_set_up_); ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); - scoped_refptr<quota::SpecialStoragePolicy> storage_policy = + scoped_refptr<storage::SpecialStoragePolicy> storage_policy = new content::MockSpecialStoragePolicy(); if (quota_mode == QUOTA_ENABLED) { @@ -241,23 +242,24 @@ void CannedSyncableFileSystem::SetUp(QuotaMode quota_mode) { std::vector<std::string> additional_allowed_schemes; additional_allowed_schemes.push_back(origin_.scheme()); - fileapi::FileSystemOptions options( - fileapi::FileSystemOptions::PROFILE_MODE_NORMAL, + storage::FileSystemOptions options( + storage::FileSystemOptions::PROFILE_MODE_NORMAL, additional_allowed_schemes, env_override_); - ScopedVector<fileapi::FileSystemBackend> additional_backends; + ScopedVector<storage::FileSystemBackend> additional_backends; additional_backends.push_back(SyncFileSystemBackend::CreateForTesting()); file_system_context_ = new FileSystemContext( io_task_runner_, file_task_runner_, - fileapi::ExternalMountPoints::CreateRefCounted().get(), + storage::ExternalMountPoints::CreateRefCounted().get(), storage_policy.get(), quota_manager_ ? quota_manager_->proxy() : NULL, additional_backends.Pass(), - std::vector<fileapi::URLRequestAutoMountHandler>(), - data_dir_.path(), options); + std::vector<storage::URLRequestAutoMountHandler>(), + data_dir_.path(), + options); is_filesystem_set_up_ = true; } @@ -455,7 +457,7 @@ File::Error CannedSyncableFileSystem::GetMetadataAndPlatformPath( } File::Error CannedSyncableFileSystem::ReadDirectory( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, FileEntryList* entries) { return RunOnThread<File::Error>( io_task_runner_, @@ -469,7 +471,7 @@ File::Error CannedSyncableFileSystem::ReadDirectory( int64 CannedSyncableFileSystem::Write( net::URLRequestContext* url_request_context, const FileSystemURL& url, - scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle) { + scoped_ptr<storage::BlobDataHandle> blob_data_handle) { return RunOnThread<int64>(io_task_runner_, FROM_HERE, base::Bind(&CannedSyncableFileSystem::DoWrite, @@ -500,9 +502,10 @@ File::Error CannedSyncableFileSystem::DeleteFileSystem() { type_)); } -quota::QuotaStatusCode CannedSyncableFileSystem::GetUsageAndQuota( - int64* usage, int64* quota) { - return RunOnThread<quota::QuotaStatusCode>( +storage::QuotaStatusCode CannedSyncableFileSystem::GetUsageAndQuota( + int64* usage, + int64* quota) { + return RunOnThread<storage::QuotaStatusCode>( io_task_runner_, FROM_HERE, base::Bind(&CannedSyncableFileSystem::DoGetUsageAndQuota, @@ -565,8 +568,9 @@ void CannedSyncableFileSystem::DoOpenFileSystem( EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); EXPECT_FALSE(is_filesystem_opened_); file_system_context_->OpenFileSystem( - origin_, type_, - fileapi::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, + origin_, + type_, + storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, callback); } @@ -594,9 +598,11 @@ void CannedSyncableFileSystem::DoCopy( EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); EXPECT_TRUE(is_filesystem_opened_); operation_runner()->Copy( - src_url, dest_url, - fileapi::FileSystemOperation::OPTION_NONE, - fileapi::FileSystemOperationRunner::CopyProgressCallback(), callback); + src_url, + dest_url, + storage::FileSystemOperation::OPTION_NONE, + storage::FileSystemOperationRunner::CopyProgressCallback(), + callback); } void CannedSyncableFileSystem::DoMove( @@ -606,7 +612,7 @@ void CannedSyncableFileSystem::DoMove( EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); EXPECT_TRUE(is_filesystem_opened_); operation_runner()->Move( - src_url, dest_url, fileapi::FileSystemOperation::OPTION_NONE, callback); + src_url, dest_url, storage::FileSystemOperation::OPTION_NONE, callback); } void CannedSyncableFileSystem::DoTruncateFile( @@ -685,7 +691,7 @@ void CannedSyncableFileSystem::DoReadDirectory( void CannedSyncableFileSystem::DoWrite( net::URLRequestContext* url_request_context, const FileSystemURL& url, - scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle, + scoped_ptr<storage::BlobDataHandle> blob_data_handle, const WriteCallback& callback) { EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); EXPECT_TRUE(is_filesystem_opened_); @@ -714,7 +720,7 @@ void CannedSyncableFileSystem::DoWriteString( void CannedSyncableFileSystem::DoGetUsageAndQuota( int64* usage, int64* quota, - const quota::StatusCallback& callback) { + const storage::StatusCallback& callback) { EXPECT_TRUE(io_task_runner_->RunsTasksOnCurrentThread()); EXPECT_TRUE(is_filesystem_opened_); DCHECK(quota_manager_); diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.h b/chrome/browser/sync_file_system/local/canned_syncable_file_system.h index 7dc4906..1616ec1 100644 --- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.h +++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.h @@ -27,7 +27,7 @@ class SingleThreadTaskRunner; class Thread; } -namespace fileapi { +namespace storage { class FileSystemContext; class FileSystemOperationRunner; class FileSystemURL; @@ -41,7 +41,7 @@ namespace net { class URLRequestContext; } -namespace quota { +namespace storage { class QuotaManager; } @@ -63,7 +63,7 @@ class CannedSyncableFileSystem OpenFileSystemCallback; typedef base::Callback<void(base::File::Error)> StatusCallback; typedef base::Callback<void(int64)> WriteCallback; - typedef fileapi::FileSystemOperation::FileEntryList FileEntryList; + typedef storage::FileSystemOperation::FileEntryList FileEntryList; enum QuotaMode { QUOTA_ENABLED, @@ -83,7 +83,7 @@ class CannedSyncableFileSystem void TearDown(); // Creates a FileSystemURL for the given (utf8) path string. - fileapi::FileSystemURL URL(const std::string& path) const; + storage::FileSystemURL URL(const std::string& path) const; // Initialize this with given |sync_context| if it hasn't // been initialized. @@ -100,13 +100,13 @@ class CannedSyncableFileSystem void RemoveSyncStatusObserver(LocalFileSyncStatus::Observer* observer); // Accessors. - fileapi::FileSystemContext* file_system_context() { + storage::FileSystemContext* file_system_context() { return file_system_context_.get(); } - quota::QuotaManager* quota_manager() { return quota_manager_.get(); } + storage::QuotaManager* quota_manager() { return quota_manager_.get(); } GURL origin() const { return origin_; } - fileapi::FileSystemType type() const { return type_; } - quota::StorageType storage_type() const { + storage::FileSystemType type() const { return type_; } + storage::StorageType storage_type() const { return FileSystemTypeToQuotaStorageType(type_); } @@ -114,101 +114,100 @@ class CannedSyncableFileSystem // OpenFileSystem() must have been called before calling any of them. // They create an operation and run it on IO task runner, and the operation // posts a task on file runner. - base::File::Error CreateDirectory(const fileapi::FileSystemURL& url); - base::File::Error CreateFile(const fileapi::FileSystemURL& url); - base::File::Error Copy(const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url); - base::File::Error Move(const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url); - base::File::Error TruncateFile(const fileapi::FileSystemURL& url, - int64 size); - base::File::Error TouchFile(const fileapi::FileSystemURL& url, + base::File::Error CreateDirectory(const storage::FileSystemURL& url); + base::File::Error CreateFile(const storage::FileSystemURL& url); + base::File::Error Copy(const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url); + base::File::Error Move(const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url); + base::File::Error TruncateFile(const storage::FileSystemURL& url, int64 size); + base::File::Error TouchFile(const storage::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time); - base::File::Error Remove(const fileapi::FileSystemURL& url, bool recursive); - base::File::Error FileExists(const fileapi::FileSystemURL& url); - base::File::Error DirectoryExists(const fileapi::FileSystemURL& url); - base::File::Error VerifyFile(const fileapi::FileSystemURL& url, + base::File::Error Remove(const storage::FileSystemURL& url, bool recursive); + base::File::Error FileExists(const storage::FileSystemURL& url); + base::File::Error DirectoryExists(const storage::FileSystemURL& url); + base::File::Error VerifyFile(const storage::FileSystemURL& url, const std::string& expected_data); base::File::Error GetMetadataAndPlatformPath( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, base::File::Info* info, base::FilePath* platform_path); - base::File::Error ReadDirectory(const fileapi::FileSystemURL& url, + base::File::Error ReadDirectory(const storage::FileSystemURL& url, FileEntryList* entries); // Returns the # of bytes written (>=0) or an error code (<0). int64 Write(net::URLRequestContext* url_request_context, - const fileapi::FileSystemURL& url, - scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle); - int64 WriteString(const fileapi::FileSystemURL& url, const std::string& data); + const storage::FileSystemURL& url, + scoped_ptr<storage::BlobDataHandle> blob_data_handle); + int64 WriteString(const storage::FileSystemURL& url, const std::string& data); // Purges the file system local storage. base::File::Error DeleteFileSystem(); // Retrieves the quota and usage. - quota::QuotaStatusCode GetUsageAndQuota(int64* usage, int64* quota); + storage::QuotaStatusCode GetUsageAndQuota(int64* usage, int64* quota); // ChangeTracker related methods. They run on file task runner. - void GetChangedURLsInTracker(fileapi::FileSystemURLSet* urls); - void ClearChangeForURLInTracker(const fileapi::FileSystemURL& url); - void GetChangesForURLInTracker(const fileapi::FileSystemURL& url, + void GetChangedURLsInTracker(storage::FileSystemURLSet* urls); + void ClearChangeForURLInTracker(const storage::FileSystemURL& url); + void GetChangesForURLInTracker(const storage::FileSystemURL& url, FileChangeList* changes); SyncFileSystemBackend* backend(); - fileapi::FileSystemOperationRunner* operation_runner(); + storage::FileSystemOperationRunner* operation_runner(); // LocalFileSyncStatus::Observer overrides. - virtual void OnSyncEnabled(const fileapi::FileSystemURL& url) OVERRIDE; - virtual void OnWriteEnabled(const fileapi::FileSystemURL& url) OVERRIDE; + virtual void OnSyncEnabled(const storage::FileSystemURL& url) OVERRIDE; + virtual void OnWriteEnabled(const storage::FileSystemURL& url) OVERRIDE; // Operation methods body. // They can be also called directly if the caller is already on IO thread. void DoOpenFileSystem(const OpenFileSystemCallback& callback); - void DoCreateDirectory(const fileapi::FileSystemURL& url, + void DoCreateDirectory(const storage::FileSystemURL& url, const StatusCallback& callback); - void DoCreateFile(const fileapi::FileSystemURL& url, + void DoCreateFile(const storage::FileSystemURL& url, const StatusCallback& callback); - void DoCopy(const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + void DoCopy(const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback); - void DoMove(const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + void DoMove(const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback); - void DoTruncateFile(const fileapi::FileSystemURL& url, + void DoTruncateFile(const storage::FileSystemURL& url, int64 size, const StatusCallback& callback); - void DoTouchFile(const fileapi::FileSystemURL& url, + void DoTouchFile(const storage::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time, const StatusCallback& callback); - void DoRemove(const fileapi::FileSystemURL& url, + void DoRemove(const storage::FileSystemURL& url, bool recursive, const StatusCallback& callback); - void DoFileExists(const fileapi::FileSystemURL& url, + void DoFileExists(const storage::FileSystemURL& url, const StatusCallback& callback); - void DoDirectoryExists(const fileapi::FileSystemURL& url, + void DoDirectoryExists(const storage::FileSystemURL& url, const StatusCallback& callback); - void DoVerifyFile(const fileapi::FileSystemURL& url, + void DoVerifyFile(const storage::FileSystemURL& url, const std::string& expected_data, const StatusCallback& callback); - void DoGetMetadataAndPlatformPath(const fileapi::FileSystemURL& url, + void DoGetMetadataAndPlatformPath(const storage::FileSystemURL& url, base::File::Info* info, base::FilePath* platform_path, const StatusCallback& callback); - void DoReadDirectory(const fileapi::FileSystemURL& url, + void DoReadDirectory(const storage::FileSystemURL& url, FileEntryList* entries, const StatusCallback& callback); void DoWrite(net::URLRequestContext* url_request_context, - const fileapi::FileSystemURL& url, - scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle, + const storage::FileSystemURL& url, + scoped_ptr<storage::BlobDataHandle> blob_data_handle, const WriteCallback& callback); - void DoWriteString(const fileapi::FileSystemURL& url, + void DoWriteString(const storage::FileSystemURL& url, const std::string& data, const WriteCallback& callback); void DoGetUsageAndQuota(int64* usage, int64* quota, - const quota::StatusCallback& callback); + const storage::StatusCallback& callback); private: typedef ObserverListThreadSafe<LocalFileSyncStatus::Observer> ObserverList; @@ -227,10 +226,10 @@ class CannedSyncableFileSystem base::ScopedTempDir data_dir_; const std::string service_name_; - scoped_refptr<quota::QuotaManager> quota_manager_; - scoped_refptr<fileapi::FileSystemContext> file_system_context_; + scoped_refptr<storage::QuotaManager> quota_manager_; + scoped_refptr<storage::FileSystemContext> file_system_context_; const GURL origin_; - const fileapi::FileSystemType type_; + const storage::FileSystemType type_; GURL root_url_; base::File::Error result_; sync_file_system::SyncStatusCode sync_status_; diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc index 4cb560e..cbf48e3 100644 --- a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc +++ b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc @@ -21,11 +21,11 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/common/fileapi/file_system_util.h" -using fileapi::FileSystemContext; -using fileapi::FileSystemFileUtil; -using fileapi::FileSystemOperationContext; -using fileapi::FileSystemURL; -using fileapi::FileSystemURLSet; +using storage::FileSystemContext; +using storage::FileSystemFileUtil; +using storage::FileSystemOperationContext; +using storage::FileSystemURL; +using storage::FileSystemURLSet; namespace sync_file_system { @@ -172,14 +172,14 @@ void LocalFileChangeTracker::ClearChangesForURL(const FileSystemURL& url) { } void LocalFileChangeTracker::CreateFreshMirrorForURL( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); DCHECK(!ContainsKey(mirror_changes_, url)); mirror_changes_[url] = ChangeInfo(); } void LocalFileChangeTracker::RemoveMirrorAndCommitChangesForURL( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); FileChangeMap::iterator found = mirror_changes_.find(url); if (found == mirror_changes_.end()) @@ -194,7 +194,7 @@ void LocalFileChangeTracker::RemoveMirrorAndCommitChangesForURL( } void LocalFileChangeTracker::ResetToMirrorAndCommitChangesForURL( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); FileChangeMap::iterator found = mirror_changes_.find(url); if (found == mirror_changes_.end() || found->second.change_list.empty()) { @@ -214,7 +214,7 @@ void LocalFileChangeTracker::ResetToMirrorAndCommitChangesForURL( } void LocalFileChangeTracker::DemoteChangesForURL( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); FileChangeMap::iterator found = changes_.find(url); @@ -228,7 +228,7 @@ void LocalFileChangeTracker::DemoteChangesForURL( } void LocalFileChangeTracker::PromoteDemotedChangesForURL( - const fileapi::FileSystemURL& url) { + const storage::FileSystemURL& url) { DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); FileChangeMap::iterator iter = demoted_changes_.find(url); @@ -251,7 +251,7 @@ bool LocalFileChangeTracker::PromoteDemotedChanges() { if (demoted_changes_.empty()) return false; while (!demoted_changes_.empty()) { - fileapi::FileSystemURL url = demoted_changes_.begin()->first; + storage::FileSystemURL url = demoted_changes_.begin()->first; PromoteDemotedChangesForURL(url); } UpdateNumChanges(); @@ -270,14 +270,13 @@ SyncStatusCode LocalFileChangeTracker::Initialize( return status; } -void LocalFileChangeTracker::ResetForFileSystem( - const GURL& origin, - fileapi::FileSystemType type) { +void LocalFileChangeTracker::ResetForFileSystem(const GURL& origin, + storage::FileSystemType type) { DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); scoped_ptr<leveldb::WriteBatch> batch(new leveldb::WriteBatch); for (FileChangeMap::iterator iter = changes_.begin(); iter != changes_.end();) { - fileapi::FileSystemURL url = iter->first; + storage::FileSystemURL url = iter->first; int change_seq = iter->second.change_seq; // Advance |iter| before calling ResetForURL to avoid the iterator // invalidation in it. @@ -288,7 +287,7 @@ void LocalFileChangeTracker::ResetForFileSystem( for (FileChangeMap::iterator iter = demoted_changes_.begin(); iter != demoted_changes_.end();) { - fileapi::FileSystemURL url = iter->first; + storage::FileSystemURL url = iter->first; int change_seq = iter->second.change_seq; // Advance |iter| before calling ResetForURL to avoid the iterator // invalidation in it. @@ -364,7 +363,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges( while (!dirty_files.empty()) { const FileSystemURL url = dirty_files.front(); dirty_files.pop(); - DCHECK_EQ(url.type(), fileapi::kFileSystemTypeSyncable); + DCHECK_EQ(url.type(), storage::kFileSystemTypeSyncable); switch (file_util->GetFileInfo(context.get(), url, &file_info, &platform_path)) { @@ -445,7 +444,7 @@ void LocalFileChangeTracker::RecordChangeToChangeMaps( (*change_seqs)[info.change_seq] = url; } -void LocalFileChangeTracker::ResetForURL(const fileapi::FileSystemURL& url, +void LocalFileChangeTracker::ResetForURL(const storage::FileSystemURL& url, int change_seq, leveldb::WriteBatch* batch) { mirror_changes_.erase(url); @@ -474,8 +473,8 @@ SyncStatusCode LocalFileChangeTracker::TrackerDB::Init( if (db_.get() && db_status_ == SYNC_STATUS_OK) return SYNC_STATUS_OK; - std::string path = fileapi::FilePathToString( - base_path_.Append(kDatabaseName)); + std::string path = + storage::FilePathToString(base_path_.Append(kDatabaseName)); leveldb::Options options; options.max_open_files = 0; // Use minimum. options.create_if_missing = true; diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker.h b/chrome/browser/sync_file_system/local/local_file_change_tracker.h index 104e1e5..b859530 100644 --- a/chrome/browser/sync_file_system/local/local_file_change_tracker.h +++ b/chrome/browser/sync_file_system/local/local_file_change_tracker.h @@ -24,7 +24,7 @@ namespace base { class SequencedTaskRunner; } -namespace fileapi { +namespace storage { class FileSystemContext; class FileSystemURL; } @@ -39,9 +39,8 @@ namespace sync_file_system { // Tracks local file changes for cloud-backed file systems. // All methods must be called on the file_task_runner given to the constructor. // Owned by FileSystemContext. -class LocalFileChangeTracker - : public fileapi::FileUpdateObserver, - public fileapi::FileChangeObserver { +class LocalFileChangeTracker : public storage::FileUpdateObserver, + public storage::FileChangeObserver { public: // |file_task_runner| must be the one where the observee file operations run. // (So that we can make sure DB operations are done before actual update @@ -52,54 +51,54 @@ class LocalFileChangeTracker virtual ~LocalFileChangeTracker(); // FileUpdateObserver overrides. - virtual void OnStartUpdate(const fileapi::FileSystemURL& url) OVERRIDE; - virtual void OnUpdate( - const fileapi::FileSystemURL& url, int64 delta) OVERRIDE {} - virtual void OnEndUpdate(const fileapi::FileSystemURL& url) OVERRIDE; + virtual void OnStartUpdate(const storage::FileSystemURL& url) OVERRIDE; + virtual void OnUpdate(const storage::FileSystemURL& url, + int64 delta) OVERRIDE {} + virtual void OnEndUpdate(const storage::FileSystemURL& url) OVERRIDE; // FileChangeObserver overrides. - virtual void OnCreateFile(const fileapi::FileSystemURL& url) OVERRIDE; - virtual void OnCreateFileFrom(const fileapi::FileSystemURL& url, - const fileapi::FileSystemURL& src) OVERRIDE; - virtual void OnRemoveFile(const fileapi::FileSystemURL& url) OVERRIDE; - virtual void OnModifyFile(const fileapi::FileSystemURL& url) OVERRIDE; - virtual void OnCreateDirectory(const fileapi::FileSystemURL& url) OVERRIDE; - virtual void OnRemoveDirectory(const fileapi::FileSystemURL& url) OVERRIDE; + virtual void OnCreateFile(const storage::FileSystemURL& url) OVERRIDE; + virtual void OnCreateFileFrom(const storage::FileSystemURL& url, + const storage::FileSystemURL& src) OVERRIDE; + virtual void OnRemoveFile(const storage::FileSystemURL& url) OVERRIDE; + virtual void OnModifyFile(const storage::FileSystemURL& url) OVERRIDE; + virtual void OnCreateDirectory(const storage::FileSystemURL& url) OVERRIDE; + virtual void OnRemoveDirectory(const storage::FileSystemURL& url) OVERRIDE; // Retrieves an array of |url| which have more than one pending changes. // If |max_urls| is non-zero (recommended in production code) this // returns URLs up to the number from the ones that have smallest // change_seq numbers (i.e. older changes). - void GetNextChangedURLs(std::deque<fileapi::FileSystemURL>* urls, + void GetNextChangedURLs(std::deque<storage::FileSystemURL>* urls, int max_urls); // Returns all changes recorded for the given |url|. // Note that this also returns demoted changes. // This should be called after writing is disabled. - void GetChangesForURL(const fileapi::FileSystemURL& url, + void GetChangesForURL(const storage::FileSystemURL& url, FileChangeList* changes); // Clears the pending changes recorded in this tracker for |url|. - void ClearChangesForURL(const fileapi::FileSystemURL& url); + void ClearChangesForURL(const storage::FileSystemURL& url); // Creates a fresh (empty) in-memory record for |url|. // Note that new changes are recorded to the mirror too. - void CreateFreshMirrorForURL(const fileapi::FileSystemURL& url); + void CreateFreshMirrorForURL(const storage::FileSystemURL& url); // Removes a mirror for |url|, and commits the change status to database. - void RemoveMirrorAndCommitChangesForURL(const fileapi::FileSystemURL& url); + void RemoveMirrorAndCommitChangesForURL(const storage::FileSystemURL& url); // Resets the changes to the ones recorded in mirror for |url|, and // commits the updated change status to database. - void ResetToMirrorAndCommitChangesForURL(const fileapi::FileSystemURL& url); + void ResetToMirrorAndCommitChangesForURL(const storage::FileSystemURL& url); // Re-inserts changes into the separate demoted_changes_ queue. They won't // be fetched by GetNextChangedURLs() unless PromoteDemotedChanges() is // called. - void DemoteChangesForURL(const fileapi::FileSystemURL& url); + void DemoteChangesForURL(const storage::FileSystemURL& url); // Promotes demoted changes for |url| to the normal queue. - void PromoteDemotedChangesForURL(const fileapi::FileSystemURL& url); + void PromoteDemotedChangesForURL(const storage::FileSystemURL& url); // Promotes all demoted changes to the normal queue. Returns true if it has // promoted any changes. @@ -107,12 +106,12 @@ class LocalFileChangeTracker // Called by FileSyncService at the startup time to restore last dirty changes // left after the last shutdown (if any). - SyncStatusCode Initialize(fileapi::FileSystemContext* file_system_context); + SyncStatusCode Initialize(storage::FileSystemContext* file_system_context); // Resets all the changes recorded for the given |origin| and |type|. // TODO(kinuko,nhiroki): Ideally this should be automatically called in // DeleteFileSystem via QuotaUtil::DeleteOriginDataOnFileThread. - void ResetForFileSystem(const GURL& origin, fileapi::FileSystemType type); + void ResetForFileSystem(const GURL& origin, storage::FileSystemType type); // This method is (exceptionally) thread-safe. int64 num_changes() const { @@ -135,37 +134,37 @@ class LocalFileChangeTracker int64 change_seq; }; - typedef std::map<fileapi::FileSystemURL, ChangeInfo, - fileapi::FileSystemURL::Comparator> - FileChangeMap; - typedef std::map<int64, fileapi::FileSystemURL> ChangeSeqMap; + typedef std::map<storage::FileSystemURL, + ChangeInfo, + storage::FileSystemURL::Comparator> FileChangeMap; + typedef std::map<int64, storage::FileSystemURL> ChangeSeqMap; void UpdateNumChanges(); // This does mostly same as calling GetNextChangedURLs with max_url=0 // except that it returns urls in set rather than in deque. // Used only in testings. - void GetAllChangedURLs(fileapi::FileSystemURLSet* urls); + void GetAllChangedURLs(storage::FileSystemURLSet* urls); // Used only in testings. void DropAllChanges(); // Database related methods. - SyncStatusCode MarkDirtyOnDatabase(const fileapi::FileSystemURL& url); - SyncStatusCode ClearDirtyOnDatabase(const fileapi::FileSystemURL& url); + SyncStatusCode MarkDirtyOnDatabase(const storage::FileSystemURL& url); + SyncStatusCode ClearDirtyOnDatabase(const storage::FileSystemURL& url); SyncStatusCode CollectLastDirtyChanges( - fileapi::FileSystemContext* file_system_context); - void RecordChange(const fileapi::FileSystemURL& url, + storage::FileSystemContext* file_system_context); + void RecordChange(const storage::FileSystemURL& url, const FileChange& change); - static void RecordChangeToChangeMaps(const fileapi::FileSystemURL& url, + static void RecordChangeToChangeMaps(const storage::FileSystemURL& url, const FileChange& change, int change_seq, FileChangeMap* changes, ChangeSeqMap* change_seqs); - void ResetForURL(const fileapi::FileSystemURL& url, + void ResetForURL(const storage::FileSystemURL& url, int change_seq, leveldb::WriteBatch* batch); diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc b/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc index cada3cb..ecef446 100644 --- a/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_change_tracker_unittest.cc @@ -25,9 +25,9 @@ #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/quota/quota_manager.h" -using fileapi::FileSystemContext; -using fileapi::FileSystemURL; -using fileapi::FileSystemURLSet; +using storage::FileSystemContext; +using storage::FileSystemURL; +using storage::FileSystemURLSet; using content::MockBlobURLRequestContext; using content::ScopedTextBlob; @@ -106,7 +106,7 @@ class LocalFileChangeTrackerTest : public testing::Test { change_tracker()->CollectLastDirtyChanges(file_system_context()); } - void GetAllChangedURLs(fileapi::FileSystemURLSet* urls) { + void GetAllChangedURLs(storage::FileSystemURLSet* urls) { change_tracker()->GetAllChangedURLs(urls); } diff --git a/chrome/browser/sync_file_system/local/local_file_sync_context.cc b/chrome/browser/sync_file_system/local/local_file_sync_context.cc index 93acf73..3b6ac54 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_context.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_context.cc @@ -26,11 +26,11 @@ #include "webkit/common/blob/scoped_file.h" #include "webkit/common/fileapi/file_system_util.h" -using fileapi::FileSystemContext; -using fileapi::FileSystemFileUtil; -using fileapi::FileSystemOperation; -using fileapi::FileSystemOperationContext; -using fileapi::FileSystemURL; +using storage::FileSystemContext; +using storage::FileSystemFileUtil; +using storage::FileSystemOperation; +using storage::FileSystemOperationContext; +using storage::FileSystemURL; namespace sync_file_system { @@ -82,16 +82,20 @@ void LocalFileSyncContext::MaybeInitializeFileSystemContext( // for writable way (even when MaybeInitializeFileSystemContext is called // from read-only OpenFileSystem), so open the filesystem with // CREATE_IF_NONEXISTENT here. - fileapi::FileSystemBackend::OpenFileSystemCallback open_filesystem_callback = + storage::FileSystemBackend::OpenFileSystemCallback open_filesystem_callback = base::Bind(&LocalFileSyncContext::InitializeFileSystemContextOnIOThread, - this, source_url, make_scoped_refptr(file_system_context)); + this, + source_url, + make_scoped_refptr(file_system_context)); io_task_runner_->PostTask( FROM_HERE, - base::Bind(&fileapi::SandboxFileSystemBackendDelegate::OpenFileSystem, + base::Bind(&storage::SandboxFileSystemBackendDelegate::OpenFileSystem, base::Unretained(file_system_context->sandbox_delegate()), - source_url, fileapi::kFileSystemTypeSyncable, - fileapi::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, - open_filesystem_callback, GURL())); + source_url, + storage::kFileSystemTypeSyncable, + storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, + open_filesystem_callback, + GURL())); } void LocalFileSyncContext::ShutdownOnUIThread() { @@ -145,8 +149,8 @@ void LocalFileSyncContext::ClearChangesForURL( } void LocalFileSyncContext::FinalizeSnapshotSync( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, + storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, SyncStatusCode sync_finish_status, const base::Closure& done_callback) { DCHECK(file_system_context); @@ -186,8 +190,8 @@ void LocalFileSyncContext::FinalizeSnapshotSync( } void LocalFileSyncContext::FinalizeExclusiveSync( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, + storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, bool clear_local_changes, const base::Closure& done_callback) { DCHECK(file_system_context); @@ -306,7 +310,7 @@ void LocalFileSyncContext::HandleRemoteDelete( file_system_context, url); // Handle root directory case differently. - if (fileapi::VirtualPath::IsRootPath(url.path())) { + if (storage::VirtualPath::IsRootPath(url.path())) { DCHECK(!root_delete_helper_); root_delete_helper_.reset(new RootDeleteHelper( file_system_context, sync_status(), url, @@ -331,7 +335,7 @@ void LocalFileSyncContext::HandleRemoteAddOrUpdate( FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( file_system_context, url); - if (fileapi::VirtualPath::IsRootPath(url.path())) { + if (storage::VirtualPath::IsRootPath(url.path())) { DidApplyRemoteChange(url, callback, base::File::FILE_OK); return; } @@ -376,9 +380,9 @@ void LocalFileSyncContext::DidRemoveExistingEntryForRemoteAddOrUpdate( switch (change.file_type()) { case SYNC_FILE_TYPE_FILE: { DCHECK(!local_path.empty()); - base::FilePath dir_path = fileapi::VirtualPath::DirName(url.path()); + base::FilePath dir_path = storage::VirtualPath::DirName(url.path()); if (dir_path.empty() || - fileapi::VirtualPath::DirName(dir_path) == dir_path) { + storage::VirtualPath::DirName(dir_path) == dir_path) { // Copying into the root directory. file_system_context->operation_runner()->CopyInForeignFile( local_path, url_for_sync, operation_callback); @@ -386,7 +390,7 @@ void LocalFileSyncContext::DidRemoveExistingEntryForRemoteAddOrUpdate( FileSystemURL dir_url = file_system_context->CreateCrackedFileSystemURL( url_for_sync.origin(), url_for_sync.mount_type(), - fileapi::VirtualPath::DirName(url_for_sync.virtual_path())); + storage::VirtualPath::DirName(url_for_sync.virtual_path())); file_system_context->operation_runner()->CreateDirectory( dir_url, false /* exclusive */, @@ -496,7 +500,7 @@ void LocalFileSyncContext::HasPendingLocalChanges( void LocalFileSyncContext::PromoteDemotedChanges( const GURL& origin, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const base::Closure& callback) { // This is initially called on UI thread and to be relayed to FILE thread. DCHECK(file_system_context); @@ -798,14 +802,14 @@ void LocalFileSyncContext::TryPrepareForLocalSync( DCHECK(urls); if (shutdown_on_ui_) { - callback.Run(SYNC_STATUS_ABORT, LocalFileSyncInfo(), - webkit_blob::ScopedFile()); + callback.Run(SYNC_STATUS_ABORT, LocalFileSyncInfo(), storage::ScopedFile()); return; } if (urls->empty()) { - callback.Run(SYNC_STATUS_NO_CHANGE_TO_SYNC, LocalFileSyncInfo(), - webkit_blob::ScopedFile()); + callback.Run(SYNC_STATUS_NO_CHANGE_TO_SYNC, + LocalFileSyncInfo(), + storage::ScopedFile()); return; } @@ -825,7 +829,7 @@ void LocalFileSyncContext::DidTryPrepareForLocalSync( const LocalFileSyncInfoCallback& callback, SyncStatusCode status, const LocalFileSyncInfo& sync_file_info, - webkit_blob::ScopedFile snapshot) { + storage::ScopedFile snapshot) { DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); if (status != SYNC_STATUS_FILE_BUSY) { PromoteDemotedChangesForURLs(file_system_context, @@ -897,8 +901,8 @@ void LocalFileSyncContext::DidGetWritingStatusForSync( RunsTasksOnCurrentThread()) { DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); if (shutdown_on_ui_) { - callback.Run(SYNC_STATUS_ABORT, LocalFileSyncInfo(), - webkit_blob::ScopedFile()); + callback.Run( + SYNC_STATUS_ABORT, LocalFileSyncInfo(), storage::ScopedFile()); return; } file_system_context->default_file_task_runner()->PostTask( @@ -929,17 +933,17 @@ void LocalFileSyncContext::DidGetWritingStatusForSync( &file_info, &platform_path); - webkit_blob::ScopedFile snapshot; + storage::ScopedFile snapshot; if (file_error == base::File::FILE_OK && sync_mode == SYNC_SNAPSHOT) { base::FilePath snapshot_path; base::CreateTemporaryFileInDir(local_base_path_.Append(kSnapshotDir), &snapshot_path); if (base::CopyFile(platform_path, snapshot_path)) { platform_path = snapshot_path; - snapshot = webkit_blob::ScopedFile( - snapshot_path, - webkit_blob::ScopedFile::DELETE_ON_SCOPE_OUT, - file_system_context->default_file_task_runner()); + snapshot = + storage::ScopedFile(snapshot_path, + storage::ScopedFile::DELETE_ON_SCOPE_OUT, + file_system_context->default_file_task_runner()); } } diff --git a/chrome/browser/sync_file_system/local/local_file_sync_context.h b/chrome/browser/sync_file_system/local/local_file_sync_context.h index f293ae5..0549ff9 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_context.h +++ b/chrome/browser/sync_file_system/local/local_file_sync_context.h @@ -29,7 +29,7 @@ namespace base { class SingleThreadTaskRunner; } -namespace fileapi { +namespace storage { class FileSystemContext; class FileSystemURL; } @@ -38,7 +38,7 @@ namespace leveldb { class Env; } -namespace webkit_blob { +namespace storage { class ScopedFile; } @@ -65,11 +65,10 @@ class LocalFileSyncContext SYNC_SNAPSHOT, }; - typedef base::Callback<void( - SyncStatusCode status, - const LocalFileSyncInfo& sync_file_info, - webkit_blob::ScopedFile snapshot)> - LocalFileSyncInfoCallback; + typedef base::Callback<void(SyncStatusCode status, + const LocalFileSyncInfo& sync_file_info, + storage::ScopedFile snapshot)> + LocalFileSyncInfoCallback; typedef base::Callback<void(SyncStatusCode status, bool has_pending_changes)> @@ -86,7 +85,7 @@ class LocalFileSyncContext // This method must be called on UI thread. void MaybeInitializeFileSystemContext( const GURL& source_url, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const SyncStatusCallback& callback); // Called when the corresponding LocalFileSyncService exits. @@ -96,15 +95,15 @@ class LocalFileSyncContext // Picks a file for next local sync and returns it after disabling writes // for the file. // This method must be called on UI thread. - void GetFileForLocalSync(fileapi::FileSystemContext* file_system_context, + void GetFileForLocalSync(storage::FileSystemContext* file_system_context, const LocalFileSyncInfoCallback& callback); // TODO(kinuko): Make this private. // Clears all pending local changes for |url|. |done_callback| is called // when the changes are cleared. // This method must be called on UI thread. - void ClearChangesForURL(fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, + void ClearChangesForURL(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, const base::Closure& done_callback); // Finalizes SnapshotSync, which must have been started by @@ -113,19 +112,17 @@ class LocalFileSyncContext // This will clear the dirty flag if |sync_finish_status| is SYNC_STATUS_OK // or SYNC_STATUS_HAS_CONFLICT. // |done_callback| is called when the changes are committed. - void FinalizeSnapshotSync( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, - SyncStatusCode sync_finish_status, - const base::Closure& done_callback); + void FinalizeSnapshotSync(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, + SyncStatusCode sync_finish_status, + const base::Closure& done_callback); // Finalizes ExclusiveSync, which must have been started by // PrepareForSync with SYNC_EXCLUSIVE. - void FinalizeExclusiveSync( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, - bool clear_local_changes, - const base::Closure& done_callback); + void FinalizeExclusiveSync(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, + bool clear_local_changes, + const base::Closure& done_callback); // Prepares for sync |url| by disabling writes on |url|. // If the target |url| is being written and cannot start sync it @@ -142,8 +139,8 @@ class LocalFileSyncContext // sync to reset the mirrored change status and decrement writing count. // // This method must be called on UI thread. - void PrepareForSync(fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, + void PrepareForSync(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, SyncMode sync_mode, const LocalFileSyncInfoCallback& callback); @@ -156,40 +153,36 @@ class LocalFileSyncContext // for sync will overwrite the previously registered URL. // // This method must be called on UI thread. - void RegisterURLForWaitingSync(const fileapi::FileSystemURL& url, + void RegisterURLForWaitingSync(const storage::FileSystemURL& url, const base::Closure& on_syncable_callback); // Applies a remote change. // This method must be called on UI thread. - void ApplyRemoteChange( - fileapi::FileSystemContext* file_system_context, - const FileChange& change, - const base::FilePath& local_path, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback); + void ApplyRemoteChange(storage::FileSystemContext* file_system_context, + const FileChange& change, + const base::FilePath& local_path, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback); // Records a fake local change in the local change tracker. - void RecordFakeLocalChange( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, - const FileChange& change, - const SyncStatusCallback& callback); + void RecordFakeLocalChange(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, + const FileChange& change, + const SyncStatusCallback& callback); // This must be called on UI thread. - void GetFileMetadata( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, - const SyncFileMetadataCallback& callback); + void GetFileMetadata(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, + const SyncFileMetadataCallback& callback); // Returns true via |callback| if the given file |url| has local pending // changes. - void HasPendingLocalChanges( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, - const HasPendingLocalChangeCallback& callback); + void HasPendingLocalChanges(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, + const HasPendingLocalChangeCallback& callback); void PromoteDemotedChanges(const GURL& origin, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const base::Closure& callback); void UpdateChangesForOrigin(const GURL& origin, const base::Closure& callback); @@ -212,13 +205,13 @@ class LocalFileSyncContext protected: // LocalFileSyncStatus::Observer overrides. They are called on IO thread. - virtual void OnSyncEnabled(const fileapi::FileSystemURL& url) OVERRIDE; - virtual void OnWriteEnabled(const fileapi::FileSystemURL& url) OVERRIDE; + virtual void OnSyncEnabled(const storage::FileSystemURL& url) OVERRIDE; + virtual void OnWriteEnabled(const storage::FileSystemURL& url) OVERRIDE; private: typedef base::Callback<void(base::File::Error result)> StatusCallback; typedef std::deque<SyncStatusCallback> StatusCallbackQueue; - typedef std::deque<fileapi::FileSystemURL> FileSystemURLQueue; + typedef std::deque<storage::FileSystemURL> FileSystemURLQueue; friend class base::RefCountedThreadSafe<LocalFileSyncContext>; friend class CannedSyncableFileSystem; @@ -241,51 +234,49 @@ class LocalFileSyncContext // Helper routines for MaybeInitializeFileSystemContext. void InitializeFileSystemContextOnIOThread( const GURL& source_url, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const GURL& /* root */, const std::string& /* name */, base::File::Error error); SyncStatusCode InitializeChangeTrackerOnFileThread( scoped_ptr<LocalFileChangeTracker>* tracker_ptr, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, std::set<GURL>* origins_with_changes); void DidInitializeChangeTrackerOnIOThread( scoped_ptr<LocalFileChangeTracker>* tracker_ptr, const GURL& source_url, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, std::set<GURL>* origins_with_changes, SyncStatusCode status); - void DidInitialize( - const GURL& source_url, - fileapi::FileSystemContext* file_system_context, - SyncStatusCode status); + void DidInitialize(const GURL& source_url, + storage::FileSystemContext* file_system_context, + SyncStatusCode status); // Helper routines for GetFileForLocalSync. scoped_ptr<FileSystemURLQueue> GetNextURLsForSyncOnFileThread( - fileapi::FileSystemContext* file_system_context); - void TryPrepareForLocalSync( - fileapi::FileSystemContext* file_system_context, - const LocalFileSyncInfoCallback& callback, - scoped_ptr<FileSystemURLQueue> urls); + storage::FileSystemContext* file_system_context); + void TryPrepareForLocalSync(storage::FileSystemContext* file_system_context, + const LocalFileSyncInfoCallback& callback, + scoped_ptr<FileSystemURLQueue> urls); void DidTryPrepareForLocalSync( - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, scoped_ptr<FileSystemURLQueue> remaining_urls, const LocalFileSyncInfoCallback& callback, SyncStatusCode status, const LocalFileSyncInfo& sync_file_info, - webkit_blob::ScopedFile snapshot); + storage::ScopedFile snapshot); void PromoteDemotedChangesForURL( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url); + storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url); void PromoteDemotedChangesForURLs( - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, scoped_ptr<FileSystemURLQueue> url); // Callback routine for PrepareForSync and GetFileForLocalSync. void DidGetWritingStatusForSync( - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, SyncStatusCode status, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, SyncMode sync_mode, const LocalFileSyncInfoCallback& callback); @@ -296,33 +287,30 @@ class LocalFileSyncContext // won't step in while snapshot sync is ongoing. // In this case FinalizeSnapshotSyncOnIOThread must be called after the // snapshot sync is finished to decrement the writing counter. - void ClearSyncFlagOnIOThread(const fileapi::FileSystemURL& url, + void ClearSyncFlagOnIOThread(const storage::FileSystemURL& url, bool for_snapshot_sync); - void FinalizeSnapshotSyncOnIOThread(const fileapi::FileSystemURL& url); - - void HandleRemoteDelete( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback); - void HandleRemoteAddOrUpdate( - fileapi::FileSystemContext* file_system_context, - const FileChange& change, - const base::FilePath& local_path, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback); + void FinalizeSnapshotSyncOnIOThread(const storage::FileSystemURL& url); + + void HandleRemoteDelete(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback); + void HandleRemoteAddOrUpdate(storage::FileSystemContext* file_system_context, + const FileChange& change, + const base::FilePath& local_path, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback); void DidRemoveExistingEntryForRemoteAddOrUpdate( - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const FileChange& change, const base::FilePath& local_path, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const SyncStatusCallback& callback, base::File::Error error); // Callback routine for ApplyRemoteChange. - void DidApplyRemoteChange( - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback_on_ui, - base::File::Error file_error); + void DidApplyRemoteChange(const storage::FileSystemURL& url, + const SyncStatusCallback& callback_on_ui, + base::File::Error file_error); void DidGetFileMetadata( const SyncFileMetadataCallback& callback, @@ -332,9 +320,9 @@ class LocalFileSyncContext base::TimeDelta NotifyChangesDuration(); void DidCreateDirectoryForCopyIn( - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const base::FilePath& local_file_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback, base::File::Error error); @@ -358,15 +346,15 @@ class LocalFileSyncContext // Pointers to file system contexts that have been initialized for // synchronization (i.e. that own this instance). // This must be accessed only on UI thread. - std::set<fileapi::FileSystemContext*> file_system_contexts_; + std::set<storage::FileSystemContext*> file_system_contexts_; // Accessed only on UI thread. - std::map<fileapi::FileSystemContext*, StatusCallbackQueue> + std::map<storage::FileSystemContext*, StatusCallbackQueue> pending_initialize_callbacks_; // A URL and associated callback waiting for sync is enabled. // Accessed only on IO thread. - fileapi::FileSystemURL url_waiting_sync_on_io_; + storage::FileSystemURL url_waiting_sync_on_io_; base::Closure url_syncable_callback_; // Used only on IO thread for available changes notifications. diff --git a/chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc b/chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc index ca4c83d..066394f 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_context_unittest.cc @@ -32,9 +32,9 @@ #define FPL FILE_PATH_LITERAL using content::BrowserThread; -using fileapi::FileSystemContext; -using fileapi::FileSystemURL; -using fileapi::FileSystemURLSet; +using storage::FileSystemContext; +using storage::FileSystemURL; +using storage::FileSystemURLSet; // This tests LocalFileSyncContext behavior in multi-thread / // multi-file-system-context environment. @@ -81,7 +81,7 @@ class LocalFileSyncContextTest : public testing::Test { LocalFileSyncContext::SyncMode sync_mode, SyncFileMetadata* metadata, FileChangeList* changes, - webkit_blob::ScopedFile* snapshot) { + storage::ScopedFile* snapshot) { ASSERT_TRUE(changes != NULL); ASSERT_FALSE(has_inflight_prepare_for_sync_); status_ = SYNC_STATUS_UNKNOWN; @@ -99,7 +99,7 @@ class LocalFileSyncContextTest : public testing::Test { LocalFileSyncContext::SyncMode sync_mode, SyncFileMetadata* metadata, FileChangeList* changes, - webkit_blob::ScopedFile* snapshot) { + storage::ScopedFile* snapshot) { StartPrepareForSync(file_system_context, url, sync_mode, metadata, changes, snapshot); base::MessageLoop::current()->Run(); @@ -112,7 +112,7 @@ class LocalFileSyncContextTest : public testing::Test { LocalFileSyncContext::SyncMode sync_mode, SyncFileMetadata* metadata, FileChangeList* changes, - webkit_blob::ScopedFile* snapshot) { + storage::ScopedFile* snapshot) { return base::Bind(&LocalFileSyncContextTest::StartPrepareForSync, base::Unretained(this), base::Unretained(file_system_context), @@ -121,10 +121,10 @@ class LocalFileSyncContextTest : public testing::Test { void DidPrepareForSync(SyncFileMetadata* metadata_out, FileChangeList* changes_out, - webkit_blob::ScopedFile* snapshot_out, + storage::ScopedFile* snapshot_out, SyncStatusCode status, const LocalFileSyncInfo& sync_file_info, - webkit_blob::ScopedFile snapshot) { + storage::ScopedFile snapshot) { ASSERT_TRUE(ui_task_runner_->RunsTasksOnCurrentThread()); has_inflight_prepare_for_sync_ = false; status_ = status; @@ -299,7 +299,7 @@ class LocalFileSyncContextTest : public testing::Test { SyncFileMetadata metadata; FileChangeList changes; - webkit_blob::ScopedFile snapshot; + storage::ScopedFile snapshot; EXPECT_EQ(SYNC_STATUS_OK, PrepareForSync(file_system.file_system_context(), kFile, sync_mode, &metadata, &changes, &snapshot)); @@ -612,7 +612,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion) { // Record the initial usage (likely 0). int64 initial_usage = -1; int64 quota = -1; - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&initial_usage, "a)); // Create a file and directory in the file_system. @@ -638,7 +638,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion) { // At this point the usage must be greater than the initial usage. int64 new_usage = -1; - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&new_usage, "a)); EXPECT_GT(new_usage, initial_usage); @@ -674,7 +674,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion) { EXPECT_TRUE(urls.empty()); // The quota usage data must have reflected the deletion. - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&new_usage, "a)); EXPECT_EQ(new_usage, initial_usage); @@ -700,7 +700,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion_ForRoot) { // Record the initial usage (likely 0). int64 initial_usage = -1; int64 quota = -1; - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&initial_usage, "a)); // Create a file and directory in the file_system. @@ -714,7 +714,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion_ForRoot) { // At this point the usage must be greater than the initial usage. int64 new_usage = -1; - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&new_usage, "a)); EXPECT_GT(new_usage, initial_usage); @@ -741,7 +741,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion_ForRoot) { EXPECT_TRUE(urls.empty()); // The quota usage data must have reflected the deletion. - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&new_usage, "a)); EXPECT_EQ(new_usage, initial_usage); @@ -807,7 +807,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { // Record the usage. int64 usage = -1, new_usage = -1; int64 quota = -1; - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&usage, "a)); // Here in the local filesystem we have: @@ -834,7 +834,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { // Check if the usage has been increased by (kTestFileData1 - kTestFileData0). const int updated_size = arraysize(kTestFileData1) - arraysize(kTestFileData0); - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&new_usage, "a)); EXPECT_EQ(updated_size, new_usage - usage); @@ -881,7 +881,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { // Creating a file/directory must have increased the usage more than // the size of kTestFileData2. new_usage = usage; - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system.GetUsageAndQuota(&new_usage, "a)); EXPECT_GT(new_usage, static_cast<int64>(usage + arraysize(kTestFileData2) - 1)); diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service.cc b/chrome/browser/sync_file_system/local/local_file_sync_service.cc index a5cafcb..e4d2b67 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_service.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_service.cc @@ -28,7 +28,7 @@ #include "webkit/common/blob/scoped_file.h" using content::BrowserThread; -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace sync_file_system { @@ -38,7 +38,7 @@ void PrepareForProcessRemoteChangeCallbackAdapter( const RemoteChangeProcessor::PrepareChangeCallback& callback, SyncStatusCode status, const LocalFileSyncInfo& sync_file_info, - webkit_blob::ScopedFile snapshot) { + storage::ScopedFile snapshot) { callback.Run(status, sync_file_info.metadata, sync_file_info.changes); } @@ -131,7 +131,7 @@ void LocalFileSyncService::Shutdown() { void LocalFileSyncService::MaybeInitializeFileSystemContext( const GURL& app_origin, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const SyncStatusCallback& callback) { sync_context_->MaybeInitializeFileSystemContext( app_origin, file_system_context, @@ -247,9 +247,9 @@ void LocalFileSyncService::PrepareForProcessRemoteChange( GURL site_url = extensions::util::GetSiteForExtensionId(extension->id(), profile_); DCHECK(!site_url.is_empty()); - scoped_refptr<fileapi::FileSystemContext> file_system_context = - content::BrowserContext::GetStoragePartitionForSite( - profile_, site_url)->GetFileSystemContext(); + scoped_refptr<storage::FileSystemContext> file_system_context = + content::BrowserContext::GetStoragePartitionForSite(profile_, site_url) + ->GetFileSystemContext(); MaybeInitializeFileSystemContext( url.origin(), file_system_context.get(), @@ -357,7 +357,7 @@ LocalFileSyncService::LocalFileSyncService(Profile* profile, void LocalFileSyncService::DidInitializeFileSystemContext( const GURL& app_origin, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const SyncStatusCallback& callback, SyncStatusCode status) { if (status != SYNC_STATUS_OK) { @@ -386,7 +386,7 @@ void LocalFileSyncService::DidInitializeFileSystemContext( void LocalFileSyncService::DidInitializeForRemoteSync( const FileSystemURL& url, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const PrepareChangeCallback& callback, SyncStatusCode status) { if (status != SYNC_STATUS_OK) { @@ -423,7 +423,7 @@ void LocalFileSyncService::DidApplyRemoteChange( void LocalFileSyncService::DidGetFileForLocalSync( SyncStatusCode status, const LocalFileSyncInfo& sync_file_info, - webkit_blob::ScopedFile snapshot) { + storage::ScopedFile snapshot) { DCHECK(!local_sync_callback_.is_null()); if (status != SYNC_STATUS_OK) { RunLocalSyncCallback(status, sync_file_info.url); @@ -452,7 +452,7 @@ void LocalFileSyncService::DidGetFileForLocalSync( } void LocalFileSyncService::ProcessNextChangeForURL( - webkit_blob::ScopedFile snapshot, + storage::ScopedFile snapshot, const LocalFileSyncInfo& sync_file_info, const FileChange& processed_change, const FileChangeList& changes, diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service.h b/chrome/browser/sync_file_system/local/local_file_sync_service.h index 54291b7..1b23902 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_service.h +++ b/chrome/browser/sync_file_system/local/local_file_sync_service.h @@ -22,7 +22,7 @@ class GURL; class Profile; -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -30,7 +30,7 @@ namespace leveldb { class Env; } -namespace webkit_blob { +namespace storage { class ScopedFile; } @@ -80,7 +80,7 @@ class LocalFileSyncService void MaybeInitializeFileSystemContext( const GURL& app_origin, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const SyncStatusCallback& callback); void AddChangeObserver(Observer* observer); @@ -91,7 +91,7 @@ class LocalFileSyncService // for sync). // Calling this method again while this already has another URL waiting // for sync will overwrite the previously registered URL. - void RegisterURLForWaitingSync(const fileapi::FileSystemURL& url, + void RegisterURLForWaitingSync(const storage::FileSystemURL& url, const base::Closure& on_syncable_callback); // Synchronize one (or a set of) local change(s) to the remote server @@ -119,32 +119,29 @@ class LocalFileSyncService // Returns true via |callback| if the given file |url| has local pending // changes. - void HasPendingLocalChanges( - const fileapi::FileSystemURL& url, - const HasPendingLocalChangeCallback& callback); + void HasPendingLocalChanges(const storage::FileSystemURL& url, + const HasPendingLocalChangeCallback& callback); void PromoteDemotedChanges(const base::Closure& callback); // Returns the metadata of a remote file pointed by |url|. - virtual void GetLocalFileMetadata( - const fileapi::FileSystemURL& url, - const SyncFileMetadataCallback& callback); + virtual void GetLocalFileMetadata(const storage::FileSystemURL& url, + const SyncFileMetadataCallback& callback); // RemoteChangeProcessor overrides. virtual void PrepareForProcessRemoteChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const PrepareChangeCallback& callback) OVERRIDE; - virtual void ApplyRemoteChange( - const FileChange& change, - const base::FilePath& local_path, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) OVERRIDE; + virtual void ApplyRemoteChange(const FileChange& change, + const base::FilePath& local_path, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) OVERRIDE; virtual void FinalizeRemoteSync( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, bool clear_local_changes, const base::Closure& completion_callback) OVERRIDE; virtual void RecordFakeLocalChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileChange& change, const SyncStatusCallback& callback) OVERRIDE; @@ -158,7 +155,7 @@ class LocalFileSyncService void SetOriginEnabled(const GURL& origin, bool enabled); private: - typedef std::map<GURL, fileapi::FileSystemContext*> OriginToContext; + typedef std::map<GURL, storage::FileSystemContext*> OriginToContext; friend class OriginChangeMapTest; class OriginChangeMap { @@ -193,19 +190,18 @@ class LocalFileSyncService void DidInitializeFileSystemContext( const GURL& app_origin, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const SyncStatusCallback& callback, SyncStatusCode status); void DidInitializeForRemoteSync( - const fileapi::FileSystemURL& url, - fileapi::FileSystemContext* file_system_context, + const storage::FileSystemURL& url, + storage::FileSystemContext* file_system_context, const PrepareChangeCallback& callback, SyncStatusCode status); // Runs local_sync_callback_ and resets it. - void RunLocalSyncCallback( - SyncStatusCode status, - const fileapi::FileSystemURL& url); + void RunLocalSyncCallback(SyncStatusCode status, + const storage::FileSystemURL& url); // Callback for ApplyRemoteChange. void DidApplyRemoteChange( @@ -213,20 +209,18 @@ class LocalFileSyncService SyncStatusCode status); // Callbacks for ProcessLocalChange. - void DidGetFileForLocalSync( - SyncStatusCode status, - const LocalFileSyncInfo& sync_file_info, - webkit_blob::ScopedFile snapshot); - void ProcessNextChangeForURL( - webkit_blob::ScopedFile snapshot, - const LocalFileSyncInfo& sync_file_info, - const FileChange& last_change, - const FileChangeList& changes, - SyncStatusCode status); + void DidGetFileForLocalSync(SyncStatusCode status, + const LocalFileSyncInfo& sync_file_info, + storage::ScopedFile snapshot); + void ProcessNextChangeForURL(storage::ScopedFile snapshot, + const LocalFileSyncInfo& sync_file_info, + const FileChange& last_change, + const FileChangeList& changes, + SyncStatusCode status); // A thin wrapper of get_local_change_processor_. LocalChangeProcessor* GetLocalChangeProcessor( - const fileapi::FileSystemURL& url); + const storage::FileSystemURL& url); Profile* profile_; diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc index b0e3674..7efbf2b 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc @@ -36,7 +36,7 @@ #include "webkit/browser/fileapi/file_system_context.h" using content::BrowserThread; -using fileapi::FileSystemURL; +using storage::FileSystemURL; using ::testing::_; using ::testing::AtLeast; using ::testing::InvokeWithoutArgs; @@ -543,7 +543,7 @@ TEST_F(LocalFileSyncServiceTest, RecordFakeChange) { EXPECT_EQ(0, GetNumChangesInTracker()); - fileapi::FileSystemURLSet urlset; + storage::FileSystemURLSet urlset; file_system_->GetChangedURLsInTracker(&urlset); EXPECT_TRUE(urlset.empty()); diff --git a/chrome/browser/sync_file_system/local/local_file_sync_status.cc b/chrome/browser/sync_file_system/local/local_file_sync_status.cc index 750e59e..8f97ef9 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_status.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_status.cc @@ -8,8 +8,8 @@ #include "base/stl_util.h" #include "webkit/common/fileapi/file_system_util.h" -using fileapi::FileSystemURL; -using fileapi::FileSystemURLSet; +using storage::FileSystemURL; +using storage::FileSystemURLSet; namespace sync_file_system { @@ -17,7 +17,7 @@ namespace { typedef LocalFileSyncStatus::OriginAndType OriginAndType; -OriginAndType GetOriginAndType(const fileapi::FileSystemURL& url) { +OriginAndType GetOriginAndType(const storage::FileSystemURL& url) { return std::make_pair(url.origin(), url.type()); } @@ -25,7 +25,7 @@ base::FilePath NormalizePath(const base::FilePath& path) { // Ensure |path| has single trailing path-separator, so that we can use // prefix-match to find descendants of |path| in an ordered container. return base::FilePath(path.StripTrailingSeparators().value() + - fileapi::VirtualPath::kSeparator); + storage::VirtualPath::kSeparator); } struct SetKeyHelper { @@ -63,11 +63,11 @@ bool ContainsChildOrParent(const Container& paths, if (ContainsKey(paths, normalized_path)) return true; - if (fileapi::VirtualPath::IsRootPath(normalized_path)) + if (storage::VirtualPath::IsRootPath(normalized_path)) return false; normalized_path = - NormalizePath(fileapi::VirtualPath::DirName(normalized_path)); + NormalizePath(storage::VirtualPath::DirName(normalized_path)); } } diff --git a/chrome/browser/sync_file_system/local/local_file_sync_status.h b/chrome/browser/sync_file_system/local/local_file_sync_status.h index b8c1660..4330122 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_status.h +++ b/chrome/browser/sync_file_system/local/local_file_sync_status.h @@ -15,7 +15,7 @@ #include "base/threading/non_thread_safe.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -33,14 +33,15 @@ namespace sync_file_system { class LocalFileSyncStatus : public base::NonThreadSafe { public: - typedef std::pair<GURL, fileapi::FileSystemType> OriginAndType; + typedef std::pair<GURL, storage::FileSystemType> OriginAndType; class Observer { public: Observer() {} virtual ~Observer() {} - virtual void OnSyncEnabled(const fileapi::FileSystemURL& url) = 0; - virtual void OnWriteEnabled(const fileapi::FileSystemURL& url) = 0; + virtual void OnSyncEnabled(const storage::FileSystemURL& url) = 0; + virtual void OnWriteEnabled(const storage::FileSystemURL& url) = 0; + private: DISALLOW_COPY_AND_ASSIGN(Observer); }; @@ -50,27 +51,27 @@ class LocalFileSyncStatus // Increment writing counter for |url|. // This should not be called if the |url| is not writable. - void StartWriting(const fileapi::FileSystemURL& url); + void StartWriting(const storage::FileSystemURL& url); // Decrement writing counter for |url|. - void EndWriting(const fileapi::FileSystemURL& url); + void EndWriting(const storage::FileSystemURL& url); // Start syncing for |url| and disable writing. // This should not be called if |url| is in syncing or in writing. - void StartSyncing(const fileapi::FileSystemURL& url); + void StartSyncing(const storage::FileSystemURL& url); // Clears the syncing flag for |url| and enable writing. - void EndSyncing(const fileapi::FileSystemURL& url); + void EndSyncing(const storage::FileSystemURL& url); // Returns true if the |url| or its parent or child is in writing. - bool IsWriting(const fileapi::FileSystemURL& url) const; + bool IsWriting(const storage::FileSystemURL& url) const; // Returns true if the |url| is enabled for writing (i.e. not in syncing). - bool IsWritable(const fileapi::FileSystemURL& url) const; + bool IsWritable(const storage::FileSystemURL& url) const; // Returns true if the |url| is enabled for syncing (i.e. neither in // syncing nor writing). - bool IsSyncable(const fileapi::FileSystemURL& url) const; + bool IsSyncable(const storage::FileSystemURL& url) const; void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); @@ -85,8 +86,8 @@ class LocalFileSyncStatus typedef std::map<base::FilePath, int64> PathBucket; typedef std::map<OriginAndType, PathBucket> URLBucket; - bool IsChildOrParentWriting(const fileapi::FileSystemURL& url) const; - bool IsChildOrParentSyncing(const fileapi::FileSystemURL& url) const; + bool IsChildOrParentWriting(const storage::FileSystemURL& url) const; + bool IsChildOrParentSyncing(const storage::FileSystemURL& url) const; // If this count is non-zero positive there're ongoing write operations. URLBucket writing_; diff --git a/chrome/browser/sync_file_system/local/local_file_sync_status_unittest.cc b/chrome/browser/sync_file_system/local/local_file_sync_status_unittest.cc index d7ce5f0..5e29098 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_status_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_status_unittest.cc @@ -8,7 +8,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace sync_file_system { diff --git a/chrome/browser/sync_file_system/local/mock_sync_status_observer.h b/chrome/browser/sync_file_system/local/mock_sync_status_observer.h index 62bd5e5..353c312 100644 --- a/chrome/browser/sync_file_system/local/mock_sync_status_observer.h +++ b/chrome/browser/sync_file_system/local/mock_sync_status_observer.h @@ -16,8 +16,8 @@ class MockSyncStatusObserver : public LocalFileSyncStatus::Observer { virtual ~MockSyncStatusObserver(); // LocalFileSyncStatus::Observer overrides. - MOCK_METHOD1(OnSyncEnabled, void(const fileapi::FileSystemURL& url)); - MOCK_METHOD1(OnWriteEnabled, void(const fileapi::FileSystemURL& url)); + MOCK_METHOD1(OnSyncEnabled, void(const storage::FileSystemURL& url)); + MOCK_METHOD1(OnWriteEnabled, void(const storage::FileSystemURL& url)); private: DISALLOW_COPY_AND_ASSIGN(MockSyncStatusObserver); diff --git a/chrome/browser/sync_file_system/local/root_delete_helper.cc b/chrome/browser/sync_file_system/local/root_delete_helper.cc index 8ab21da..34d7ea1 100644 --- a/chrome/browser/sync_file_system/local/root_delete_helper.cc +++ b/chrome/browser/sync_file_system/local/root_delete_helper.cc @@ -20,9 +20,8 @@ namespace sync_file_system { namespace { // This runs on FileSystemContext's default_file_task_runner. -void ResetFileChangeTracker( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& url) { +void ResetFileChangeTracker(storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& url) { DCHECK(file_system_context->default_file_task_runner()-> RunsTasksOnCurrentThread()); SyncFileSystemBackend* backend = @@ -35,9 +34,9 @@ void ResetFileChangeTracker( } // namespace RootDeleteHelper::RootDeleteHelper( - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, LocalFileSyncStatus* sync_status, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileStatusCallback& callback) : file_system_context_(file_system_context), url_(url), @@ -49,7 +48,7 @@ RootDeleteHelper::RootDeleteHelper( DCHECK(!callback_.is_null()); DCHECK(sync_status_); // This is expected to run on the filesystem root. - DCHECK(fileapi::VirtualPath::IsRootPath(url.path())); + DCHECK(storage::VirtualPath::IsRootPath(url.path())); } RootDeleteHelper::~RootDeleteHelper() { @@ -89,10 +88,12 @@ void RootDeleteHelper::DidResetFileChangeTracker() { // Reopening the filesystem. file_system_context_->sandbox_delegate()->OpenFileSystem( - url_.origin(), url_.type(), - fileapi::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, + url_.origin(), + url_.type(), + storage::OPEN_FILE_SYSTEM_CREATE_IF_NONEXISTENT, base::Bind(&RootDeleteHelper::DidOpenFileSystem, - weak_factory_.GetWeakPtr()), GURL()); + weak_factory_.GetWeakPtr()), + GURL()); } void RootDeleteHelper::DidOpenFileSystem(const GURL& /* root */, diff --git a/chrome/browser/sync_file_system/local/root_delete_helper.h b/chrome/browser/sync_file_system/local/root_delete_helper.h index c4fb1f7..38d1684 100644 --- a/chrome/browser/sync_file_system/local/root_delete_helper.h +++ b/chrome/browser/sync_file_system/local/root_delete_helper.h @@ -14,7 +14,7 @@ class GURL; -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -32,9 +32,9 @@ class RootDeleteHelper { public: typedef base::Callback<void(base::File::Error)> FileStatusCallback; - RootDeleteHelper(fileapi::FileSystemContext* file_system_context, + RootDeleteHelper(storage::FileSystemContext* file_system_context, LocalFileSyncStatus* sync_status, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const FileStatusCallback& callback); ~RootDeleteHelper(); @@ -47,8 +47,8 @@ class RootDeleteHelper { const std::string& name, base::File::Error error); - scoped_refptr<fileapi::FileSystemContext> file_system_context_; - const fileapi::FileSystemURL url_; + scoped_refptr<storage::FileSystemContext> file_system_context_; + const storage::FileSystemURL url_; FileStatusCallback callback_; // Not owned; owner of this instance owns it. diff --git a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc index 4229d1d..c6b620c 100644 --- a/chrome/browser/sync_file_system/local/sync_file_system_backend.cc +++ b/chrome/browser/sync_file_system/local/sync_file_system_backend.cc @@ -91,25 +91,24 @@ SyncFileSystemBackend* SyncFileSystemBackend::CreateForTesting() { return backend; } -bool SyncFileSystemBackend::CanHandleType( - fileapi::FileSystemType type) const { - return type == fileapi::kFileSystemTypeSyncable || - type == fileapi::kFileSystemTypeSyncableForInternalSync; +bool SyncFileSystemBackend::CanHandleType(storage::FileSystemType type) const { + return type == storage::kFileSystemTypeSyncable || + type == storage::kFileSystemTypeSyncableForInternalSync; } -void SyncFileSystemBackend::Initialize(fileapi::FileSystemContext* context) { +void SyncFileSystemBackend::Initialize(storage::FileSystemContext* context) { DCHECK(context); DCHECK(!context_); context_ = context; - fileapi::SandboxFileSystemBackendDelegate* delegate = GetDelegate(); - delegate->RegisterQuotaUpdateObserver(fileapi::kFileSystemTypeSyncable); + storage::SandboxFileSystemBackendDelegate* delegate = GetDelegate(); + delegate->RegisterQuotaUpdateObserver(storage::kFileSystemTypeSyncable); delegate->RegisterQuotaUpdateObserver( - fileapi::kFileSystemTypeSyncableForInternalSync); + storage::kFileSystemTypeSyncableForInternalSync); } -void SyncFileSystemBackend::ResolveURL(const fileapi::FileSystemURL& url, - fileapi::OpenFileSystemMode mode, +void SyncFileSystemBackend::ResolveURL(const storage::FileSystemURL& url, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback) { DCHECK(CanHandleType(url.type())); @@ -134,36 +133,35 @@ void SyncFileSystemBackend::ResolveURL(const fileapi::FileSystemURL& url, InitializeSyncFileSystemService(url.origin(), initialize_callback); } -fileapi::AsyncFileUtil* SyncFileSystemBackend::GetAsyncFileUtil( - fileapi::FileSystemType type) { +storage::AsyncFileUtil* SyncFileSystemBackend::GetAsyncFileUtil( + storage::FileSystemType type) { return GetDelegate()->file_util(); } -fileapi::CopyOrMoveFileValidatorFactory* +storage::CopyOrMoveFileValidatorFactory* SyncFileSystemBackend::GetCopyOrMoveFileValidatorFactory( - fileapi::FileSystemType type, + storage::FileSystemType type, base::File::Error* error_code) { DCHECK(error_code); *error_code = base::File::FILE_OK; return NULL; } -fileapi::FileSystemOperation* -SyncFileSystemBackend::CreateFileSystemOperation( - const fileapi::FileSystemURL& url, - fileapi::FileSystemContext* context, +storage::FileSystemOperation* SyncFileSystemBackend::CreateFileSystemOperation( + const storage::FileSystemURL& url, + storage::FileSystemContext* context, base::File::Error* error_code) const { DCHECK(CanHandleType(url.type())); DCHECK(context); DCHECK(error_code); - scoped_ptr<fileapi::FileSystemOperationContext> operation_context = + scoped_ptr<storage::FileSystemOperationContext> operation_context = GetDelegate()->CreateFileSystemOperationContext(url, context, error_code); if (!operation_context) return NULL; - if (url.type() == fileapi::kFileSystemTypeSyncableForInternalSync) { - return fileapi::FileSystemOperation::Create( + if (url.type() == storage::kFileSystemTypeSyncableForInternalSync) { + return storage::FileSystemOperation::Create( url, context, operation_context.Pass()); } @@ -172,47 +170,47 @@ SyncFileSystemBackend::CreateFileSystemOperation( } bool SyncFileSystemBackend::SupportsStreaming( - const fileapi::FileSystemURL& url) const { + const storage::FileSystemURL& url) const { return false; } bool SyncFileSystemBackend::HasInplaceCopyImplementation( - fileapi::FileSystemType type) const { + storage::FileSystemType type) const { return false; } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> SyncFileSystemBackend::CreateFileStreamReader( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) const { + storage::FileSystemContext* context) const { DCHECK(CanHandleType(url.type())); return GetDelegate()->CreateFileStreamReader( url, offset, expected_modification_time, context); } -scoped_ptr<fileapi::FileStreamWriter> +scoped_ptr<storage::FileStreamWriter> SyncFileSystemBackend::CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) const { + storage::FileSystemContext* context) const { DCHECK(CanHandleType(url.type())); return GetDelegate()->CreateFileStreamWriter( - url, offset, context, fileapi::kFileSystemTypeSyncableForInternalSync); + url, offset, context, storage::kFileSystemTypeSyncableForInternalSync); } -fileapi::FileSystemQuotaUtil* SyncFileSystemBackend::GetQuotaUtil() { +storage::FileSystemQuotaUtil* SyncFileSystemBackend::GetQuotaUtil() { return GetDelegate(); } // static SyncFileSystemBackend* SyncFileSystemBackend::GetBackend( - const fileapi::FileSystemContext* file_system_context) { + const storage::FileSystemContext* file_system_context) { DCHECK(file_system_context); return static_cast<SyncFileSystemBackend*>( file_system_context->GetFileSystemBackend( - fileapi::kFileSystemTypeSyncable)); + storage::kFileSystemTypeSyncable)); } void SyncFileSystemBackend::SetLocalFileChangeTracker( @@ -221,15 +219,13 @@ void SyncFileSystemBackend::SetLocalFileChangeTracker( DCHECK(tracker); change_tracker_ = tracker.Pass(); - fileapi::SandboxFileSystemBackendDelegate* delegate = GetDelegate(); - delegate->AddFileUpdateObserver( - fileapi::kFileSystemTypeSyncable, - change_tracker_.get(), - delegate->file_task_runner()); - delegate->AddFileChangeObserver( - fileapi::kFileSystemTypeSyncable, - change_tracker_.get(), - delegate->file_task_runner()); + storage::SandboxFileSystemBackendDelegate* delegate = GetDelegate(); + delegate->AddFileUpdateObserver(storage::kFileSystemTypeSyncable, + change_tracker_.get(), + delegate->file_task_runner()); + delegate->AddFileChangeObserver(storage::kFileSystemTypeSyncable, + change_tracker_.get(), + delegate->file_task_runner()); } void SyncFileSystemBackend::set_sync_context( @@ -238,8 +234,8 @@ void SyncFileSystemBackend::set_sync_context( sync_context_ = sync_context; } -fileapi::SandboxFileSystemBackendDelegate* -SyncFileSystemBackend::GetDelegate() const { +storage::SandboxFileSystemBackendDelegate* SyncFileSystemBackend::GetDelegate() + const { DCHECK(context_); DCHECK(context_->sandbox_delegate()); return context_->sandbox_delegate(); @@ -272,10 +268,10 @@ void SyncFileSystemBackend::InitializeSyncFileSystemService( } void SyncFileSystemBackend::DidInitializeSyncFileSystemService( - fileapi::FileSystemContext* context, + storage::FileSystemContext* context, const GURL& origin_url, - fileapi::FileSystemType type, - fileapi::OpenFileSystemMode mode, + storage::FileSystemType type, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback, SyncStatusCode status) { // Repost to switch from UI thread to IO thread. diff --git a/chrome/browser/sync_file_system/local/sync_file_system_backend.h b/chrome/browser/sync_file_system/local/sync_file_system_backend.h index 4f2a9a7..473ea7e 100644 --- a/chrome/browser/sync_file_system/local/sync_file_system_backend.h +++ b/chrome/browser/sync_file_system/local/sync_file_system_backend.h @@ -19,8 +19,7 @@ namespace sync_file_system { class LocalFileChangeTracker; class LocalFileSyncContext; -class SyncFileSystemBackend - : public fileapi::FileSystemBackend { +class SyncFileSystemBackend : public storage::FileSystemBackend { public: explicit SyncFileSystemBackend(Profile* profile); virtual ~SyncFileSystemBackend(); @@ -28,38 +27,37 @@ class SyncFileSystemBackend static SyncFileSystemBackend* CreateForTesting(); // FileSystemBackend overrides. - virtual bool CanHandleType(fileapi::FileSystemType type) const OVERRIDE; - virtual void Initialize(fileapi::FileSystemContext* context) OVERRIDE; - virtual void ResolveURL(const fileapi::FileSystemURL& url, - fileapi::OpenFileSystemMode mode, + virtual bool CanHandleType(storage::FileSystemType type) const OVERRIDE; + virtual void Initialize(storage::FileSystemContext* context) OVERRIDE; + virtual void ResolveURL(const storage::FileSystemURL& url, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback) OVERRIDE; - virtual fileapi::AsyncFileUtil* GetAsyncFileUtil( - fileapi::FileSystemType type) OVERRIDE; - virtual fileapi::CopyOrMoveFileValidatorFactory* - GetCopyOrMoveFileValidatorFactory( - fileapi::FileSystemType type, - base::File::Error* error_code) OVERRIDE; - virtual fileapi::FileSystemOperation* CreateFileSystemOperation( - const fileapi::FileSystemURL& url, - fileapi::FileSystemContext* context, + virtual storage::AsyncFileUtil* GetAsyncFileUtil( + storage::FileSystemType type) OVERRIDE; + virtual storage::CopyOrMoveFileValidatorFactory* + GetCopyOrMoveFileValidatorFactory(storage::FileSystemType type, + base::File::Error* error_code) OVERRIDE; + virtual storage::FileSystemOperation* CreateFileSystemOperation( + const storage::FileSystemURL& url, + storage::FileSystemContext* context, base::File::Error* error_code) const OVERRIDE; virtual bool SupportsStreaming( - const fileapi::FileSystemURL& url) const OVERRIDE; + const storage::FileSystemURL& url) const OVERRIDE; virtual bool HasInplaceCopyImplementation( - fileapi::FileSystemType type) const OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( - const fileapi::FileSystemURL& url, + storage::FileSystemType type) const OVERRIDE; + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( + const storage::FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, - fileapi::FileSystemContext* context) const OVERRIDE; - virtual scoped_ptr<fileapi::FileStreamWriter> CreateFileStreamWriter( - const fileapi::FileSystemURL& url, + storage::FileSystemContext* context) const OVERRIDE; + virtual scoped_ptr<storage::FileStreamWriter> CreateFileStreamWriter( + const storage::FileSystemURL& url, int64 offset, - fileapi::FileSystemContext* context) const OVERRIDE; - virtual fileapi::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; + storage::FileSystemContext* context) const OVERRIDE; + virtual storage::FileSystemQuotaUtil* GetQuotaUtil() OVERRIDE; static SyncFileSystemBackend* GetBackend( - const fileapi::FileSystemContext* context); + const storage::FileSystemContext* context); LocalFileChangeTracker* change_tracker() { return change_tracker_.get(); } void SetLocalFileChangeTracker(scoped_ptr<LocalFileChangeTracker> tracker); @@ -85,7 +83,7 @@ class SyncFileSystemBackend }; // Not owned. - fileapi::FileSystemContext* context_; + storage::FileSystemContext* context_; scoped_ptr<LocalFileChangeTracker> change_tracker_; scoped_refptr<LocalFileSyncContext> sync_context_; @@ -97,16 +95,16 @@ class SyncFileSystemBackend // testing. bool skip_initialize_syncfs_service_for_testing_; - fileapi::SandboxFileSystemBackendDelegate* GetDelegate() const; + storage::SandboxFileSystemBackendDelegate* GetDelegate() const; void InitializeSyncFileSystemService( const GURL& origin_url, const SyncStatusCallback& callback); void DidInitializeSyncFileSystemService( - fileapi::FileSystemContext* context, + storage::FileSystemContext* context, const GURL& origin_url, - fileapi::FileSystemType type, - fileapi::OpenFileSystemMode mode, + storage::FileSystemType type, + storage::OpenFileSystemMode mode, const OpenFileSystemCallback& callback, SyncStatusCode status); diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.cc b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.cc index 45dca64..11053a2 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.cc @@ -10,7 +10,7 @@ #include "base/callback.h" #include "base/stl_util.h" -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace sync_file_system { diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h index 5193a80..8e7c89f 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h +++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner.h @@ -16,7 +16,7 @@ #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -41,7 +41,7 @@ class SyncableFileOperationRunner protected: // This is never called after Run() or Cancel() is called. - virtual const std::vector<fileapi::FileSystemURL>& target_paths() const = 0; + virtual const std::vector<storage::FileSystemURL>& target_paths() const = 0; private: friend class SyncableFileOperationRunner; @@ -57,8 +57,8 @@ class SyncableFileOperationRunner virtual ~SyncableFileOperationRunner(); // LocalFileSyncStatus::Observer overrides. - virtual void OnSyncEnabled(const fileapi::FileSystemURL& url) OVERRIDE; - virtual void OnWriteEnabled(const fileapi::FileSystemURL& url) OVERRIDE; + virtual void OnSyncEnabled(const storage::FileSystemURL& url) OVERRIDE; + virtual void OnWriteEnabled(const storage::FileSystemURL& url) OVERRIDE; // Runs the given |task| if no sync operation is running on any of // its target_paths(). This also runs pending tasks that have become @@ -74,7 +74,7 @@ class SyncableFileOperationRunner // Called when an operation is completed. This will make |target_paths| // writable and may start a next runnable task. void OnOperationCompleted( - const std::vector<fileapi::FileSystemURL>& target_paths); + const std::vector<storage::FileSystemURL>& target_paths); LocalFileSyncStatus* sync_status() const { return sync_status_; } diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc index 37f47d5..f32e466 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc @@ -27,8 +27,8 @@ #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" -using fileapi::FileSystemOperation; -using fileapi::FileSystemURL; +using storage::FileSystemOperation; +using storage::FileSystemURL; using content::MockBlobURLRequestContext; using content::ScopedTextBlob; using base::File; @@ -249,13 +249,15 @@ TEST_F(SyncableFileOperationRunnerTest, CopyAndMove) { // (since the source directory is in syncing). ResetCallbackStatus(); file_system_.operation_runner()->Copy( - URL(kDir), URL("dest-copy"), - fileapi::FileSystemOperation::OPTION_NONE, - fileapi::FileSystemOperationRunner::CopyProgressCallback(), + URL(kDir), + URL("dest-copy"), + storage::FileSystemOperation::OPTION_NONE, + storage::FileSystemOperationRunner::CopyProgressCallback(), ExpectStatus(FROM_HERE, File::FILE_OK)); file_system_.operation_runner()->Move( - URL(kDir), URL("dest-move"), - fileapi::FileSystemOperation::OPTION_NONE, + URL(kDir), + URL("dest-move"), + storage::FileSystemOperation::OPTION_NONE, ExpectStatus(FROM_HERE, File::FILE_OK)); base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1, callback_count_); @@ -272,9 +274,10 @@ TEST_F(SyncableFileOperationRunnerTest, CopyAndMove) { // Now the destination is also locked copying kDir should be queued. ResetCallbackStatus(); file_system_.operation_runner()->Copy( - URL(kDir), URL("dest-copy2"), - fileapi::FileSystemOperation::OPTION_NONE, - fileapi::FileSystemOperationRunner::CopyProgressCallback(), + URL(kDir), + URL("dest-copy2"), + storage::FileSystemOperation::OPTION_NONE, + storage::FileSystemOperationRunner::CopyProgressCallback(), ExpectStatus(FROM_HERE, File::FILE_OK)); base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0, callback_count_); @@ -396,10 +399,9 @@ TEST_F(SyncableFileOperationRunnerTest, Cancel) { // Run Truncate and immediately cancel. This shouldn't crash. ResetCallbackStatus(); - fileapi::FileSystemOperationRunner::OperationID id = + storage::FileSystemOperationRunner::OperationID id = file_system_.operation_runner()->Truncate( - URL(kFile), 10, - ExpectStatus(FROM_HERE, File::FILE_OK)); + URL(kFile), 10, ExpectStatus(FROM_HERE, File::FILE_OK)); file_system_.operation_runner()->Cancel( id, ExpectStatus(FROM_HERE, File::FILE_ERROR_INVALID_OPERATION)); base::MessageLoop::current()->RunUntilIdle(); diff --git a/chrome/browser/sync_file_system/local/syncable_file_system_operation.cc b/chrome/browser/sync_file_system/local/syncable_file_system_operation.cc index 459c47b..7e3fece 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_system_operation.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_system_operation.cc @@ -17,7 +17,7 @@ #include "webkit/browser/fileapi/file_writer_delegate.h" #include "webkit/common/blob/shareable_file_reference.h" -using fileapi::FileSystemURL; +using storage::FileSystemURL; namespace sync_file_system { @@ -215,7 +215,7 @@ void SyncableFileSystemOperation::Remove( void SyncableFileSystemOperation::Write( const FileSystemURL& url, - scoped_ptr<fileapi::FileWriterDelegate> writer_delegate, + scoped_ptr<storage::FileWriterDelegate> writer_delegate, scoped_ptr<net::URLRequest> blob_request, const WriteCallback& callback) { DCHECK(CalledOnValidThread()); @@ -349,10 +349,9 @@ base::File::Error SyncableFileSystemOperation::SyncGetPlatformPath( SyncableFileSystemOperation::SyncableFileSystemOperation( const FileSystemURL& url, - fileapi::FileSystemContext* file_system_context, - scoped_ptr<fileapi::FileSystemOperationContext> operation_context) - : url_(url), - weak_factory_(this) { + storage::FileSystemContext* file_system_context, + scoped_ptr<storage::FileSystemOperationContext> operation_context) + : url_(url), weak_factory_(this) { DCHECK(file_system_context); SyncFileSystemBackend* backend = SyncFileSystemBackend::GetBackend(file_system_context); @@ -363,7 +362,7 @@ SyncableFileSystemOperation::SyncableFileSystemOperation( // Returning here to leave operation_runner_ as NULL. return; } - impl_.reset(fileapi::FileSystemOperation::Create( + impl_.reset(storage::FileSystemOperation::Create( url_, file_system_context, operation_context.Pass())); operation_runner_ = backend->sync_context()->operation_runner(); } diff --git a/chrome/browser/sync_file_system/local/syncable_file_system_operation.h b/chrome/browser/sync_file_system/local/syncable_file_system_operation.h index 0ad8267..326919c1 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_system_operation.h +++ b/chrome/browser/sync_file_system/local/syncable_file_system_operation.h @@ -15,7 +15,7 @@ #include "webkit/browser/fileapi/file_system_operation.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace fileapi { +namespace storage { class FileSystemContext; class FileSystemOperationContext; } @@ -26,73 +26,75 @@ class SyncableFileOperationRunner; // A wrapper class of FileSystemOperation for syncable file system. class SyncableFileSystemOperation - : public NON_EXPORTED_BASE(fileapi::FileSystemOperation), + : public NON_EXPORTED_BASE(storage::FileSystemOperation), public base::NonThreadSafe { public: virtual ~SyncableFileSystemOperation(); - // fileapi::FileSystemOperation overrides. - virtual void CreateFile(const fileapi::FileSystemURL& url, + // storage::FileSystemOperation overrides. + virtual void CreateFile(const storage::FileSystemURL& url, bool exclusive, const StatusCallback& callback) OVERRIDE; - virtual void CreateDirectory(const fileapi::FileSystemURL& url, + virtual void CreateDirectory(const storage::FileSystemURL& url, bool exclusive, bool recursive, const StatusCallback& callback) OVERRIDE; - virtual void Copy(const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + virtual void Copy(const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyProgressCallback& progress_callback, const StatusCallback& callback) OVERRIDE; - virtual void Move(const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + virtual void Move(const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) OVERRIDE; - virtual void DirectoryExists(const fileapi::FileSystemURL& url, + virtual void DirectoryExists(const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; - virtual void FileExists(const fileapi::FileSystemURL& url, + virtual void FileExists(const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; - virtual void GetMetadata(const fileapi::FileSystemURL& url, + virtual void GetMetadata(const storage::FileSystemURL& url, const GetMetadataCallback& callback) OVERRIDE; - virtual void ReadDirectory(const fileapi::FileSystemURL& url, + virtual void ReadDirectory(const storage::FileSystemURL& url, const ReadDirectoryCallback& callback) OVERRIDE; - virtual void Remove(const fileapi::FileSystemURL& url, bool recursive, + virtual void Remove(const storage::FileSystemURL& url, + bool recursive, const StatusCallback& callback) OVERRIDE; - virtual void Write(const fileapi::FileSystemURL& url, - scoped_ptr<fileapi::FileWriterDelegate> writer_delegate, + virtual void Write(const storage::FileSystemURL& url, + scoped_ptr<storage::FileWriterDelegate> writer_delegate, scoped_ptr<net::URLRequest> blob_request, const WriteCallback& callback) OVERRIDE; - virtual void Truncate(const fileapi::FileSystemURL& url, int64 length, + virtual void Truncate(const storage::FileSystemURL& url, + int64 length, const StatusCallback& callback) OVERRIDE; - virtual void TouchFile(const fileapi::FileSystemURL& url, + virtual void TouchFile(const storage::FileSystemURL& url, const base::Time& last_access_time, const base::Time& last_modified_time, const StatusCallback& callback) OVERRIDE; - virtual void OpenFile(const fileapi::FileSystemURL& url, + virtual void OpenFile(const storage::FileSystemURL& url, int file_flags, const OpenFileCallback& callback) OVERRIDE; virtual void Cancel(const StatusCallback& cancel_callback) OVERRIDE; virtual void CreateSnapshotFile( - const fileapi::FileSystemURL& path, + const storage::FileSystemURL& path, const SnapshotFileCallback& callback) OVERRIDE; virtual void CopyInForeignFile(const base::FilePath& src_local_disk_path, - const fileapi::FileSystemURL& dest_url, + const storage::FileSystemURL& dest_url, const StatusCallback& callback) OVERRIDE; - virtual void RemoveFile(const fileapi::FileSystemURL& url, + virtual void RemoveFile(const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; - virtual void RemoveDirectory(const fileapi::FileSystemURL& url, + virtual void RemoveDirectory(const storage::FileSystemURL& url, const StatusCallback& callback) OVERRIDE; - virtual void CopyFileLocal(const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + virtual void CopyFileLocal(const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const CopyFileProgressCallback& progress_callback, const StatusCallback& callback) OVERRIDE; - virtual void MoveFileLocal(const fileapi::FileSystemURL& src_url, - const fileapi::FileSystemURL& dest_url, + virtual void MoveFileLocal(const storage::FileSystemURL& src_url, + const storage::FileSystemURL& dest_url, CopyOrMoveOption option, const StatusCallback& callback) OVERRIDE; virtual base::File::Error SyncGetPlatformPath( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, base::FilePath* platform_path) OVERRIDE; private: @@ -103,9 +105,9 @@ class SyncableFileSystemOperation friend class SyncFileSystemBackend; SyncableFileSystemOperation( - const fileapi::FileSystemURL& url, - fileapi::FileSystemContext* file_system_context, - scoped_ptr<fileapi::FileSystemOperationContext> operation_context); + const storage::FileSystemURL& url, + storage::FileSystemContext* file_system_context, + scoped_ptr<storage::FileSystemOperationContext> operation_context); void DidFinish(base::File::Error status); void DidWrite(const WriteCallback& callback, @@ -115,11 +117,11 @@ class SyncableFileSystemOperation void OnCancelled(); - const fileapi::FileSystemURL url_; + const storage::FileSystemURL url_; - scoped_ptr<fileapi::FileSystemOperation> impl_; + scoped_ptr<storage::FileSystemOperation> impl_; base::WeakPtr<SyncableFileOperationRunner> operation_runner_; - std::vector<fileapi::FileSystemURL> target_paths_; + std::vector<storage::FileSystemURL> target_paths_; StatusCallback completion_callback_; diff --git a/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc b/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc index 6228762..47f21a4 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc @@ -23,12 +23,12 @@ #include "webkit/common/quota/quota_types.h" using content::SandboxFileSystemTestHelper; -using fileapi::FileSystemContext; -using fileapi::FileSystemOperationContext; -using fileapi::FileSystemURL; -using fileapi::FileSystemURLSet; -using quota::QuotaManager; -using quota::QuotaStatusCode; +using storage::FileSystemContext; +using storage::FileSystemOperationContext; +using storage::FileSystemURL; +using storage::FileSystemURLSet; +using storage::QuotaManager; +using storage::QuotaStatusCode; namespace sync_file_system { @@ -128,7 +128,7 @@ TEST_F(SyncableFileSystemTest, SyncableLocalSandboxCombined) { const int64 kQuota = 12345 * 1024; QuotaManager::kSyncableStorageDefaultHostQuota = kQuota; int64 usage, quota; - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system_.GetUsageAndQuota(&usage, "a)); // Returned quota must be what we overrode. Usage must be greater than 0 @@ -145,7 +145,7 @@ TEST_F(SyncableFileSystemTest, SyncableLocalSandboxCombined) { file_system_.TruncateFile(URL("dir/foo"), kFileSizeToExtend)); int64 new_usage; - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system_.GetUsageAndQuota(&new_usage, "a)); EXPECT_EQ(kFileSizeToExtend, new_usage - usage); @@ -156,7 +156,7 @@ TEST_F(SyncableFileSystemTest, SyncableLocalSandboxCombined) { file_system_.TruncateFile(URL("dir/foo"), kFileSizeToExtend + 1)); usage = new_usage; - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system_.GetUsageAndQuota(&new_usage, "a)); EXPECT_EQ(usage, new_usage); @@ -165,7 +165,7 @@ TEST_F(SyncableFileSystemTest, SyncableLocalSandboxCombined) { file_system_.DeleteFileSystem()); // Now the usage must be zero. - EXPECT_EQ(quota::kQuotaStatusOk, + EXPECT_EQ(storage::kQuotaStatusOk, file_system_.GetUsageAndQuota(&usage, "a)); EXPECT_EQ(0, usage); diff --git a/chrome/browser/sync_file_system/local_change_processor.h b/chrome/browser/sync_file_system/local_change_processor.h index 1d1d01b..75f8ba0 100644 --- a/chrome/browser/sync_file_system/local_change_processor.h +++ b/chrome/browser/sync_file_system/local_change_processor.h @@ -8,7 +8,7 @@ #include "base/callback_forward.h" #include "chrome/browser/sync_file_system/sync_callbacks.h" -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -31,12 +31,11 @@ class LocalChangeProcessor { // When SYNC_STATUS_HAS_CONFLICT is returned the implementation should // notify the backing RemoteFileSyncService of the existence of conflict // (as the remote service is supposed to maintain a list of conflict files). - virtual void ApplyLocalChange( - const FileChange& change, - const base::FilePath& local_file_path, - const SyncFileMetadata& local_file_metadata, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) = 0; + virtual void ApplyLocalChange(const FileChange& change, + const base::FilePath& local_file_path, + const SyncFileMetadata& local_file_metadata, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) = 0; private: DISALLOW_COPY_AND_ASSIGN(LocalChangeProcessor); diff --git a/chrome/browser/sync_file_system/mock_local_change_processor.cc b/chrome/browser/sync_file_system/mock_local_change_processor.cc index 7c5393d..b7b7a287 100644 --- a/chrome/browser/sync_file_system/mock_local_change_processor.cc +++ b/chrome/browser/sync_file_system/mock_local_change_processor.cc @@ -31,7 +31,7 @@ void MockLocalChangeProcessor::ApplyLocalChangeStub( const FileChange& change, const base::FilePath& local_file_path, const SyncFileMetadata& local_file_metadata, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const SyncStatusCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(callback, SYNC_STATUS_OK)); diff --git a/chrome/browser/sync_file_system/mock_local_change_processor.h b/chrome/browser/sync_file_system/mock_local_change_processor.h index 561ce2a..79976ed 100644 --- a/chrome/browser/sync_file_system/mock_local_change_processor.h +++ b/chrome/browser/sync_file_system/mock_local_change_processor.h @@ -21,16 +21,15 @@ class MockLocalChangeProcessor : public LocalChangeProcessor { void(const FileChange& change, const base::FilePath& local_file_path, const SyncFileMetadata& local_file_metadata, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const SyncStatusCallback& callback)); private: - void ApplyLocalChangeStub( - const FileChange& change, - const base::FilePath& local_file_path, - const SyncFileMetadata& local_file_metadata, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback); + void ApplyLocalChangeStub(const FileChange& change, + const base::FilePath& local_file_path, + const SyncFileMetadata& local_file_metadata, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback); DISALLOW_COPY_AND_ASSIGN(MockLocalChangeProcessor); }; diff --git a/chrome/browser/sync_file_system/mock_remote_change_processor.h b/chrome/browser/sync_file_system/mock_remote_change_processor.h index a9af675..1740d77 100644 --- a/chrome/browser/sync_file_system/mock_remote_change_processor.h +++ b/chrome/browser/sync_file_system/mock_remote_change_processor.h @@ -15,7 +15,7 @@ namespace base { class FilePath; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -28,19 +28,19 @@ class MockRemoteChangeProcessor : public RemoteChangeProcessor { // RemoteChangeProcessor overrides. MOCK_METHOD2(PrepareForProcessRemoteChange, - void(const fileapi::FileSystemURL& url, + void(const storage::FileSystemURL& url, const PrepareChangeCallback& callback)); MOCK_METHOD4(ApplyRemoteChange, void(const FileChange& change, const base::FilePath& local_path, - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const SyncStatusCallback& callback)); MOCK_METHOD3(FinalizeRemoteSync, - void(const fileapi::FileSystemURL& url, + void(const storage::FileSystemURL& url, bool clear_local_changes, const base::Closure& completion_callback)); MOCK_METHOD3(RecordFakeLocalChange, - void(const fileapi::FileSystemURL& url, + void(const storage::FileSystemURL& url, const FileChange& change, const SyncStatusCallback& callback)); diff --git a/chrome/browser/sync_file_system/mock_remote_file_sync_service.cc b/chrome/browser/sync_file_system/mock_remote_file_sync_service.cc index 7cf0db1..06e50a7 100644 --- a/chrome/browser/sync_file_system/mock_remote_file_sync_service.cc +++ b/chrome/browser/sync_file_system/mock_remote_file_sync_service.cc @@ -70,7 +70,7 @@ void MockRemoteFileSyncService::NotifyRemoteServiceStateUpdated( } void MockRemoteFileSyncService::NotifyFileStatusChanged( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, SyncFileStatus sync_status, SyncAction action_taken, SyncDirection direction) { @@ -109,8 +109,8 @@ void MockRemoteFileSyncService::ProcessRemoteChangeStub( const SyncFileCallback& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::Bind(callback, SYNC_STATUS_NO_CHANGE_TO_SYNC, - fileapi::FileSystemURL())); + base::Bind( + callback, SYNC_STATUS_NO_CHANGE_TO_SYNC, storage::FileSystemURL())); } RemoteServiceState MockRemoteFileSyncService::GetCurrentStateStub() const { diff --git a/chrome/browser/sync_file_system/mock_remote_file_sync_service.h b/chrome/browser/sync_file_system/mock_remote_file_sync_service.h index 01425c9..e22bff7 100644 --- a/chrome/browser/sync_file_system/mock_remote_file_sync_service.h +++ b/chrome/browser/sync_file_system/mock_remote_file_sync_service.h @@ -66,11 +66,10 @@ class MockRemoteFileSyncService : public RemoteFileSyncService { void NotifyRemoteServiceStateUpdated( RemoteServiceState state, const std::string& description); - void NotifyFileStatusChanged( - const fileapi::FileSystemURL& url, - SyncFileStatus sync_status, - SyncAction action_taken, - SyncDirection direction); + void NotifyFileStatusChanged(const storage::FileSystemURL& url, + SyncFileStatus sync_status, + SyncAction action_taken, + SyncDirection direction); private: void AddServiceObserverStub(Observer* observer); diff --git a/chrome/browser/sync_file_system/remote_change_processor.h b/chrome/browser/sync_file_system/remote_change_processor.h index 57eb8be..4f98786 100644 --- a/chrome/browser/sync_file_system/remote_change_processor.h +++ b/chrome/browser/sync_file_system/remote_change_processor.h @@ -14,7 +14,7 @@ namespace base { class FilePath; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -48,7 +48,7 @@ class RemoteChangeProcessor { // on conflict resolution, but NOT for applying local changes to the remote, // which is supposed to be done by LocalChangeProcessor) virtual void PrepareForProcessRemoteChange( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, const PrepareChangeCallback& callback) = 0; // This is called to apply the remote |change|. If the change type is @@ -58,31 +58,28 @@ class RemoteChangeProcessor { // This may fail with an error but should NOT result in a conflict // (as we must have checked the change status in PrepareRemoteSync and // have disabled any further writing). - virtual void ApplyRemoteChange( - const FileChange& change, - const base::FilePath& local_path, - const fileapi::FileSystemURL& url, - const SyncStatusCallback& callback) = 0; + virtual void ApplyRemoteChange(const FileChange& change, + const base::FilePath& local_path, + const storage::FileSystemURL& url, + const SyncStatusCallback& callback) = 0; // Finalizes the remote sync started by PrepareForProcessRemoteChange. // This clears sync flag on |url| to unlock the file for future writes/sync. // Clears all local changes if |clear_local_changes| is true. // This should be set to true when the remote sync service reconciled or // processed the existing local changes while processing a remote change. - virtual void FinalizeRemoteSync( - const fileapi::FileSystemURL& url, - bool clear_local_changes, - const base::Closure& completion_callback) = 0; + virtual void FinalizeRemoteSync(const storage::FileSystemURL& url, + bool clear_local_changes, + const base::Closure& completion_callback) = 0; // Records a fake local change so that the change will be processed in the // next local sync. // This is called when the remote side wants to trigger a local sync // to propagate the local change to the remote change (e.g. to // resolve a conflict by uploading the local file). - virtual void RecordFakeLocalChange( - const fileapi::FileSystemURL& url, - const FileChange& change, - const SyncStatusCallback& callback) = 0; + virtual void RecordFakeLocalChange(const storage::FileSystemURL& url, + const FileChange& change, + const SyncStatusCallback& callback) = 0; private: DISALLOW_COPY_AND_ASSIGN(RemoteChangeProcessor); diff --git a/chrome/browser/sync_file_system/remote_file_sync_service.h b/chrome/browser/sync_file_system/remote_file_sync_service.h index d19db0e..8c77f1f 100644 --- a/chrome/browser/sync_file_system/remote_file_sync_service.h +++ b/chrome/browser/sync_file_system/remote_file_sync_service.h @@ -28,7 +28,7 @@ namespace content { class BrowserContext; } -namespace webkit_blob { +namespace storage { class ScopedFile; } @@ -122,8 +122,8 @@ class RemoteFileSyncService { typedef base::Callback<void(SyncStatusCode status, const std::vector<Version>& versions)> RemoteVersionsCallback; - typedef base::Callback<void(SyncStatusCode status, - webkit_blob::ScopedFile downloaded)> + typedef base::Callback< + void(SyncStatusCode status, storage::ScopedFile downloaded)> DownloadVersionCallback; // For DumpFile. diff --git a/chrome/browser/sync_file_system/subtree_set.cc b/chrome/browser/sync_file_system/subtree_set.cc index ab71dbb..51e4816 100644 --- a/chrome/browser/sync_file_system/subtree_set.cc +++ b/chrome/browser/sync_file_system/subtree_set.cc @@ -26,7 +26,7 @@ SubtreeSet::~SubtreeSet() {} bool SubtreeSet::IsDisjointWith(const base::FilePath& subtree_root) const { base::FilePath::StringType normalized_subtree_root = - fileapi::VirtualPath::GetNormalizedFilePath(subtree_root); + storage::VirtualPath::GetNormalizedFilePath(subtree_root); // Check if |subtree_root| contains any of subtrees in the container. if (ContainsKey(inclusive_ancestors_of_subtree_roots_, @@ -34,8 +34,8 @@ bool SubtreeSet::IsDisjointWith(const base::FilePath& subtree_root) const { return false; base::FilePath path(normalized_subtree_root); - while (!fileapi::VirtualPath::IsRootPath(path)) { - path = fileapi::VirtualPath::DirName(path); + while (!storage::VirtualPath::IsRootPath(path)) { + path = storage::VirtualPath::DirName(path); Subtrees::const_iterator found = inclusive_ancestors_of_subtree_roots_.find(path.value()); @@ -48,7 +48,7 @@ bool SubtreeSet::IsDisjointWith(const base::FilePath& subtree_root) const { bool SubtreeSet::insert(const base::FilePath& subtree_root) { base::FilePath::StringType normalized_subtree_root = - fileapi::VirtualPath::GetNormalizedFilePath(subtree_root); + storage::VirtualPath::GetNormalizedFilePath(subtree_root); if (!IsDisjointWith(subtree_root)) return false; @@ -56,8 +56,8 @@ bool SubtreeSet::insert(const base::FilePath& subtree_root) { = Node(true, 1); base::FilePath path(normalized_subtree_root); - while (!fileapi::VirtualPath::IsRootPath(path)) { - path = fileapi::VirtualPath::DirName(path); + while (!storage::VirtualPath::IsRootPath(path)) { + path = storage::VirtualPath::DirName(path); DCHECK(!inclusive_ancestors_of_subtree_roots_[path.value()] .contained_as_subtree_root); ++(inclusive_ancestors_of_subtree_roots_[path.value()] @@ -69,7 +69,7 @@ bool SubtreeSet::insert(const base::FilePath& subtree_root) { bool SubtreeSet::erase(const base::FilePath& subtree_root) { base::FilePath::StringType normalized_subtree_root = - fileapi::VirtualPath::GetNormalizedFilePath(subtree_root); + storage::VirtualPath::GetNormalizedFilePath(subtree_root); { Subtrees::iterator found = @@ -83,8 +83,8 @@ bool SubtreeSet::erase(const base::FilePath& subtree_root) { } base::FilePath path(normalized_subtree_root); - while (!fileapi::VirtualPath::IsRootPath(path)) { - path = fileapi::VirtualPath::DirName(path); + while (!storage::VirtualPath::IsRootPath(path)) { + path = storage::VirtualPath::DirName(path); Subtrees::iterator found = inclusive_ancestors_of_subtree_roots_.find(path.value()); @@ -103,7 +103,7 @@ bool SubtreeSet::erase(const base::FilePath& subtree_root) { size_t SubtreeSet::size() const { Subtrees::const_iterator found = - inclusive_ancestors_of_subtree_roots_.find(fileapi::VirtualPath::kRoot); + inclusive_ancestors_of_subtree_roots_.find(storage::VirtualPath::kRoot); if (found == inclusive_ancestors_of_subtree_roots_.end()) return 0; return found->second.number_of_subtrees_below; diff --git a/chrome/browser/sync_file_system/sync_callbacks.h b/chrome/browser/sync_file_system/sync_callbacks.h index ec956c0..e0956df 100644 --- a/chrome/browser/sync_file_system/sync_callbacks.h +++ b/chrome/browser/sync_file_system/sync_callbacks.h @@ -10,7 +10,7 @@ #include "chrome/browser/sync_file_system/sync_status_code.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -21,16 +21,16 @@ class SyncFileMetadata; typedef base::Callback<void(SyncStatusCode status)> SyncStatusCallback; -typedef base::Callback<void(SyncStatusCode status, - const fileapi::FileSystemURL& url)> +typedef base::Callback< + void(SyncStatusCode status, const storage::FileSystemURL& url)> SyncFileCallback; typedef base::Callback<void(SyncStatusCode status, const SyncFileMetadata& metadata)> SyncFileMetadataCallback; -typedef base::Callback<void(SyncStatusCode status, - const fileapi::FileSystemURLSet& urls)> +typedef base::Callback< + void(SyncStatusCode status, const storage::FileSystemURLSet& urls)> SyncFileSetCallback; typedef base::Callback<void(SyncStatusCode status, diff --git a/chrome/browser/sync_file_system/sync_event_observer.h b/chrome/browser/sync_file_system/sync_event_observer.h index 35ada7e..6e22100 100644 --- a/chrome/browser/sync_file_system/sync_event_observer.h +++ b/chrome/browser/sync_file_system/sync_event_observer.h @@ -12,7 +12,7 @@ class GURL; -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -31,7 +31,7 @@ class SyncEventObserver { // Reports the file |url| was updated and resulted in |result| // by the sync file system backend. - virtual void OnFileSynced(const fileapi::FileSystemURL& url, + virtual void OnFileSynced(const storage::FileSystemURL& url, SyncFileStatus status, SyncAction action, SyncDirection direction) = 0; diff --git a/chrome/browser/sync_file_system/sync_file_metadata.h b/chrome/browser/sync_file_system/sync_file_metadata.h index 6a50020..9da700c 100644 --- a/chrome/browser/sync_file_system/sync_file_metadata.h +++ b/chrome/browser/sync_file_system/sync_file_metadata.h @@ -31,7 +31,7 @@ struct LocalFileSyncInfo { LocalFileSyncInfo(); ~LocalFileSyncInfo(); - fileapi::FileSystemURL url; + storage::FileSystemURL url; base::FilePath local_file_path; SyncFileMetadata metadata; FileChangeList changes; diff --git a/chrome/browser/sync_file_system/sync_file_system_service.cc b/chrome/browser/sync_file_system/sync_file_system_service.cc index f22c7f5..3b1bfa8 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service.cc +++ b/chrome/browser/sync_file_system/sync_file_system_service.cc @@ -41,8 +41,8 @@ using content::BrowserThread; using extensions::Extension; using extensions::ExtensionPrefs; using extensions::ExtensionRegistry; -using fileapi::FileSystemURL; -using fileapi::FileSystemURLSet; +using storage::FileSystemURL; +using storage::FileSystemURLSet; namespace sync_file_system { @@ -276,7 +276,7 @@ SyncFileSystemService::~SyncFileSystemService() { } void SyncFileSystemService::InitializeForApp( - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const GURL& app_origin, const SyncStatusCallback& callback) { DCHECK(local_service_); @@ -305,7 +305,7 @@ void SyncFileSystemService::DumpFiles(const GURL& origin, content::StoragePartition* storage_partition = content::BrowserContext::GetStoragePartitionForSite(profile_, origin); - fileapi::FileSystemContext* file_system_context = + storage::FileSystemContext* file_system_context = storage_partition->GetFileSystemContext(); local_service_->MaybeInitializeFileSystemContext( origin, file_system_context, diff --git a/chrome/browser/sync_file_system/sync_file_system_service.h b/chrome/browser/sync_file_system/sync_file_system_service.h index 53d3cd5..8b927bb 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service.h +++ b/chrome/browser/sync_file_system/sync_file_system_service.h @@ -30,7 +30,7 @@ class Profile; class ProfileSyncServiceBase; -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -56,19 +56,17 @@ class SyncFileSystemService // KeyedService implementation. virtual void Shutdown() OVERRIDE; - void InitializeForApp( - fileapi::FileSystemContext* file_system_context, - const GURL& app_origin, - const SyncStatusCallback& callback); + void InitializeForApp(storage::FileSystemContext* file_system_context, + const GURL& app_origin, + const SyncStatusCallback& callback); void GetExtensionStatusMap(const ExtensionStatusMapCallback& callback); void DumpFiles(const GURL& origin, const DumpFilesCallback& callback); void DumpDatabase(const DumpFilesCallback& callback); // Returns the file |url|'s sync status. - void GetFileSyncStatus( - const fileapi::FileSystemURL& url, - const SyncFileStatusCallback& callback); + void GetFileSyncStatus(const storage::FileSystemURL& url, + const SyncFileStatusCallback& callback); void AddSyncEventObserver(SyncEventObserver* observer); void RemoveSyncEventObserver(SyncEventObserver* observer); @@ -153,11 +151,10 @@ class SyncFileSystemService virtual void OnStateChanged() OVERRIDE; // SyncFileStatusObserver implementation. - virtual void OnFileStatusChanged( - const fileapi::FileSystemURL& url, - SyncFileStatus sync_status, - SyncAction action_taken, - SyncDirection direction) OVERRIDE; + virtual void OnFileStatusChanged(const storage::FileSystemURL& url, + SyncFileStatus sync_status, + SyncAction action_taken, + SyncDirection direction) OVERRIDE; // Check the profile's sync preference settings and call // remote_file_service_->SetSyncEnabled() to update the status. diff --git a/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc b/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc index bf29b65..6a20476 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc +++ b/chrome/browser/sync_file_system/sync_file_system_service_unittest.cc @@ -34,8 +34,8 @@ #include "webkit/browser/fileapi/file_system_context.h" using content::BrowserThread; -using fileapi::FileSystemURL; -using fileapi::FileSystemURLSet; +using storage::FileSystemURL; +using storage::FileSystemURLSet; using ::testing::AnyNumber; using ::testing::AtLeast; using ::testing::InSequence; @@ -91,7 +91,7 @@ class MockSyncEventObserver : public SyncEventObserver { SyncServiceState state, const std::string& description)); MOCK_METHOD4(OnFileSynced, - void(const fileapi::FileSystemURL& url, + void(const storage::FileSystemURL& url, SyncFileStatus status, SyncAction action, SyncDirection direction)); diff --git a/chrome/browser/sync_file_system/sync_file_system_test_util.h b/chrome/browser/sync_file_system/sync_file_system_test_util.h index c355067..346b365 100644 --- a/chrome/browser/sync_file_system/sync_file_system_test_util.h +++ b/chrome/browser/sync_file_system/sync_file_system_test_util.h @@ -15,7 +15,7 @@ namespace base { class RunLoop; } -namespace fileapi { +namespace storage { class FileSystemURL; } @@ -27,8 +27,8 @@ struct TypeTraits { }; template <> -struct TypeTraits<fileapi::FileSystemURL> { - typedef const fileapi::FileSystemURL& ParamType; +struct TypeTraits<storage::FileSystemURL> { + typedef const storage::FileSystemURL& ParamType; }; template <typename T> diff --git a/chrome/browser/sync_file_system/syncable_file_system_util.cc b/chrome/browser/sync_file_system/syncable_file_system_util.cc index 7192f7a..2e82026 100644 --- a/chrome/browser/sync_file_system/syncable_file_system_util.cc +++ b/chrome/browser/sync_file_system/syncable_file_system_util.cc @@ -14,9 +14,9 @@ #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/common/fileapi/file_system_util.h" -using fileapi::ExternalMountPoints; -using fileapi::FileSystemContext; -using fileapi::FileSystemURL; +using storage::ExternalMountPoints; +using storage::FileSystemContext; +using storage::FileSystemURL; namespace sync_file_system { @@ -35,13 +35,13 @@ void Noop() {} void RegisterSyncableFileSystem() { ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( kSyncableMountName, - fileapi::kFileSystemTypeSyncable, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeSyncable, + storage::FileSystemMountOption(), base::FilePath()); ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( kSyncableMountNameForInternalSync, - fileapi::kFileSystemTypeSyncableForInternalSync, - fileapi::FileSystemMountOption(), + storage::kFileSystemTypeSyncableForInternalSync, + storage::FileSystemMountOption(), base::FilePath()); } @@ -53,14 +53,14 @@ void RevokeSyncableFileSystem() { } GURL GetSyncableFileSystemRootURI(const GURL& origin) { - return GURL(fileapi::GetExternalFileSystemRootURIString( - origin, kSyncableMountName)); + return GURL( + storage::GetExternalFileSystemRootURIString(origin, kSyncableMountName)); } FileSystemURL CreateSyncableFileSystemURL(const GURL& origin, const base::FilePath& path) { base::FilePath path_for_url = path; - if (fileapi::VirtualPath::IsAbsolute(path.value())) + if (storage::VirtualPath::IsAbsolute(path.value())) path_for_url = base::FilePath(path.value().substr(1)); return ExternalMountPoints::GetSystemInstance()->CreateExternalFileSystemURL( @@ -68,7 +68,7 @@ FileSystemURL CreateSyncableFileSystemURL(const GURL& origin, } FileSystemURL CreateSyncableFileSystemURLForSync( - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const FileSystemURL& syncable_url) { return ExternalMountPoints::GetSystemInstance()->CreateExternalFileSystemURL( syncable_url.origin(), @@ -78,7 +78,7 @@ FileSystemURL CreateSyncableFileSystemURLForSync( bool SerializeSyncableFileSystemURL(const FileSystemURL& url, std::string* serialized_url) { - if (!url.is_valid() || url.type() != fileapi::kFileSystemTypeSyncable) + if (!url.is_valid() || url.type() != storage::kFileSystemTypeSyncable) return false; *serialized_url = GetSyncableFileSystemRootURI(url.origin()).spec() + @@ -95,7 +95,7 @@ bool DeserializeSyncableFileSystemURL( FileSystemURL deserialized = ExternalMountPoints::GetSystemInstance()->CrackURL(GURL(serialized_url)); if (!deserialized.is_valid() || - deserialized.type() != fileapi::kFileSystemTypeSyncable) { + deserialized.type() != storage::kFileSystemTypeSyncable) { return false; } diff --git a/chrome/browser/sync_file_system/syncable_file_system_util.h b/chrome/browser/sync_file_system/syncable_file_system_util.h index edddd82..7193e1e 100644 --- a/chrome/browser/sync_file_system/syncable_file_system_util.h +++ b/chrome/browser/sync_file_system/syncable_file_system_util.h @@ -11,7 +11,7 @@ #include "base/files/file_path.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace fileapi { +namespace storage { class FileSystemContext; class FileSystemURL; } @@ -38,13 +38,13 @@ GURL GetSyncableFileSystemRootURI(const GURL& origin); // origin: 'http://www.example.com/', // path: '/foo/bar', // returns 'filesystem:http://www.example.com/external/syncfs/foo/bar' -fileapi::FileSystemURL -CreateSyncableFileSystemURL(const GURL& origin, const base::FilePath& path); +storage::FileSystemURL CreateSyncableFileSystemURL(const GURL& origin, + const base::FilePath& path); // Creates a special filesystem URL for synchronizing |syncable_url|. -fileapi::FileSystemURL CreateSyncableFileSystemURLForSync( - fileapi::FileSystemContext* file_system_context, - const fileapi::FileSystemURL& syncable_url); +storage::FileSystemURL CreateSyncableFileSystemURLForSync( + storage::FileSystemContext* file_system_context, + const storage::FileSystemURL& syncable_url); // Serializes a given FileSystemURL |url| and sets the serialized string to // |serialized_url|. If the URL does not represent a syncable filesystem, @@ -61,8 +61,8 @@ fileapi::FileSystemURL CreateSyncableFileSystemURLForSync( // 'filesystem:http://www.example.com/external/syncfs/foo\\bar' // (on others) // 'filesystem:http://www.example.com/external/syncfs/foo/bar' -bool SerializeSyncableFileSystemURL( - const fileapi::FileSystemURL& url, std::string* serialized_url); +bool SerializeSyncableFileSystemURL(const storage::FileSystemURL& url, + std::string* serialized_url); // Deserializes a serialized FileSystem URL string |serialized_url| and sets the // deserialized value to |url|. If the reconstructed object is invalid or does @@ -74,8 +74,8 @@ bool SerializeSyncableFileSystemURL( // behavior). // // See the comment of SerializeSyncableFileSystemURL() for more details. -bool DeserializeSyncableFileSystemURL( - const std::string& serialized_url, fileapi::FileSystemURL* url); +bool DeserializeSyncableFileSystemURL(const std::string& serialized_url, + storage::FileSystemURL* url); // Returns SyncFileSystem sub-directory path. base::FilePath GetSyncFileSystemDir(const base::FilePath& profile_base_dir); diff --git a/chrome/browser/sync_file_system/syncable_file_system_util_unittest.cc b/chrome/browser/sync_file_system/syncable_file_system_util_unittest.cc index a3c49bb..a80633e 100644 --- a/chrome/browser/sync_file_system/syncable_file_system_util_unittest.cc +++ b/chrome/browser/sync_file_system/syncable_file_system_util_unittest.cc @@ -13,8 +13,8 @@ #include "webkit/browser/fileapi/external_mount_points.h" #include "webkit/common/fileapi/file_system_types.h" -using fileapi::ExternalMountPoints; -using fileapi::FileSystemURL; +using storage::ExternalMountPoints; +using storage::FileSystemURL; namespace sync_file_system { diff --git a/chrome/browser/ui/app_list/test/fake_profile.cc b/chrome/browser/ui/app_list/test/fake_profile.cc index 166b6e4..91f9e3e 100644 --- a/chrome/browser/ui/app_list/test/fake_profile.cc +++ b/chrome/browser/ui/app_list/test/fake_profile.cc @@ -64,7 +64,7 @@ content::BrowserPluginGuestManager* FakeProfile::GetGuestManager() { return NULL; } -quota::SpecialStoragePolicy* FakeProfile::GetSpecialStoragePolicy() { +storage::SpecialStoragePolicy* FakeProfile::GetSpecialStoragePolicy() { return NULL; } diff --git a/chrome/browser/ui/app_list/test/fake_profile.h b/chrome/browser/ui/app_list/test/fake_profile.h index a786045..3b34e0d 100644 --- a/chrome/browser/ui/app_list/test/fake_profile.h +++ b/chrome/browser/ui/app_list/test/fake_profile.h @@ -47,7 +47,7 @@ class FakeProfile : public Profile { bool in_memory) OVERRIDE; virtual content::ResourceContext* GetResourceContext() OVERRIDE; virtual content::BrowserPluginGuestManager* GetGuestManager() OVERRIDE; - virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; + virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; virtual content::PushMessagingService* GetPushMessagingService() OVERRIDE; virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() OVERRIDE; virtual scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() OVERRIDE; diff --git a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm index 20a8acb..0771579 100644 --- a/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm +++ b/chrome/browser/ui/cocoa/content_settings/cookie_details_unittest.mm @@ -61,8 +61,11 @@ TEST_F(CookiesDetailsTest, CreateForTreeDatabase) { int64 size = 1234; base::Time last_modified = base::Time::Now(); BrowsingDataDatabaseHelper::DatabaseInfo info( - webkit_database::DatabaseIdentifier::CreateFromOrigin(origin), - database_name, description, size, last_modified); + storage::DatabaseIdentifier::CreateFromOrigin(origin), + database_name, + description, + size, + last_modified); details.reset([[CocoaCookieDetails alloc] initWithDatabase:&info]); EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeDatabase); diff --git a/chrome/browser/ui/webui/cookies_tree_model_util.cc b/chrome/browser/ui/webui/cookies_tree_model_util.cc index 6ee0e4a..f57568b 100644 --- a/chrome/browser/ui/webui/cookies_tree_model_util.cc +++ b/chrome/browser/ui/webui/cookies_tree_model_util.cc @@ -208,8 +208,8 @@ bool CookiesTreeModelUtil::GetCookieTreeNodeDictionary( const BrowsingDataFileSystemHelper::FileSystemInfo& file_system_info = *node.GetDetailedInfo().file_system_info; - const fileapi::FileSystemType kPerm = fileapi::kFileSystemTypePersistent; - const fileapi::FileSystemType kTemp = fileapi::kFileSystemTypeTemporary; + const storage::FileSystemType kPerm = storage::kFileSystemTypePersistent; + const storage::FileSystemType kTemp = storage::kFileSystemTypeTemporary; dict->SetString(kKeyOrigin, file_system_info.origin.spec()); dict->SetString(kKeyPersistent, diff --git a/chrome/browser/ui/webui/options/cookies_view_handler.cc b/chrome/browser/ui/webui/options/cookies_view_handler.cc index e12da46..4b632ce 100644 --- a/chrome/browser/ui/webui/options/cookies_view_handler.cc +++ b/chrome/browser/ui/webui/options/cookies_view_handler.cc @@ -29,7 +29,7 @@ #include "content/public/browser/web_ui.h" #include "grit/generated_resources.h" -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -192,7 +192,7 @@ void CookiesViewHandler::EnsureCookiesTreeModelCreated() { storage_partition->GetIndexedDBContext(); content::ServiceWorkerContext* service_worker_context = storage_partition->GetServiceWorkerContext(); - fileapi::FileSystemContext* file_system_context = + storage::FileSystemContext* file_system_context = storage_partition->GetFileSystemContext(); LocalDataContainer* container = new LocalDataContainer( new BrowsingDataCookieHelper(profile->GetRequestContext()), diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc index bd4a8b7..1e0ab13 100644 --- a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc +++ b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc @@ -22,7 +22,7 @@ QuotaInternalsProxy::QuotaInternalsProxy(QuotaInternalsHandler* handler) } void QuotaInternalsProxy::RequestInfo( - scoped_refptr<quota::QuotaManager> quota_manager) { + scoped_refptr<storage::QuotaManager> quota_manager) { DCHECK(quota_manager.get()); if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { BrowserThread::PostTask( @@ -38,25 +38,26 @@ void QuotaInternalsProxy::RequestInfo( quota_manager_->GetTemporaryGlobalQuota( base::Bind(&QuotaInternalsProxy::DidGetGlobalQuota, - weak_factory_.GetWeakPtr(), quota::kStorageTypeTemporary)); + weak_factory_.GetWeakPtr(), + storage::kStorageTypeTemporary)); quota_manager_->GetGlobalUsage( - quota::kStorageTypeTemporary, + storage::kStorageTypeTemporary, base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage, weak_factory_.GetWeakPtr(), - quota::kStorageTypeTemporary)); + storage::kStorageTypeTemporary)); quota_manager_->GetGlobalUsage( - quota::kStorageTypePersistent, + storage::kStorageTypePersistent, base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage, weak_factory_.GetWeakPtr(), - quota::kStorageTypePersistent)); + storage::kStorageTypePersistent)); quota_manager_->GetGlobalUsage( - quota::kStorageTypeSyncable, + storage::kStorageTypeSyncable, base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage, weak_factory_.GetWeakPtr(), - quota::kStorageTypeSyncable)); + storage::kStorageTypeSyncable)); quota_manager_->DumpQuotaTable( base::Bind(&QuotaInternalsProxy::DidDumpQuotaTable, @@ -95,23 +96,23 @@ RELAY_TO_HANDLER(ReportStatistics, const Statistics&) #undef RELAY_TO_HANDLER -void QuotaInternalsProxy::DidGetAvailableSpace(quota::QuotaStatusCode status, +void QuotaInternalsProxy::DidGetAvailableSpace(storage::QuotaStatusCode status, int64 space) { - if (status == quota::kQuotaStatusOk) + if (status == storage::kQuotaStatusOk) ReportAvailableSpace(space); } -void QuotaInternalsProxy::DidGetGlobalQuota(quota::StorageType type, - quota::QuotaStatusCode status, +void QuotaInternalsProxy::DidGetGlobalQuota(storage::StorageType type, + storage::QuotaStatusCode status, int64 quota) { - if (status == quota::kQuotaStatusOk) { + if (status == storage::kQuotaStatusOk) { GlobalStorageInfo info(type); info.set_quota(quota); ReportGlobalInfo(info); } } -void QuotaInternalsProxy::DidGetGlobalUsage(quota::StorageType type, +void QuotaInternalsProxy::DidGetGlobalUsage(storage::StorageType type, int64 usage, int64 unlimited_usage) { GlobalStorageInfo info(type); @@ -155,11 +156,11 @@ void QuotaInternalsProxy::DidDumpOriginInfoTable( } void QuotaInternalsProxy::DidGetHostUsage(const std::string& host, - quota::StorageType type, + storage::StorageType type, int64 usage) { - DCHECK(type == quota::kStorageTypeTemporary || - type == quota::kStorageTypePersistent || - type == quota::kStorageTypeSyncable); + DCHECK(type == storage::kStorageTypeTemporary || + type == storage::kStorageTypePersistent || + type == storage::kStorageTypeSyncable); PerHostStorageInfo info(host, type); info.set_usage(usage); @@ -176,7 +177,7 @@ void QuotaInternalsProxy::DidGetHostUsage(const std::string& host, hosts_pending_.begin()->second); } -void QuotaInternalsProxy::RequestPerOriginInfo(quota::StorageType type) { +void QuotaInternalsProxy::RequestPerOriginInfo(storage::StorageType type) { DCHECK(quota_manager_.get()); std::set<GURL> origins; @@ -206,7 +207,7 @@ void QuotaInternalsProxy::RequestPerOriginInfo(quota::StorageType type) { } void QuotaInternalsProxy::VisitHost(const std::string& host, - quota::StorageType type) { + storage::StorageType type) { if (hosts_visited_.insert(std::make_pair(host, type)).second) { hosts_pending_.insert(std::make_pair(host, type)); if (hosts_pending_.size() == 1) { @@ -216,7 +217,7 @@ void QuotaInternalsProxy::VisitHost(const std::string& host, } void QuotaInternalsProxy::GetHostUsage(const std::string& host, - quota::StorageType type) { + storage::StorageType type) { DCHECK(quota_manager_.get()); quota_manager_->GetHostUsage(host, type, diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h index b2326be..c3a5f4f 100644 --- a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h +++ b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h @@ -35,7 +35,7 @@ class QuotaInternalsProxy public: explicit QuotaInternalsProxy(QuotaInternalsHandler* handler); - void RequestInfo(scoped_refptr<quota::QuotaManager> quota_manager); + void RequestInfo(scoped_refptr<storage::QuotaManager> quota_manager); private: friend class base::DeleteHelper<QuotaInternalsProxy>; @@ -43,8 +43,8 @@ class QuotaInternalsProxy content::BrowserThread::IO>; friend class QuotaInternalsHandler; - typedef quota::QuotaManager::QuotaTableEntries QuotaTableEntries; - typedef quota::QuotaManager::OriginInfoTableEntries OriginInfoTableEntries; + typedef storage::QuotaManager::QuotaTableEntries QuotaTableEntries; + typedef storage::QuotaManager::OriginInfoTableEntries OriginInfoTableEntries; virtual ~QuotaInternalsProxy(); @@ -55,31 +55,31 @@ class QuotaInternalsProxy void ReportStatistics(const Statistics& stats); // Called on IO Thread by QuotaManager as callback. - void DidGetAvailableSpace(quota::QuotaStatusCode status, int64 space); - void DidGetGlobalQuota(quota::StorageType type, - quota::QuotaStatusCode status, + void DidGetAvailableSpace(storage::QuotaStatusCode status, int64 space); + void DidGetGlobalQuota(storage::StorageType type, + storage::QuotaStatusCode status, int64 quota); - void DidGetGlobalUsage(quota::StorageType type, + void DidGetGlobalUsage(storage::StorageType type, int64 usage, int64 unlimited_usage); void DidDumpQuotaTable(const QuotaTableEntries& entries); void DidDumpOriginInfoTable(const OriginInfoTableEntries& entries); void DidGetHostUsage(const std::string& host, - quota::StorageType type, + storage::StorageType type, int64 usage); // Helper. Called on IO Thread. - void RequestPerOriginInfo(quota::StorageType type); - void VisitHost(const std::string& host, quota::StorageType type); - void GetHostUsage(const std::string& host, quota::StorageType type); + void RequestPerOriginInfo(storage::StorageType type); + void VisitHost(const std::string& host, storage::StorageType type); + void GetHostUsage(const std::string& host, storage::StorageType type); // Used on UI Thread. QuotaInternalsHandler* handler_; // Used on IO Thread. - scoped_refptr<quota::QuotaManager> quota_manager_; - std::set<std::pair<std::string, quota::StorageType> > - hosts_visited_, hosts_pending_; + scoped_refptr<storage::QuotaManager> quota_manager_; + std::set<std::pair<std::string, storage::StorageType> > hosts_visited_, + hosts_pending_; std::vector<PerHostStorageInfo> report_pending_; base::WeakPtrFactory<QuotaInternalsProxy> weak_factory_; diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_types.cc b/chrome/browser/ui/webui/quota_internals/quota_internals_types.cc index 097ccaa..83565cf 100644 --- a/chrome/browser/ui/webui/quota_internals/quota_internals_types.cc +++ b/chrome/browser/ui/webui/quota_internals/quota_internals_types.cc @@ -11,17 +11,17 @@ namespace { -std::string StorageTypeToString(quota::StorageType type) { +std::string StorageTypeToString(storage::StorageType type) { switch (type) { - case quota::kStorageTypeTemporary: + case storage::kStorageTypeTemporary: return "temporary"; - case quota::kStorageTypePersistent: + case storage::kStorageTypePersistent: return "persistent"; - case quota::kStorageTypeSyncable: + case storage::kStorageTypeSyncable: return "syncable"; - case quota::kStorageTypeQuotaNotManaged: + case storage::kStorageTypeQuotaNotManaged: return "quota not managed"; - case quota::kStorageTypeUnknown: + case storage::kStorageTypeUnknown: return "unknown"; } return "unknown"; @@ -31,7 +31,7 @@ std::string StorageTypeToString(quota::StorageType type) { namespace quota_internals { -GlobalStorageInfo::GlobalStorageInfo(quota::StorageType type) +GlobalStorageInfo::GlobalStorageInfo(storage::StorageType type) : type_(type), usage_(-1), unlimited_usage_(-1), quota_(-1) { } @@ -52,7 +52,7 @@ base::Value* GlobalStorageInfo::NewValue() const { } PerHostStorageInfo::PerHostStorageInfo(const std::string& host, - quota::StorageType type) + storage::StorageType type) : host_(host), type_(type), usage_(-1), quota_(-1) { } @@ -71,7 +71,7 @@ base::Value* PerHostStorageInfo::NewValue() const { } PerOriginStorageInfo::PerOriginStorageInfo(const GURL& origin, - quota::StorageType type) + storage::StorageType type) : origin_(origin), type_(type), host_(net::GetHostOrSpecFromURL(origin)), diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_types.h b/chrome/browser/ui/webui/quota_internals/quota_internals_types.h index 0c70a45..fcc8cf0 100644 --- a/chrome/browser/ui/webui/quota_internals/quota_internals_types.h +++ b/chrome/browser/ui/webui/quota_internals/quota_internals_types.h @@ -21,7 +21,7 @@ namespace quota_internals { // Represends global usage and quota information for specific type of storage. class GlobalStorageInfo { public: - explicit GlobalStorageInfo(quota::StorageType type); + explicit GlobalStorageInfo(storage::StorageType type); ~GlobalStorageInfo(); void set_usage(int64 usage) { @@ -40,7 +40,7 @@ class GlobalStorageInfo { // deleting the returned pointer. base::Value* NewValue() const; private: - quota::StorageType type_; + storage::StorageType type_; int64 usage_; int64 unlimited_usage_; @@ -50,7 +50,7 @@ class GlobalStorageInfo { // Represents per host usage and quota information for the storage. class PerHostStorageInfo { public: - PerHostStorageInfo(const std::string& host, quota::StorageType type); + PerHostStorageInfo(const std::string& host, storage::StorageType type); ~PerHostStorageInfo(); void set_usage(int64 usage) { @@ -66,7 +66,7 @@ class PerHostStorageInfo { base::Value* NewValue() const; private: std::string host_; - quota::StorageType type_; + storage::StorageType type_; int64 usage_; int64 quota_; @@ -75,7 +75,7 @@ class PerHostStorageInfo { // Represendts per origin usage and access time information. class PerOriginStorageInfo { public: - PerOriginStorageInfo(const GURL& origin, quota::StorageType type); + PerOriginStorageInfo(const GURL& origin, storage::StorageType type); ~PerOriginStorageInfo(); void set_in_use(bool in_use) { @@ -99,7 +99,7 @@ class PerOriginStorageInfo { base::Value* NewValue() const; private: GURL origin_; - quota::StorageType type_; + storage::StorageType type_; std::string host_; int in_use_; diff --git a/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.cc b/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.cc index a14132c..30e053e 100644 --- a/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.cc +++ b/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.cc @@ -86,10 +86,11 @@ void SyncFileSystemInternalsHandler::OnSyncStateUpdated( } void SyncFileSystemInternalsHandler::OnFileSynced( - const fileapi::FileSystemURL& url, + const storage::FileSystemURL& url, sync_file_system::SyncFileStatus status, sync_file_system::SyncAction action, - sync_file_system::SyncDirection direction) {} + sync_file_system::SyncDirection direction) { +} void SyncFileSystemInternalsHandler::OnLogRecorded( const sync_file_system::TaskLogger::TaskLog& task_log) { diff --git a/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.h b/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.h index 5a01f70..506b12d 100644 --- a/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.h +++ b/chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_handler.h @@ -36,11 +36,10 @@ class SyncFileSystemInternalsHandler const GURL& app_origin, sync_file_system::SyncServiceState state, const std::string& description) OVERRIDE; - virtual void OnFileSynced( - const fileapi::FileSystemURL& url, - sync_file_system::SyncFileStatus status, - sync_file_system::SyncAction action, - sync_file_system::SyncDirection direction) OVERRIDE; + virtual void OnFileSynced(const storage::FileSystemURL& url, + sync_file_system::SyncFileStatus status, + sync_file_system::SyncAction action, + sync_file_system::SyncDirection direction) OVERRIDE; // sync_file_system::TaskLogger::Observer implementation. virtual void OnLogRecorded( diff --git a/chrome/renderer/extensions/media_galleries_custom_bindings.cc b/chrome/renderer/extensions/media_galleries_custom_bindings.cc index 2cd4b3a..7b6b110 100644 --- a/chrome/renderer/extensions/media_galleries_custom_bindings.cc +++ b/chrome/renderer/extensions/media_galleries_custom_bindings.cc @@ -30,11 +30,11 @@ void GetMediaFileSystemObject(const v8::FunctionCallbackInfo<v8::Value>& args) { blink::WebLocalFrame::frameForCurrentContext(); const GURL origin = GURL(webframe->document().securityOrigin().toString()); std::string fs_name = - fileapi::GetFileSystemName(origin, fileapi::kFileSystemTypeExternal); + storage::GetFileSystemName(origin, storage::kFileSystemTypeExternal); fs_name.append("_"); fs_name.append(fs_mount); const GURL root_url( - fileapi::GetExternalFileSystemRootURIString(origin, fs_mount)); + storage::GetExternalFileSystemRootURIString(origin, fs_mount)); args.GetReturnValue().Set( blink::WebDOMFileSystem::create(webframe, blink::WebFileSystemTypeExternal, diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index dea634a..b30b1336 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -894,7 +894,7 @@ PrefService* TestingProfile::GetOffTheRecordPrefs() { return NULL; } -quota::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { +storage::SpecialStoragePolicy* TestingProfile::GetSpecialStoragePolicy() { #if defined(ENABLE_EXTENSIONS) return GetExtensionSpecialStoragePolicy(); #else diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h index 272841c..bf55546c 100644 --- a/chrome/test/base/testing_profile.h +++ b/chrome/test/base/testing_profile.h @@ -34,7 +34,7 @@ class ProfilePolicyConnector; class SchemaRegistryService; } -namespace quota { +namespace storage { class SpecialStoragePolicy; } @@ -223,7 +223,7 @@ class TestingProfile : public Profile { int renderer_child_id) OVERRIDE; virtual content::ResourceContext* GetResourceContext() OVERRIDE; virtual content::BrowserPluginGuestManager* GetGuestManager() OVERRIDE; - virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; + virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; virtual content::PushMessagingService* GetPushMessagingService() OVERRIDE; virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() OVERRIDE; |