diff options
Diffstat (limited to 'webkit/browser')
145 files changed, 687 insertions, 695 deletions
diff --git a/webkit/browser/blob/blob_data_handle.cc b/webkit/browser/blob/blob_data_handle.cc index 8ccba74..a205dd5 100644 --- a/webkit/browser/blob/blob_data_handle.cc +++ b/webkit/browser/blob/blob_data_handle.cc @@ -11,7 +11,7 @@ #include "webkit/browser/blob/blob_storage_context.h" #include "webkit/common/blob/blob_data.h" -namespace webkit_blob { +namespace storage { BlobDataHandle::BlobDataHandleShared::BlobDataHandleShared( BlobData* blob_data, @@ -65,4 +65,4 @@ std::string BlobDataHandle::uuid() const { return shared_->uuid(); } -} // namespace webkit_blob +} // namespace storage diff --git a/webkit/browser/blob/blob_data_handle.h b/webkit/browser/blob/blob_data_handle.h index 917a0b3..d7b156a 100644 --- a/webkit/browser/blob/blob_data_handle.h +++ b/webkit/browser/blob/blob_data_handle.h @@ -16,7 +16,7 @@ namespace base { class SequencedTaskRunner; } -namespace webkit_blob { +namespace storage { class BlobData; class BlobStorageContext; @@ -66,6 +66,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobDataHandle scoped_refptr<BlobDataHandleShared> shared_; }; -} // namespace webkit_blob +} // namespace storage #endif // WEBKIT_BROWSER_BLOB_BLOB_DATA_HANDLE_H_ diff --git a/webkit/browser/blob/blob_storage_context.cc b/webkit/browser/blob/blob_storage_context.cc index f62a26d..9c5f9bc 100644 --- a/webkit/browser/blob/blob_storage_context.cc +++ b/webkit/browser/blob/blob_storage_context.cc @@ -12,7 +12,7 @@ #include "webkit/browser/blob/blob_data_handle.h" #include "webkit/common/blob/blob_data.h" -namespace webkit_blob { +namespace storage { namespace { @@ -322,4 +322,4 @@ bool BlobStorageContext::IsUrlRegistered(const GURL& blob_url) { return public_blob_urls_.find(blob_url) != public_blob_urls_.end(); } -} // namespace webkit_blob +} // namespace storage diff --git a/webkit/browser/blob/blob_storage_context.h b/webkit/browser/blob/blob_storage_context.h index a753c59..22a1412 100644 --- a/webkit/browser/blob/blob_storage_context.h +++ b/webkit/browser/blob/blob_storage_context.h @@ -26,7 +26,7 @@ namespace content { class BlobStorageHost; } -namespace webkit_blob { +namespace storage { class BlobDataHandle; @@ -113,6 +113,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobStorageContext DISALLOW_COPY_AND_ASSIGN(BlobStorageContext); }; -} // namespace webkit_blob +} // namespace storage #endif // WEBKIT_BROWSER_BLOB_BLOB_STORAGE_CONTEXT_H_ diff --git a/webkit/browser/blob/blob_url_request_job.cc b/webkit/browser/blob/blob_url_request_job.cc index f1040f5..c4725a3 100644 --- a/webkit/browser/blob/blob_url_request_job.cc +++ b/webkit/browser/blob/blob_url_request_job.cc @@ -30,7 +30,7 @@ #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace webkit_blob { +namespace storage { namespace { @@ -50,7 +50,7 @@ BlobURLRequestJob::BlobURLRequestJob( net::URLRequest* request, net::NetworkDelegate* network_delegate, BlobData* blob_data, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, base::MessageLoopProxy* file_thread_proxy) : net::URLRequestJob(request, network_delegate), blob_data_(blob_data), @@ -573,10 +573,12 @@ void BlobURLRequestJob::CreateFileStreamReader(size_t index, break; case BlobData::Item::TYPE_FILE_FILESYSTEM: reader = file_system_context_->CreateFileStreamReader( - fileapi::FileSystemURL( - file_system_context_->CrackURL(item.filesystem_url())), - item.offset() + additional_offset, - item.expected_modification_time()).release(); + storage::FileSystemURL( + file_system_context_->CrackURL( + item.filesystem_url())), + item.offset() + additional_offset, + item.expected_modification_time()) + .release(); break; default: NOTREACHED(); @@ -585,4 +587,4 @@ void BlobURLRequestJob::CreateFileStreamReader(size_t index, index_to_reader_[index] = reader; } -} // namespace webkit_blob +} // namespace storage diff --git a/webkit/browser/blob/blob_url_request_job.h b/webkit/browser/blob/blob_url_request_job.h index 81a5a3e..a6af4ea 100644 --- a/webkit/browser/blob/blob_url_request_job.h +++ b/webkit/browser/blob/blob_url_request_job.h @@ -19,7 +19,7 @@ namespace base { class MessageLoopProxy; } -namespace fileapi { +namespace storage { class FileSystemContext; } @@ -28,7 +28,7 @@ class DrainableIOBuffer; class IOBuffer; } -namespace webkit_blob { +namespace storage { class FileStreamReader; @@ -39,7 +39,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobURLRequestJob BlobURLRequestJob(net::URLRequest* request, net::NetworkDelegate* network_delegate, BlobData* blob_data, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, base::MessageLoopProxy* resolving_message_loop_proxy); // net::URLRequestJob methods. @@ -98,7 +98,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobURLRequestJob scoped_refptr<BlobData> blob_data_; // Variables for controlling read from |blob_data_|. - scoped_refptr<fileapi::FileSystemContext> file_system_context_; + scoped_refptr<storage::FileSystemContext> file_system_context_; scoped_refptr<base::MessageLoopProxy> file_thread_proxy_; std::vector<int64> item_length_list_; int64 total_size_; @@ -124,6 +124,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobURLRequestJob DISALLOW_COPY_AND_ASSIGN(BlobURLRequestJob); }; -} // namespace webkit_blob +} // namespace storage #endif // WEBKIT_BROWSER_BLOB_BLOB_URL_REQUEST_JOB_H_ diff --git a/webkit/browser/blob/blob_url_request_job_factory.cc b/webkit/browser/blob/blob_url_request_job_factory.cc index 73efe4c..c8e4fd3 100644 --- a/webkit/browser/blob/blob_url_request_job_factory.cc +++ b/webkit/browser/blob/blob_url_request_job_factory.cc @@ -16,7 +16,7 @@ #include "webkit/browser/blob/blob_url_request_job.h" #include "webkit/browser/fileapi/file_system_context.h" -namespace webkit_blob { +namespace storage { namespace { @@ -49,10 +49,9 @@ void BlobProtocolHandler::SetRequestedBlobDataHandle( BlobProtocolHandler::BlobProtocolHandler( BlobStorageContext* context, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, base::MessageLoopProxy* loop_proxy) - : file_system_context_(file_system_context), - file_loop_proxy_(loop_proxy) { + : file_system_context_(file_system_context), file_loop_proxy_(loop_proxy) { if (context) context_ = context->AsWeakPtr(); } @@ -62,13 +61,15 @@ BlobProtocolHandler::~BlobProtocolHandler() { net::URLRequestJob* BlobProtocolHandler::MaybeCreateJob( net::URLRequest* request, net::NetworkDelegate* network_delegate) const { - return new webkit_blob::BlobURLRequestJob( - request, network_delegate, LookupBlobData(request), - file_system_context_, file_loop_proxy_); + return new storage::BlobURLRequestJob(request, + network_delegate, + LookupBlobData(request), + file_system_context_, + file_loop_proxy_); } -scoped_refptr<webkit_blob::BlobData> -BlobProtocolHandler::LookupBlobData(net::URLRequest* request) const { +scoped_refptr<storage::BlobData> BlobProtocolHandler::LookupBlobData( + net::URLRequest* request) const { BlobDataHandle* blob_data_handle = GetRequestedBlobDataHandle(request); if (blob_data_handle) return blob_data_handle->data(); @@ -86,4 +87,4 @@ BlobProtocolHandler::LookupBlobData(net::URLRequest* request) const { return handle.get() ? handle->data() : NULL; } -} // namespace webkit_blob +} // namespace storage diff --git a/webkit/browser/blob/blob_url_request_job_factory.h b/webkit/browser/blob/blob_url_request_job_factory.h index 954aaee..8b4196c 100644 --- a/webkit/browser/blob/blob_url_request_job_factory.h +++ b/webkit/browser/blob/blob_url_request_job_factory.h @@ -16,15 +16,15 @@ namespace base { class MessageLoopProxy; } // namespace base -namespace fileapi { +namespace storage { class FileSystemContext; -} // namespace fileapi +} // namespace storage namespace net { class URLRequestContext; } // namespace net -namespace webkit_blob { +namespace storage { class BlobData; class BlobDataHandle; @@ -46,7 +46,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobProtocolHandler scoped_ptr<BlobDataHandle> blob_data_handle); BlobProtocolHandler(BlobStorageContext* context, - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, base::MessageLoopProxy* file_loop_proxy); virtual ~BlobProtocolHandler(); @@ -59,12 +59,12 @@ class WEBKIT_STORAGE_BROWSER_EXPORT BlobProtocolHandler net::URLRequest* request) const; base::WeakPtr<BlobStorageContext> context_; - const scoped_refptr<fileapi::FileSystemContext> file_system_context_; + const scoped_refptr<storage::FileSystemContext> file_system_context_; const scoped_refptr<base::MessageLoopProxy> file_loop_proxy_; DISALLOW_COPY_AND_ASSIGN(BlobProtocolHandler); }; -} // namespace webkit_blob +} // namespace storage #endif // WEBKIT_BROWSER_BLOB_BLOB_URL_REQUEST_JOB_FACTORY_H_ diff --git a/webkit/browser/blob/file_stream_reader.cc b/webkit/browser/blob/file_stream_reader.cc index 6b66478..afb2ab8 100644 --- a/webkit/browser/blob/file_stream_reader.cc +++ b/webkit/browser/blob/file_stream_reader.cc @@ -6,7 +6,7 @@ #include "base/time/time.h" -namespace webkit_blob { +namespace storage { // Verify if the underlying file has not been modified. bool FileStreamReader::VerifySnapshotTime( @@ -17,4 +17,4 @@ bool FileStreamReader::VerifySnapshotTime( file_info.last_modified.ToTimeT(); } -} // namespace webkit_blob +} // namespace storage diff --git a/webkit/browser/blob/file_stream_reader.h b/webkit/browser/blob/file_stream_reader.h index 832c5d5..faf8363 100644 --- a/webkit/browser/blob/file_stream_reader.h +++ b/webkit/browser/blob/file_stream_reader.h @@ -21,12 +21,12 @@ namespace net { class IOBuffer; } -namespace fileapi { +namespace storage { class FileSystemContext; class FileSystemURL; } -namespace webkit_blob { +namespace storage { // A generic interface for reading a file-like object. class FileStreamReader { @@ -52,8 +52,8 @@ class FileStreamReader { // modification time to see if the file has been modified, and if it does any // succeeding read operations should fail with ERR_UPLOAD_FILE_CHANGED error. WEBKIT_STORAGE_BROWSER_EXPORT static FileStreamReader* - CreateForFileSystemFile(fileapi::FileSystemContext* context, - const fileapi::FileSystemURL& url, + CreateForFileSystemFile(storage::FileSystemContext* context, + const storage::FileSystemURL& url, int64 initial_offset, const base::Time& expected_modification_time); @@ -94,6 +94,6 @@ class FileStreamReader { virtual int64 GetLength(const net::Int64CompletionCallback& callback) = 0; }; -} // namespace webkit_blob +} // namespace storage #endif // WEBKIT_BLOB_FILE_STREAM_READER_H_ diff --git a/webkit/browser/blob/local_file_stream_reader.cc b/webkit/browser/blob/local_file_stream_reader.cc index 2ccc3fb..b5e52fc 100644 --- a/webkit/browser/blob/local_file_stream_reader.cc +++ b/webkit/browser/blob/local_file_stream_reader.cc @@ -13,7 +13,7 @@ #include "net/base/io_buffer.h" #include "net/base/net_errors.h" -namespace webkit_blob { +namespace storage { namespace { @@ -166,4 +166,4 @@ void LocalFileStreamReader::DidGetFileInfoForGetLength( callback.Run(file_info.size); } -} // namespace webkit_blob +} // namespace storage diff --git a/webkit/browser/blob/local_file_stream_reader.h b/webkit/browser/blob/local_file_stream_reader.h index c96cb5a..debc1b4 100644 --- a/webkit/browser/blob/local_file_stream_reader.h +++ b/webkit/browser/blob/local_file_stream_reader.h @@ -26,7 +26,7 @@ namespace net { class FileStream; } -namespace webkit_blob { +namespace storage { // A thin wrapper of net::FileStream with range support for sliced file // handling. @@ -76,6 +76,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileStreamReader base::WeakPtrFactory<LocalFileStreamReader> weak_factory_; }; -} // namespace webkit_blob +} // namespace storage #endif // WEBKIT_BROWSER_BLOB_LOCAL_FILE_STREAM_READER_H_ diff --git a/webkit/browser/blob/view_blob_internals_job.cc b/webkit/browser/blob/view_blob_internals_job.cc index 86a3a87..d9a4319 100644 --- a/webkit/browser/blob/view_blob_internals_job.cc +++ b/webkit/browser/blob/view_blob_internals_job.cc @@ -87,7 +87,7 @@ void AddHorizontalRule(std::string* out) { } // namespace -namespace webkit_blob { +namespace storage { ViewBlobInternalsJob::ViewBlobInternalsJob( net::URLRequest* request, @@ -239,4 +239,4 @@ void ViewBlobInternalsJob::GenerateHTMLForBlobData(const BlobData& blob_data, EndHTMLList(out); } -} // namespace webkit_blob +} // namespace storage diff --git a/webkit/browser/blob/view_blob_internals_job.h b/webkit/browser/blob/view_blob_internals_job.h index ed9d657..ad5ae18 100644 --- a/webkit/browser/blob/view_blob_internals_job.h +++ b/webkit/browser/blob/view_blob_internals_job.h @@ -15,7 +15,7 @@ namespace net { class URLRequest; } // namespace net -namespace webkit_blob { +namespace storage { class BlobData; class BlobStorageContext; @@ -52,6 +52,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT ViewBlobInternalsJob DISALLOW_COPY_AND_ASSIGN(ViewBlobInternalsJob); }; -} // namespace webkit_blob +} // namespace storage #endif // WEBKIT_BROWSER_BLOB_VIEW_BLOB_INTERNALS_JOB_H_ diff --git a/webkit/browser/database/database_quota_client.cc b/webkit/browser/database/database_quota_client.cc index 08e8666..19f746a 100644 --- a/webkit/browser/database/database_quota_client.cc +++ b/webkit/browser/database/database_quota_client.cc @@ -18,9 +18,9 @@ #include "webkit/browser/database/database_util.h" #include "webkit/common/database/database_identifier.h" -using quota::QuotaClient; +using storage::QuotaClient; -namespace webkit_database { +namespace storage { namespace { @@ -28,8 +28,8 @@ int64 GetOriginUsageOnDBThread( DatabaseTracker* db_tracker, const GURL& origin_url) { OriginInfo info; - if (db_tracker->GetOriginInfo( - webkit_database::GetIdentifierFromOrigin(origin_url), &info)) + if (db_tracker->GetOriginInfo(storage::GetIdentifierFromOrigin(origin_url), + &info)) return info.TotalSize(); return 0; } @@ -42,7 +42,7 @@ void GetOriginsOnDBThread( for (std::vector<std::string>::const_iterator iter = origin_identifiers.begin(); iter != origin_identifiers.end(); ++iter) { - GURL origin = webkit_database::GetOriginFromIdentifier(*iter); + GURL origin = storage::GetOriginFromIdentifier(*iter); origins_ptr->insert(origin); } } @@ -57,7 +57,7 @@ void GetOriginsForHostOnDBThread( for (std::vector<std::string>::const_iterator iter = origin_identifiers.begin(); iter != origin_identifiers.end(); ++iter) { - GURL origin = webkit_database::GetOriginFromIdentifier(*iter); + GURL origin = storage::GetOriginFromIdentifier(*iter); if (host == net::GetHostOrSpecFromURL(origin)) origins_ptr->insert(origin); } @@ -80,11 +80,11 @@ void DidDeleteOriginData( return; } - quota::QuotaStatusCode status; + storage::QuotaStatusCode status; if (result == net::OK) - status = quota::kQuotaStatusOk; + status = storage::kQuotaStatusOk; else - status = quota::kQuotaStatusUnknown; + status = storage::kQuotaStatusUnknown; if (original_task_runner->BelongsToCurrentThread()) callback.Run(status); @@ -119,15 +119,14 @@ void DatabaseQuotaClient::OnQuotaManagerDestroyed() { delete this; } -void DatabaseQuotaClient::GetOriginUsage( - const GURL& origin_url, - quota::StorageType type, - const GetUsageCallback& callback) { +void DatabaseQuotaClient::GetOriginUsage(const GURL& origin_url, + storage::StorageType type, + const GetUsageCallback& callback) { DCHECK(!callback.is_null()); DCHECK(db_tracker_.get()); // All databases are in the temp namespace for now. - if (type != quota::kStorageTypeTemporary) { + if (type != storage::kStorageTypeTemporary) { callback.Run(0); return; } @@ -140,13 +139,13 @@ void DatabaseQuotaClient::GetOriginUsage( } void DatabaseQuotaClient::GetOriginsForType( - quota::StorageType type, + storage::StorageType type, const GetOriginsCallback& callback) { DCHECK(!callback.is_null()); DCHECK(db_tracker_.get()); // All databases are in the temp namespace for now. - if (type != quota::kStorageTypeTemporary) { + if (type != storage::kStorageTypeTemporary) { callback.Run(std::set<GURL>()); return; } @@ -163,14 +162,14 @@ void DatabaseQuotaClient::GetOriginsForType( } void DatabaseQuotaClient::GetOriginsForHost( - quota::StorageType type, + storage::StorageType type, const std::string& host, const GetOriginsCallback& callback) { DCHECK(!callback.is_null()); DCHECK(db_tracker_.get()); // All databases are in the temp namespace for now. - if (type != quota::kStorageTypeTemporary) { + if (type != storage::kStorageTypeTemporary) { callback.Run(std::set<GURL>()); return; } @@ -187,16 +186,15 @@ void DatabaseQuotaClient::GetOriginsForHost( base::Owned(origins_ptr))); } -void DatabaseQuotaClient::DeleteOriginData( - const GURL& origin, - quota::StorageType type, - const DeletionCallback& callback) { +void DatabaseQuotaClient::DeleteOriginData(const GURL& origin, + storage::StorageType type, + const DeletionCallback& callback) { DCHECK(!callback.is_null()); DCHECK(db_tracker_.get()); // All databases are in the temp namespace for now, so nothing to delete. - if (type != quota::kStorageTypeTemporary) { - callback.Run(quota::kQuotaStatusOk); + if (type != storage::kStorageTypeTemporary) { + callback.Run(storage::kQuotaStatusOk); return; } @@ -210,13 +208,13 @@ void DatabaseQuotaClient::DeleteOriginData( FROM_HERE, base::Bind(&DatabaseTracker::DeleteDataForOrigin, db_tracker_, - webkit_database::GetIdentifierFromOrigin(origin), + storage::GetIdentifierFromOrigin(origin), delete_callback), delete_callback); } -bool DatabaseQuotaClient::DoesSupport(quota::StorageType type) const { - return type == quota::kStorageTypeTemporary; +bool DatabaseQuotaClient::DoesSupport(storage::StorageType type) const { + return type == storage::kStorageTypeTemporary; } -} // namespace webkit_database +} // namespace storage diff --git a/webkit/browser/database/database_quota_client.h b/webkit/browser/database/database_quota_client.h index 2c6d0aed..6770eba 100644 --- a/webkit/browser/database/database_quota_client.h +++ b/webkit/browser/database/database_quota_client.h @@ -14,7 +14,7 @@ #include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/quota/quota_types.h" -namespace webkit_database { +namespace storage { class DatabaseTracker; @@ -22,7 +22,7 @@ class DatabaseTracker; // with the quota management system. This interface is used // on the IO thread by the quota manager. class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DatabaseQuotaClient - : public quota::QuotaClient { + : public storage::QuotaClient { public: DatabaseQuotaClient( base::MessageLoopProxy* tracker_thread, @@ -33,17 +33,18 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DatabaseQuotaClient virtual ID id() const OVERRIDE; virtual void OnQuotaManagerDestroyed() OVERRIDE; virtual void GetOriginUsage(const GURL& origin_url, - quota::StorageType type, + storage::StorageType type, const GetUsageCallback& callback) OVERRIDE; - virtual void GetOriginsForType(quota::StorageType type, + virtual void GetOriginsForType(storage::StorageType type, const GetOriginsCallback& callback) OVERRIDE; - virtual void GetOriginsForHost(quota::StorageType type, + virtual void GetOriginsForHost(storage::StorageType type, const std::string& host, const GetOriginsCallback& callback) OVERRIDE; virtual void DeleteOriginData(const GURL& origin, - quota::StorageType type, + storage::StorageType type, const DeletionCallback& callback) OVERRIDE; - virtual bool DoesSupport(quota::StorageType type) const OVERRIDE; + virtual bool DoesSupport(storage::StorageType type) const OVERRIDE; + private: scoped_refptr<base::MessageLoopProxy> db_tracker_thread_; scoped_refptr<DatabaseTracker> db_tracker_; // only used on its thread @@ -51,6 +52,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DatabaseQuotaClient DISALLOW_COPY_AND_ASSIGN(DatabaseQuotaClient); }; -} // namespace webkit_database +} // namespace storage #endif // WEBKIT_BROWSER_DATABASE_DATABASE_QUOTA_CLIENT_H_ diff --git a/webkit/browser/database/database_tracker.cc b/webkit/browser/database/database_tracker.cc index ab1f6fd..257e250 100644 --- a/webkit/browser/database/database_tracker.cc +++ b/webkit/browser/database/database_tracker.cc @@ -27,7 +27,7 @@ #include "webkit/browser/quota/special_storage_policy.h" #include "webkit/common/database/database_identifier.h" -namespace webkit_database { +namespace storage { const base::FilePath::CharType kDatabaseDirectoryName[] = FILE_PATH_LITERAL("databases"); @@ -82,8 +82,8 @@ OriginInfo::OriginInfo(const std::string& origin_identifier, int64 total_size) DatabaseTracker::DatabaseTracker( const base::FilePath& profile_path, bool is_incognito, - quota::SpecialStoragePolicy* special_storage_policy, - quota::QuotaManagerProxy* quota_manager_proxy, + storage::SpecialStoragePolicy* special_storage_policy, + storage::QuotaManagerProxy* quota_manager_proxy, base::MessageLoopProxy* db_tracker_thread) : is_initialized_(false), is_incognito_(is_incognito), @@ -121,9 +121,9 @@ void DatabaseTracker::DatabaseOpened(const std::string& origin_identifier, if (quota_manager_proxy_.get()) quota_manager_proxy_->NotifyStorageAccessed( - quota::QuotaClient::kDatabase, - webkit_database::GetOriginFromIdentifier(origin_identifier), - quota::kStorageTypeTemporary); + storage::QuotaClient::kDatabase, + storage::GetOriginFromIdentifier(origin_identifier), + storage::kStorageTypeTemporary); InsertOrUpdateDatabaseDetails(origin_identifier, database_name, database_description, estimated_size); @@ -156,9 +156,9 @@ void DatabaseTracker::DatabaseClosed(const std::string& origin_identifier, // closed because we don't call it for read while open. if (quota_manager_proxy_.get()) quota_manager_proxy_->NotifyStorageAccessed( - quota::QuotaClient::kDatabase, - webkit_database::GetOriginFromIdentifier(origin_identifier), - quota::kStorageTypeTemporary); + storage::QuotaClient::kDatabase, + storage::GetOriginFromIdentifier(origin_identifier), + storage::kStorageTypeTemporary); UpdateOpenDatabaseSizeAndNotify(origin_identifier, database_name); if (database_connections_.RemoveConnection(origin_identifier, database_name)) @@ -361,9 +361,9 @@ bool DatabaseTracker::DeleteClosedDatabase( if (quota_manager_proxy_.get() && db_file_size) quota_manager_proxy_->NotifyStorageModified( - quota::QuotaClient::kDatabase, - webkit_database::GetOriginFromIdentifier(origin_identifier), - quota::kStorageTypeTemporary, + storage::QuotaClient::kDatabase, + storage::GetOriginFromIdentifier(origin_identifier), + storage::kStorageTypeTemporary, -db_file_size); // Clean up the main database and invalidate the cached record. @@ -421,9 +421,9 @@ bool DatabaseTracker::DeleteOrigin(const std::string& origin_identifier, if (quota_manager_proxy_.get() && deleted_size) { quota_manager_proxy_->NotifyStorageModified( - quota::QuotaClient::kDatabase, - webkit_database::GetOriginFromIdentifier(origin_identifier), - quota::kStorageTypeTemporary, + storage::QuotaClient::kDatabase, + storage::GetOriginFromIdentifier(origin_identifier), + storage::kStorageTypeTemporary, -deleted_size); } @@ -608,9 +608,9 @@ int64 DatabaseTracker::UpdateOpenDatabaseInfoAndNotify( info->SetDatabaseSize(name, new_size); if (quota_manager_proxy_.get()) quota_manager_proxy_->NotifyStorageModified( - quota::QuotaClient::kDatabase, - webkit_database::GetOriginFromIdentifier(origin_id), - quota::kStorageTypeTemporary, + storage::QuotaClient::kDatabase, + storage::GetOriginFromIdentifier(origin_id), + storage::kStorageTypeTemporary, new_size - old_size); FOR_EACH_OBSERVER(Observer, observers_, OnDatabaseSizeChanged( origin_id, name, new_size)); @@ -680,7 +680,7 @@ int DatabaseTracker::DeleteDataModifiedSince( ori != origins_identifiers.end(); ++ori) { if (special_storage_policy_.get() && special_storage_policy_->IsStorageProtected( - webkit_database::GetOriginFromIdentifier(*ori))) { + storage::GetOriginFromIdentifier(*ori))) { continue; } @@ -817,12 +817,12 @@ void DatabaseTracker::ClearSessionOnlyOrigins() { for (std::vector<std::string>::iterator origin = origin_identifiers.begin(); origin != origin_identifiers.end(); ++origin) { - GURL origin_url = webkit_database::GetOriginFromIdentifier(*origin); + GURL origin_url = storage::GetOriginFromIdentifier(*origin); if (!special_storage_policy_->IsStorageSessionOnly(origin_url)) continue; if (special_storage_policy_->IsStorageProtected(origin_url)) continue; - webkit_database::OriginInfo origin_info; + storage::OriginInfo origin_info; std::vector<base::string16> databases; GetOriginInfo(*origin, &origin_info); origin_info.GetAllDatabaseNames(&databases); @@ -866,4 +866,4 @@ void DatabaseTracker::SetForceKeepSessionState() { force_keep_session_state_ = true; } -} // namespace webkit_database +} // namespace storage diff --git a/webkit/browser/database/database_tracker.h b/webkit/browser/database/database_tracker.h index 4d4e567..f7c68ca 100644 --- a/webkit/browser/database/database_tracker.h +++ b/webkit/browser/database/database_tracker.h @@ -36,12 +36,12 @@ class Connection; class MetaTable; } -namespace quota { +namespace storage { class QuotaManagerProxy; class SpecialStoragePolicy; } -namespace webkit_database { +namespace storage { WEBKIT_STORAGE_BROWSER_EXPORT extern const base::FilePath::CharType kDatabaseDirectoryName[]; @@ -103,8 +103,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT DatabaseTracker DatabaseTracker(const base::FilePath& profile_path, bool is_incognito, - quota::SpecialStoragePolicy* special_storage_policy, - quota::QuotaManagerProxy* quota_manager_proxy, + storage::SpecialStoragePolicy* special_storage_policy, + storage::QuotaManagerProxy* quota_manager_proxy, base::MessageLoopProxy* db_tracker_thread); void DatabaseOpened(const std::string& origin_identifier, @@ -137,7 +137,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT DatabaseTracker virtual bool GetAllOriginsInfo(std::vector<OriginInfo>* origins_info); // Safe to call on any thread. - quota::QuotaManagerProxy* quota_manager_proxy() const { + storage::QuotaManagerProxy* quota_manager_proxy() const { return quota_manager_proxy_.get(); } @@ -290,9 +290,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT DatabaseTracker PendingDeletionCallbacks deletion_callbacks_; // Apps and Extensions can have special rights. - scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; + scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; - scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; + scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; // The database tracker thread we're supposed to run file IO on. scoped_refptr<base::MessageLoopProxy> db_tracker_thread_; @@ -314,6 +314,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT DatabaseTracker FRIEND_TEST_ALL_PREFIXES(DatabaseTracker, TestHelper); }; -} // namespace webkit_database +} // namespace storage #endif // WEBKIT_BROWSER_DATABASE_DATABASE_TRACKER_H_ diff --git a/webkit/browser/database/database_util.cc b/webkit/browser/database/database_util.cc index 14a5455..c6d797a 100644 --- a/webkit/browser/database/database_util.cc +++ b/webkit/browser/database/database_util.cc @@ -10,7 +10,7 @@ #include "webkit/browser/database/vfs_backend.h" #include "webkit/common/database/database_identifier.h" -namespace webkit_database { +namespace storage { namespace { @@ -105,4 +105,4 @@ bool DatabaseUtil::IsValidOriginIdentifier( return GetOriginFromIdentifier(origin_identifier).is_valid(); } -} // namespace webkit_database +} // namespace storage diff --git a/webkit/browser/database/database_util.h b/webkit/browser/database/database_util.h index e6c0465..9c45e27 100644 --- a/webkit/browser/database/database_util.h +++ b/webkit/browser/database/database_util.h @@ -14,7 +14,7 @@ namespace base { class FilePath; } -namespace webkit_database { +namespace storage { class DatabaseTracker; @@ -34,6 +34,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT DatabaseUtil { static bool IsValidOriginIdentifier(const std::string& origin_identifier); }; -} // namespace webkit_database +} // namespace storage #endif // WEBKIT_BROWSER_DATABASE_DATABASE_UTIL_H_ diff --git a/webkit/browser/database/databases_table.cc b/webkit/browser/database/databases_table.cc index 747de1f..c5e239b 100644 --- a/webkit/browser/database/databases_table.cc +++ b/webkit/browser/database/databases_table.cc @@ -8,7 +8,7 @@ #include "base/strings/utf_string_conversions.h" #include "sql/statement.h" -namespace webkit_database { +namespace storage { DatabaseDetails::DatabaseDetails() : estimated_size(0) { } @@ -147,4 +147,4 @@ bool DatabasesTable::DeleteOriginIdentifier( return (delete_statement.Run() && db_->GetLastChangeCount()); } -} // namespace webkit_database +} // namespace storage diff --git a/webkit/browser/database/databases_table.h b/webkit/browser/database/databases_table.h index 4a20ec1..d128b9d 100644 --- a/webkit/browser/database/databases_table.h +++ b/webkit/browser/database/databases_table.h @@ -14,7 +14,7 @@ namespace sql { class Connection; } -namespace webkit_database { +namespace storage { struct WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DatabaseDetails { DatabaseDetails(); @@ -49,6 +49,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DatabasesTable { sql::Connection* db_; }; -} // namespace webkit_database +} // namespace storage #endif // WEBKIT_BROWSER_DATABASE_DATABASES_TABLE_H_ diff --git a/webkit/browser/database/vfs_backend.cc b/webkit/browser/database/vfs_backend.cc index 019e8b9..7ed0874 100644 --- a/webkit/browser/database/vfs_backend.cc +++ b/webkit/browser/database/vfs_backend.cc @@ -9,7 +9,7 @@ #include "base/logging.h" #include "third_party/sqlite/sqlite3.h" -namespace webkit_database { +namespace storage { static const int kFileTypeMask = 0x00007F00; @@ -155,4 +155,4 @@ int64 VfsBackend::GetFileSize(const base::FilePath& file_path) { return (base::GetFileSize(file_path, &size) ? size : 0); } -} // namespace webkit_database +} // namespace storage diff --git a/webkit/browser/database/vfs_backend.h b/webkit/browser/database/vfs_backend.h index 1fb63c9..5ac1d9a 100644 --- a/webkit/browser/database/vfs_backend.h +++ b/webkit/browser/database/vfs_backend.h @@ -14,7 +14,7 @@ namespace base { class FilePath; } -namespace webkit_database { +namespace storage { class WEBKIT_STORAGE_BROWSER_EXPORT VfsBackend { public: @@ -37,6 +37,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT VfsBackend { static bool OpenFileFlagsAreConsistent(int desired_flags); }; -} // namespace webkit_database +} // namespace storage #endif // WEBKIT_BROWSER_DATABASE_VFS_BACKEND_H_ diff --git a/webkit/browser/fileapi/async_file_util.h b/webkit/browser/fileapi/async_file_util.h index bde0339..493d7b2a 100644 --- a/webkit/browser/fileapi/async_file_util.h +++ b/webkit/browser/fileapi/async_file_util.h @@ -20,11 +20,11 @@ namespace base { class Time; } -namespace webkit_blob { +namespace storage { class ShareableFileReference; } -namespace fileapi { +namespace storage { class FileSystemOperationContext; class FileSystemURL; @@ -74,10 +74,9 @@ class AsyncFileUtil { void(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)> CreateSnapshotFileCallback; - typedef base::Callback<void(int64 size)> CopyFileProgressCallback; typedef FileSystemOperation::CopyOrMoveOption CopyOrMoveOption; @@ -362,6 +361,6 @@ class AsyncFileUtil { DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ diff --git a/webkit/browser/fileapi/async_file_util_adapter.cc b/webkit/browser/fileapi/async_file_util_adapter.cc index 5a99eff..62244b7 100644 --- a/webkit/browser/fileapi/async_file_util_adapter.cc +++ b/webkit/browser/fileapi/async_file_util_adapter.cc @@ -21,9 +21,9 @@ using base::Bind; using base::Callback; using base::Owned; using base::Unretained; -using webkit_blob::ShareableFileReference; +using storage::ShareableFileReference; -namespace fileapi { +namespace storage { namespace { @@ -79,7 +79,7 @@ class GetFileInfoHelper { base::File::Error error_; base::File::Info file_info_; base::FilePath platform_path_; - webkit_blob::ScopedFile scoped_file_; + storage::ScopedFile scoped_file_; DISALLOW_COPY_AND_ASSIGN(GetFileInfoHelper); }; @@ -349,4 +349,4 @@ void AsyncFileUtilAdapter::CreateSnapshotFile( DCHECK(success); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/async_file_util_adapter.h b/webkit/browser/fileapi/async_file_util_adapter.h index 8e90e5d..e76b6c1 100644 --- a/webkit/browser/fileapi/async_file_util_adapter.h +++ b/webkit/browser/fileapi/async_file_util_adapter.h @@ -8,7 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "webkit/browser/fileapi/async_file_util.h" -namespace fileapi { +namespace storage { class FileSystemFileUtil; @@ -113,6 +113,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtilAdapter DISALLOW_COPY_AND_ASSIGN(AsyncFileUtilAdapter); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ diff --git a/webkit/browser/fileapi/copy_or_move_file_validator.h b/webkit/browser/fileapi/copy_or_move_file_validator.h index 5312fb0..9681950 100644 --- a/webkit/browser/fileapi/copy_or_move_file_validator.h +++ b/webkit/browser/fileapi/copy_or_move_file_validator.h @@ -13,7 +13,7 @@ namespace base { class FilePath; } -namespace fileapi { +namespace storage { class FileSystemURL; @@ -49,6 +49,6 @@ class CopyOrMoveFileValidatorFactory { const base::FilePath& platform_path) = 0; }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_COPY_OR_MOVE_FILE_VALIDATOR_H_ diff --git a/webkit/browser/fileapi/copy_or_move_operation_delegate.cc b/webkit/browser/fileapi/copy_or_move_operation_delegate.cc index 392b0e2..97de4f4 100644 --- a/webkit/browser/fileapi/copy_or_move_operation_delegate.cc +++ b/webkit/browser/fileapi/copy_or_move_operation_delegate.cc @@ -18,7 +18,7 @@ #include "webkit/common/blob/shareable_file_reference.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { const int64 kFlushIntervalInBytes = 10 << 20; // 10MB. @@ -131,7 +131,7 @@ class SnapshotCopyOrMoveImpl 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) { if (cancel_requested_) error = base::File::FILE_ERROR_ABORT; @@ -162,7 +162,7 @@ class SnapshotCopyOrMoveImpl void RunAfterPreWriteValidation( const base::FilePath& platform_path, const base::File::Info& file_info, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref, + const scoped_refptr<storage::ShareableFileReference>& file_ref, const CopyOrMoveOperationDelegate::StatusCallback& callback, base::File::Error error) { if (cancel_requested_) @@ -183,7 +183,7 @@ class SnapshotCopyOrMoveImpl void RunAfterCopyInForeignFile( const base::File::Info& file_info, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref, + const scoped_refptr<storage::ShareableFileReference>& file_ref, const CopyOrMoveOperationDelegate::StatusCallback& callback, base::File::Error error) { if (cancel_requested_) @@ -310,7 +310,7 @@ class SnapshotCopyOrMoveImpl 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) { if (cancel_requested_) error = base::File::FILE_ERROR_ABORT; @@ -331,7 +331,7 @@ class SnapshotCopyOrMoveImpl // |file_ref| is unused; it is passed here to make sure the reference is // alive until after post-write validation is complete. void DidPostWriteValidation( - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref, + const scoped_refptr<storage::ShareableFileReference>& file_ref, const CopyOrMoveOperationDelegate::StatusCallback& callback, base::File::Error error) { callback.Run(error); @@ -370,7 +370,7 @@ class StreamCopyOrMoveImpl const FileSystemURL& src_url, const FileSystemURL& dest_url, CopyOrMoveOperationDelegate::CopyOrMoveOption option, - scoped_ptr<webkit_blob::FileStreamReader> reader, + scoped_ptr<storage::FileStreamReader> reader, scoped_ptr<FileStreamWriter> writer, const FileSystemOperation::CopyFileProgressCallback& file_progress_callback) @@ -383,8 +383,7 @@ class StreamCopyOrMoveImpl writer_(writer.Pass()), file_progress_callback_(file_progress_callback), cancel_requested_(false), - weak_factory_(this) { - } + weak_factory_(this) {} virtual void Run( const CopyOrMoveOperationDelegate::StatusCallback& callback) OVERRIDE { @@ -443,7 +442,7 @@ class StreamCopyOrMoveImpl } const bool need_flush = dest_url_.mount_option().copy_sync_option() == - fileapi::COPY_SYNC_OPTION_SYNC; + storage::COPY_SYNC_OPTION_SYNC; DCHECK(!copy_helper_); copy_helper_.reset( @@ -520,7 +519,7 @@ class StreamCopyOrMoveImpl FileSystemURL src_url_; FileSystemURL dest_url_; CopyOrMoveOperationDelegate::CopyOrMoveOption option_; - scoped_ptr<webkit_blob::FileStreamReader> reader_; + scoped_ptr<storage::FileStreamReader> reader_; scoped_ptr<FileStreamWriter> writer_; FileSystemOperation::CopyFileProgressCallback file_progress_callback_; scoped_ptr<CopyOrMoveOperationDelegate::StreamCopyHelper> copy_helper_; @@ -532,12 +531,11 @@ class StreamCopyOrMoveImpl } // namespace CopyOrMoveOperationDelegate::StreamCopyHelper::StreamCopyHelper( - scoped_ptr<webkit_blob::FileStreamReader> reader, + scoped_ptr<storage::FileStreamReader> reader, scoped_ptr<FileStreamWriter> writer, bool need_flush, int buffer_size, - const FileSystemOperation::CopyFileProgressCallback& - file_progress_callback, + const FileSystemOperation::CopyFileProgressCallback& file_progress_callback, const base::TimeDelta& min_progress_callback_invocation_span) : reader_(reader.Pass()), writer_(writer.Pass()), @@ -757,7 +755,7 @@ void CopyOrMoveOperationDelegate::ProcessFile( } if (!validator_factory) { - scoped_ptr<webkit_blob::FileStreamReader> reader = + scoped_ptr<storage::FileStreamReader> reader = file_system_context()->CreateFileStreamReader( src_url, 0, base::Time()); scoped_ptr<FileStreamWriter> writer = @@ -965,4 +963,4 @@ FileSystemURL CopyOrMoveOperationDelegate::CreateDestURL( relative); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/copy_or_move_operation_delegate.h b/webkit/browser/fileapi/copy_or_move_operation_delegate.h index bb0c1f9..86c6d6a 100644 --- a/webkit/browser/fileapi/copy_or_move_operation_delegate.h +++ b/webkit/browser/fileapi/copy_or_move_operation_delegate.h @@ -18,12 +18,12 @@ class DrainableIOBuffer; class IOBufferWithSize; } -namespace webkit_blob { +namespace storage { class FileStreamReader; class ShareableFileReference; } -namespace fileapi { +namespace storage { class CopyOrMoveFileValidator; class FileStreamWriter; @@ -46,7 +46,7 @@ class CopyOrMoveOperationDelegate class WEBKIT_STORAGE_BROWSER_EXPORT StreamCopyHelper { public: StreamCopyHelper( - scoped_ptr<webkit_blob::FileStreamReader> reader, + scoped_ptr<storage::FileStreamReader> reader, scoped_ptr<FileStreamWriter> writer, bool need_flush, int buffer_size, @@ -76,7 +76,7 @@ class CopyOrMoveOperationDelegate void Flush(const StatusCallback& callback, bool is_eof); void DidFlush(const StatusCallback& callback, bool is_eof, int result); - scoped_ptr<webkit_blob::FileStreamReader> reader_; + scoped_ptr<storage::FileStreamReader> reader_; scoped_ptr<FileStreamWriter> writer_; const bool need_flush_; FileSystemOperation::CopyFileProgressCallback file_progress_callback_; @@ -157,6 +157,6 @@ class CopyOrMoveOperationDelegate DISALLOW_COPY_AND_ASSIGN(CopyOrMoveOperationDelegate); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_COPY_OR_MOVE_OPERATION_DELEGATE_H_ diff --git a/webkit/browser/fileapi/dragged_file_util.cc b/webkit/browser/fileapi/dragged_file_util.cc index 0243b3d..59011cb 100644 --- a/webkit/browser/fileapi/dragged_file_util.cc +++ b/webkit/browser/fileapi/dragged_file_util.cc @@ -15,7 +15,7 @@ #include "webkit/browser/fileapi/native_file_util.h" #include "webkit/common/blob/shareable_file_reference.h" -namespace fileapi { +namespace storage { typedef IsolatedContext::MountPointInfo FileInfo; @@ -102,4 +102,4 @@ scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> return scoped_ptr<AbstractFileEnumerator>(new SetFileEnumerator(toplevels)); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/dragged_file_util.h b/webkit/browser/fileapi/dragged_file_util.h index 8807fc1..712be9c 100644 --- a/webkit/browser/fileapi/dragged_file_util.h +++ b/webkit/browser/fileapi/dragged_file_util.h @@ -9,7 +9,7 @@ #include "webkit/browser/fileapi/local_file_util.h" #include "webkit/browser/webkit_storage_browser_export.h" -namespace fileapi { +namespace storage { class FileSystemOperationContext; @@ -36,6 +36,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE DraggedFileUtil DISALLOW_COPY_AND_ASSIGN(DraggedFileUtil); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_DRAGGED_FILE_UTIL_H_ diff --git a/webkit/browser/fileapi/dump_file_system.cc b/webkit/browser/fileapi/dump_file_system.cc index b7d3b13..a70f429 100644 --- a/webkit/browser/fileapi/dump_file_system.cc +++ b/webkit/browser/fileapi/dump_file_system.cc @@ -63,7 +63,7 @@ void ShowUsageAndExit(const std::string& arg0) { } // namespace -namespace fileapi { +namespace storage { static void DumpDirectoryTree(const std::string& origin_name, base::FilePath origin_dir) { @@ -158,7 +158,7 @@ static void DumpFileSystem(const base::FilePath& file_system_dir) { } } -} // namespace fileapi +} // namespace storage int main(int argc, char* argv[]) { const char* arg0 = argv[0]; @@ -187,17 +187,17 @@ int main(int argc, char* argv[]) { if (argc < 2) ShowUsageAndExit(arg0); - const base::FilePath file_system_dir = fileapi::StringToFilePath(argv[1]); + const base::FilePath file_system_dir = storage::StringToFilePath(argv[1]); if (!base::DirectoryExists(file_system_dir)) { - ShowMessageAndExit(fileapi::FilePathToString(file_system_dir) + + ShowMessageAndExit(storage::FilePathToString(file_system_dir) + " is not a filesystem directory"); } if (argc == 2) { - fileapi::DumpFileSystem(file_system_dir); + storage::DumpFileSystem(file_system_dir); } else { for (int i = 2; i < argc; i++) { - fileapi::DumpOrigin(file_system_dir, argv[i]); + storage::DumpOrigin(file_system_dir, argv[i]); } } return 0; diff --git a/webkit/browser/fileapi/external_mount_points.cc b/webkit/browser/fileapi/external_mount_points.cc index 3acfd7f..29ea8ae 100644 --- a/webkit/browser/fileapi/external_mount_points.cc +++ b/webkit/browser/fileapi/external_mount_points.cc @@ -30,9 +30,9 @@ base::FilePath NormalizeFilePath(const base::FilePath& path) { return base::FilePath(path_str).NormalizePathSeparators(); } -bool IsOverlappingMountPathForbidden(fileapi::FileSystemType type) { - return type != fileapi::kFileSystemTypeNativeMedia && - type != fileapi::kFileSystemTypeDeviceMedia; +bool IsOverlappingMountPathForbidden(storage::FileSystemType type) { + return type != storage::kFileSystemTypeNativeMedia && + type != storage::kFileSystemTypeDeviceMedia; } // Wrapper around ref-counted ExternalMountPoints that will be used to lazily @@ -40,17 +40,15 @@ bool IsOverlappingMountPathForbidden(fileapi::FileSystemType type) { class SystemMountPointsLazyWrapper { public: SystemMountPointsLazyWrapper() - : system_mount_points_(fileapi::ExternalMountPoints::CreateRefCounted()) { + : system_mount_points_(storage::ExternalMountPoints::CreateRefCounted()) { } ~SystemMountPointsLazyWrapper() {} - fileapi::ExternalMountPoints* get() { - return system_mount_points_.get(); - } + storage::ExternalMountPoints* get() { return system_mount_points_.get(); } private: - scoped_refptr<fileapi::ExternalMountPoints> system_mount_points_; + scoped_refptr<storage::ExternalMountPoints> system_mount_points_; }; base::LazyInstance<SystemMountPointsLazyWrapper>::Leaky @@ -58,7 +56,7 @@ base::LazyInstance<SystemMountPointsLazyWrapper>::Leaky } // namespace -namespace fileapi { +namespace storage { class ExternalMountPoints::Instance { public: @@ -247,11 +245,10 @@ FileSystemURL ExternalMountPoints::CreateExternalFileSystemURL( const base::FilePath& path) const { return CreateCrackedFileSystemURL( origin, - fileapi::kFileSystemTypeExternal, + storage::kFileSystemTypeExternal, // Avoid using FilePath::Append as path may be an absolute path. - base::FilePath( - CreateVirtualRootPath(mount_name).value() + - base::FilePath::kSeparators[0] + path.value())); + base::FilePath(CreateVirtualRootPath(mount_name).value() + + base::FilePath::kSeparators[0] + path.value())); } void ExternalMountPoints::RevokeAllFileSystems() { @@ -357,4 +354,4 @@ bool ExternalMountPoints::ValidateNewMountPoint(const std::string& mount_name, return true; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/external_mount_points.h b/webkit/browser/fileapi/external_mount_points.h index 7891375..060ebb1 100644 --- a/webkit/browser/fileapi/external_mount_points.h +++ b/webkit/browser/fileapi/external_mount_points.h @@ -20,7 +20,7 @@ namespace base { class FilePath; } -namespace fileapi { +namespace storage { class FileSystemURL; @@ -154,6 +154,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT ExternalMountPoints DISALLOW_COPY_AND_ASSIGN(ExternalMountPoints); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_EXTERNAL_MOUNT_POINTS_H_ diff --git a/webkit/browser/fileapi/file_observers.h b/webkit/browser/fileapi/file_observers.h index c791503..74a4607 100644 --- a/webkit/browser/fileapi/file_observers.h +++ b/webkit/browser/fileapi/file_observers.h @@ -10,7 +10,7 @@ // TODO(kinuko): Split this file into per-observer multiple files. -namespace fileapi { +namespace storage { class FileSystemURL; @@ -78,6 +78,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileChangeObserver { DISALLOW_COPY_AND_ASSIGN(FileChangeObserver); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_OBSERVERS_H_ diff --git a/webkit/browser/fileapi/file_permission_policy.h b/webkit/browser/fileapi/file_permission_policy.h index f1b6376..20fd551 100644 --- a/webkit/browser/fileapi/file_permission_policy.h +++ b/webkit/browser/fileapi/file_permission_policy.h @@ -7,7 +7,7 @@ #include "webkit/browser/webkit_storage_browser_export.h" -namespace fileapi { +namespace storage { enum FilePermissionPolicy { // Any access should be always denied. @@ -23,6 +23,6 @@ enum FilePermissionPolicy { FILE_PERMISSION_USE_FILE_PERMISSION = 1 << 2, }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_PERMISSION_POLICY_H_ diff --git a/webkit/browser/fileapi/file_stream_writer.h b/webkit/browser/fileapi/file_stream_writer.h index 3a30ab2..deeab58 100644 --- a/webkit/browser/fileapi/file_stream_writer.h +++ b/webkit/browser/fileapi/file_stream_writer.h @@ -18,7 +18,7 @@ namespace net { class IOBuffer; } -namespace fileapi { +namespace storage { // A generic interface for writing to a file-like object. class FileStreamWriter { @@ -82,6 +82,6 @@ class FileStreamWriter { virtual int Flush(const net::CompletionCallback& callback) = 0; }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_ diff --git a/webkit/browser/fileapi/file_system_backend.h b/webkit/browser/fileapi/file_system_backend.h index a8cf975..34960ca 100644 --- a/webkit/browser/fileapi/file_system_backend.h +++ b/webkit/browser/fileapi/file_system_backend.h @@ -19,11 +19,11 @@ class GURL; -namespace webkit_blob { +namespace storage { class FileStreamReader; } -namespace fileapi { +namespace storage { class AsyncFileUtil; class CopyOrMoveFileValidatorFactory; @@ -105,7 +105,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemBackend { // ERR_UPLOAD_FILE_CHANGED error. // This method itself does *not* check if the given path exists and is a // regular file. - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, @@ -132,7 +132,7 @@ class ExternalFileSystemBackend : public FileSystemBackend { // Returns true if |url| is allowed to be accessed. // This is supposed to perform ExternalFileSystem-specific security // checks. - virtual bool IsAccessAllowed(const fileapi::FileSystemURL& url) const = 0; + virtual bool IsAccessAllowed(const storage::FileSystemURL& url) const = 0; // Returns the list of top level directories that are exposed by this // provider. This list is used to set appropriate child process file access // permissions. @@ -153,6 +153,6 @@ class ExternalFileSystemBackend : public FileSystemBackend { base::FilePath* virtual_path) = 0; }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ diff --git a/webkit/browser/fileapi/file_system_context.cc b/webkit/browser/fileapi/file_system_context.cc index 0df0a1df..5d44499 100644 --- a/webkit/browser/fileapi/file_system_context.cc +++ b/webkit/browser/fileapi/file_system_context.cc @@ -31,9 +31,9 @@ #include "webkit/common/fileapi/file_system_info.h" #include "webkit/common/fileapi/file_system_util.h" -using quota::QuotaClient; +using storage::QuotaClient; -namespace fileapi { +namespace storage { namespace { @@ -134,8 +134,8 @@ FileSystemContext::FileSystemContext( base::SingleThreadTaskRunner* io_task_runner, base::SequencedTaskRunner* file_task_runner, ExternalMountPoints* external_mount_points, - quota::SpecialStoragePolicy* special_storage_policy, - quota::QuotaManagerProxy* quota_manager_proxy, + storage::SpecialStoragePolicy* special_storage_policy, + storage::QuotaManagerProxy* quota_manager_proxy, ScopedVector<FileSystemBackend> additional_backends, const std::vector<URLRequestAutoMountHandler>& auto_mount_handlers, const base::FilePath& partition_path, @@ -143,20 +143,19 @@ FileSystemContext::FileSystemContext( : io_task_runner_(io_task_runner), default_file_task_runner_(file_task_runner), quota_manager_proxy_(quota_manager_proxy), - sandbox_delegate_(new SandboxFileSystemBackendDelegate( - quota_manager_proxy, - file_task_runner, - partition_path, - special_storage_policy, - options)), - sandbox_backend_(new SandboxFileSystemBackend( - sandbox_delegate_.get())), + sandbox_delegate_( + new SandboxFileSystemBackendDelegate(quota_manager_proxy, + file_task_runner, + partition_path, + special_storage_policy, + options)), + sandbox_backend_(new SandboxFileSystemBackend(sandbox_delegate_.get())), isolated_backend_(new IsolatedFileSystemBackend()), - plugin_private_backend_(new PluginPrivateFileSystemBackend( - file_task_runner, - partition_path, - special_storage_policy, - options)), + plugin_private_backend_( + new PluginPrivateFileSystemBackend(file_task_runner, + partition_path, + special_storage_policy, + options)), additional_backends_(additional_backends.Pass()), auto_mount_handlers_(auto_mount_handlers), external_mount_points_(external_mount_points), @@ -419,16 +418,15 @@ void FileSystemContext::DeleteFileSystem( callback); } -scoped_ptr<webkit_blob::FileStreamReader> -FileSystemContext::CreateFileStreamReader( +scoped_ptr<storage::FileStreamReader> FileSystemContext::CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time) { if (!url.is_valid()) - return scoped_ptr<webkit_blob::FileStreamReader>(); + return scoped_ptr<storage::FileStreamReader>(); FileSystemBackend* backend = GetFileSystemBackend(url.type()); if (!backend) - return scoped_ptr<webkit_blob::FileStreamReader>(); + return scoped_ptr<storage::FileStreamReader>(); return backend->CreateFileStreamReader( url, offset, expected_modification_time, this); } @@ -608,7 +606,7 @@ void FileSystemContext::DidOpenFileSystemForResolveURL( return; } - fileapi::FileSystemInfo info( + storage::FileSystemInfo info( filesystem_name, filesystem_root, url.mount_type()); // Extract the virtual path not containing a filesystem type part from |url|. @@ -627,4 +625,4 @@ void FileSystemContext::DidOpenFileSystemForResolveURL( url, base::Bind(&DidGetMetadataForResolveURL, path, callback, info)); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_context.h b/webkit/browser/fileapi/file_system_context.h index 428ef60..bcae2ff 100644 --- a/webkit/browser/fileapi/file_system_context.h +++ b/webkit/browser/fileapi/file_system_context.h @@ -33,7 +33,7 @@ namespace chrome { class NativeMediaFileUtilTest; } -namespace quota { +namespace storage { class QuotaManagerProxy; class SpecialStoragePolicy; } @@ -42,12 +42,12 @@ namespace net { class URLRequest; } -namespace webkit_blob { +namespace storage { class BlobURLRequestJobTest; class FileStreamReader; } -namespace fileapi { +namespace storage { class AsyncFileUtil; class CopyOrMoveFileValidatorFactory; @@ -119,8 +119,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext base::SingleThreadTaskRunner* io_task_runner, base::SequencedTaskRunner* file_task_runner, ExternalMountPoints* external_mount_points, - quota::SpecialStoragePolicy* special_storage_policy, - quota::QuotaManagerProxy* quota_manager_proxy, + storage::SpecialStoragePolicy* special_storage_policy, + storage::QuotaManagerProxy* quota_manager_proxy, ScopedVector<FileSystemBackend> additional_backends, const std::vector<URLRequestAutoMountHandler>& auto_mount_handlers, const base::FilePath& partition_path, @@ -136,7 +136,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext const GURL& origin_url, FileSystemType type); - quota::QuotaManagerProxy* quota_manager_proxy() const { + storage::QuotaManagerProxy* quota_manager_proxy() const { return quota_manager_proxy_.get(); } @@ -246,7 +246,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext // FileSystemBackend for the URL and call the backend's CreateFileReader. // The resolved FileSystemBackend could perform further specialization // depending on the filesystem type pointed by the |url|. - scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( + scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time); @@ -371,7 +371,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemContext scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; scoped_refptr<base::SequencedTaskRunner> default_file_task_runner_; - scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; + scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; scoped_ptr<SandboxFileSystemBackendDelegate> sandbox_delegate_; @@ -417,6 +417,6 @@ struct DefaultContextDeleter { } }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_CONTEXT_H_ diff --git a/webkit/browser/fileapi/file_system_dir_url_request_job.cc b/webkit/browser/fileapi/file_system_dir_url_request_job.cc index 97fe83f..acedbce 100644 --- a/webkit/browser/fileapi/file_system_dir_url_request_job.cc +++ b/webkit/browser/fileapi/file_system_dir_url_request_job.cc @@ -29,7 +29,7 @@ using net::URLRequest; using net::URLRequestJob; using net::URLRequestStatus; -namespace fileapi { +namespace storage { FileSystemDirURLRequestJob::FileSystemDirURLRequestJob( URLRequest* request, @@ -157,4 +157,4 @@ void FileSystemDirURLRequestJob::DidReadDirectory( } } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_dir_url_request_job.h b/webkit/browser/fileapi/file_system_dir_url_request_job.h index 67e9df3..33ff8db 100644 --- a/webkit/browser/fileapi/file_system_dir_url_request_job.h +++ b/webkit/browser/fileapi/file_system_dir_url_request_job.h @@ -16,7 +16,7 @@ #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/webkit_storage_browser_export.h" -namespace fileapi { +namespace storage { class FileSystemContext; struct DirectoryEntry; @@ -64,6 +64,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemDirURLRequestJob DISALLOW_COPY_AND_ASSIGN(FileSystemDirURLRequestJob); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_DIR_URL_REQUEST_JOB_H_ diff --git a/webkit/browser/fileapi/file_system_file_stream_reader.cc b/webkit/browser/fileapi/file_system_file_stream_reader.cc index 330d011e..aa99ab9 100644 --- a/webkit/browser/fileapi/file_system_file_stream_reader.cc +++ b/webkit/browser/fileapi/file_system_file_stream_reader.cc @@ -13,27 +13,24 @@ #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" -using webkit_blob::FileStreamReader; +using storage::FileStreamReader; // TODO(kinuko): Remove this temporary namespace hack after we move both // blob and fileapi into content namespace. -namespace webkit_blob { +namespace storage { FileStreamReader* FileStreamReader::CreateForFileSystemFile( - 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) { - return new fileapi::FileSystemFileStreamReader( - file_system_context, - url, - initial_offset, - expected_modification_time); + return new storage::FileSystemFileStreamReader( + file_system_context, url, initial_offset, expected_modification_time); } -} // namespace webkit_blob +} // namespace storage -namespace fileapi { +namespace storage { namespace { @@ -119,7 +116,7 @@ void FileSystemFileStreamReader::DidCreateSnapshot( base::File::Error file_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) { DCHECK(has_pending_create_snapshot_); DCHECK(!local_file_reader_.get()); has_pending_create_snapshot_ = false; @@ -140,4 +137,4 @@ void FileSystemFileStreamReader::DidCreateSnapshot( callback.Run(); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_file_stream_reader.h b/webkit/browser/fileapi/file_system_file_stream_reader.h index 3615022..4661b9e 100644 --- a/webkit/browser/fileapi/file_system_file_stream_reader.h +++ b/webkit/browser/fileapi/file_system_file_stream_reader.h @@ -23,7 +23,7 @@ namespace content { class FileSystemFileStreamReaderTest; } -namespace fileapi { +namespace storage { class FileSystemContext; @@ -33,7 +33,7 @@ class FileSystemContext; // on FileSystemOperation::GetSnapshotFile() which may force downloading // the entire contents for remote files. class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemFileStreamReader - : public NON_EXPORTED_BASE(webkit_blob::FileStreamReader) { + : public NON_EXPORTED_BASE(storage::FileStreamReader) { public: virtual ~FileSystemFileStreamReader(); @@ -44,7 +44,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemFileStreamReader const net::Int64CompletionCallback& callback) OVERRIDE; private: - friend class webkit_blob::FileStreamReader; + friend class storage::FileStreamReader; friend class content::FileSystemFileStreamReaderTest; FileSystemFileStreamReader(FileSystemContext* file_system_context, @@ -60,20 +60,20 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemFileStreamReader base::File::Error file_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); scoped_refptr<FileSystemContext> file_system_context_; FileSystemURL url_; const int64 initial_offset_; const base::Time expected_modification_time_; - scoped_ptr<webkit_blob::FileStreamReader> local_file_reader_; - scoped_refptr<webkit_blob::ShareableFileReference> snapshot_ref_; + scoped_ptr<storage::FileStreamReader> local_file_reader_; + scoped_refptr<storage::ShareableFileReference> snapshot_ref_; bool has_pending_create_snapshot_; base::WeakPtrFactory<FileSystemFileStreamReader> weak_factory_; DISALLOW_COPY_AND_ASSIGN(FileSystemFileStreamReader); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_STREAM_READER_H_ diff --git a/webkit/browser/fileapi/file_system_file_util.cc b/webkit/browser/fileapi/file_system_file_util.cc index 7317b8b..35b1ceb 100644 --- a/webkit/browser/fileapi/file_system_file_util.cc +++ b/webkit/browser/fileapi/file_system_file_util.cc @@ -4,7 +4,7 @@ #include "webkit/browser/fileapi/file_system_file_util.h" -namespace fileapi { +namespace storage { base::FilePath FileSystemFileUtil::EmptyFileEnumerator::Next() { return base::FilePath(); @@ -22,4 +22,4 @@ bool FileSystemFileUtil::EmptyFileEnumerator::IsDirectory() { return false; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_file_util.h b/webkit/browser/fileapi/file_system_file_util.h index 7957bbb..3d29652 100644 --- a/webkit/browser/fileapi/file_system_file_util.h +++ b/webkit/browser/fileapi/file_system_file_util.h @@ -16,7 +16,7 @@ namespace base { class Time; } -namespace fileapi { +namespace storage { class FileSystemOperationContext; class FileSystemURL; @@ -167,7 +167,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemFileUtil { // // See header comments for AsyncFileUtil::CreateSnapshotFile() for // more details. - virtual webkit_blob::ScopedFile CreateSnapshotFile( + virtual storage::ScopedFile CreateSnapshotFile( FileSystemOperationContext* context, const FileSystemURL& url, base::File::Error* error, @@ -181,6 +181,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemFileUtil { DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ diff --git a/webkit/browser/fileapi/file_system_operation.h b/webkit/browser/fileapi/file_system_operation.h index 4261a2b..ececc77 100644 --- a/webkit/browser/fileapi/file_system_operation.h +++ b/webkit/browser/fileapi/file_system_operation.h @@ -23,13 +23,13 @@ namespace net { class URLRequest; } -namespace webkit_blob { +namespace storage { class ShareableFileReference; } class GURL; -namespace fileapi { +namespace storage { class FileSystemContext; class FileSystemURL; @@ -117,8 +117,8 @@ class FileSystemOperation { void(base::File::Error result, const base::File::Info& file_info, const base::FilePath& platform_path, - const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref)> - SnapshotFileCallback; + const scoped_refptr<storage::ShareableFileReference>& file_ref)> + SnapshotFileCallback; // Used for progress update callback for Copy(). // @@ -480,6 +480,6 @@ class FileSystemOperation { }; }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_H_ diff --git a/webkit/browser/fileapi/file_system_operation_context.cc b/webkit/browser/fileapi/file_system_operation_context.cc index dd333ba..1cd1f37 100644 --- a/webkit/browser/fileapi/file_system_operation_context.cc +++ b/webkit/browser/fileapi/file_system_operation_context.cc @@ -7,14 +7,15 @@ #include "base/sequenced_task_runner.h" #include "webkit/browser/fileapi/file_system_context.h" -namespace fileapi { +namespace storage { FileSystemOperationContext::FileSystemOperationContext( FileSystemContext* context) : file_system_context_(context), task_runner_(file_system_context_->default_file_task_runner()), allowed_bytes_growth_(0), - quota_limit_type_(quota::kQuotaLimitTypeUnknown) {} + quota_limit_type_(storage::kQuotaLimitTypeUnknown) { +} FileSystemOperationContext::FileSystemOperationContext( FileSystemContext* context, @@ -22,11 +23,12 @@ FileSystemOperationContext::FileSystemOperationContext( : file_system_context_(context), task_runner_(task_runner), allowed_bytes_growth_(0), - quota_limit_type_(quota::kQuotaLimitTypeUnknown) {} + quota_limit_type_(storage::kQuotaLimitTypeUnknown) { +} FileSystemOperationContext::~FileSystemOperationContext() { DetachUserDataThread(); setter_thread_checker_.DetachFromThread(); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_operation_context.h b/webkit/browser/fileapi/file_system_operation_context.h index decdecb..0428bb4 100644 --- a/webkit/browser/fileapi/file_system_operation_context.h +++ b/webkit/browser/fileapi/file_system_operation_context.h @@ -16,7 +16,7 @@ namespace base { class SequencedTaskRunner; } -namespace fileapi { +namespace storage { class FileSystemContext; @@ -50,7 +50,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemOperationContext // Returns the current remaining quota. int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } - quota::QuotaLimitType quota_limit_type() const { return quota_limit_type_; } + storage::QuotaLimitType quota_limit_type() const { return quota_limit_type_; } base::SequencedTaskRunner* task_runner() const { return task_runner_.get(); } ChangeObserverList* change_observers() { return &change_observers_; } @@ -67,7 +67,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemOperationContext DCHECK(setter_thread_checker_.CalledOnValidThread()); update_observers_ = list; } - void set_quota_limit_type(quota::QuotaLimitType limit_type) { + void set_quota_limit_type(storage::QuotaLimitType limit_type) { DCHECK(setter_thread_checker_.CalledOnValidThread()); quota_limit_type_ = limit_type; } @@ -80,7 +80,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemOperationContext int64 allowed_bytes_growth_; // The current quota limit type, used by ObfuscatedFileUtil. - quota::QuotaLimitType quota_limit_type_; + storage::QuotaLimitType quota_limit_type_; // Observers attached to this context. ChangeObserverList change_observers_; @@ -92,6 +92,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemOperationContext DISALLOW_COPY_AND_ASSIGN(FileSystemOperationContext); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ diff --git a/webkit/browser/fileapi/file_system_operation_impl.cc b/webkit/browser/fileapi/file_system_operation_impl.cc index 0f6728c..286f19f 100644 --- a/webkit/browser/fileapi/file_system_operation_impl.cc +++ b/webkit/browser/fileapi/file_system_operation_impl.cc @@ -27,9 +27,9 @@ #include "webkit/common/fileapi/file_system_util.h" #include "webkit/common/quota/quota_types.h" -using webkit_blob::ScopedFile; +using storage::ScopedFile; -namespace fileapi { +namespace storage { FileSystemOperation* FileSystemOperation::Create( const FileSystemURL& url, @@ -341,7 +341,7 @@ void FileSystemOperationImpl::GetUsageAndQuotaThenRunTask( const FileSystemURL& url, const base::Closure& task, const base::Closure& error_callback) { - quota::QuotaManagerProxy* quota_manager_proxy = + storage::QuotaManagerProxy* quota_manager_proxy = file_system_context()->quota_manager_proxy(); if (!quota_manager_proxy || !file_system_context()->GetQuotaUtil(url.type())) { @@ -364,9 +364,10 @@ void FileSystemOperationImpl::GetUsageAndQuotaThenRunTask( void FileSystemOperationImpl::DidGetUsageAndQuotaAndRunTask( const base::Closure& task, const base::Closure& error_callback, - quota::QuotaStatusCode status, - int64 usage, int64 quota) { - if (status != quota::kQuotaStatusOk) { + storage::QuotaStatusCode status, + int64 usage, + int64 quota) { + if (status != storage::kQuotaStatusOk) { LOG(WARNING) << "Got unexpected quota error : " << status; error_callback.Run(); return; @@ -555,4 +556,4 @@ bool FileSystemOperationImpl::SetPendingOperationType(OperationType type) { return true; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_operation_impl.h b/webkit/browser/fileapi/file_system_operation_impl.h index 5d93cb3..6ad33d0 100644 --- a/webkit/browser/fileapi/file_system_operation_impl.h +++ b/webkit/browser/fileapi/file_system_operation_impl.h @@ -18,7 +18,7 @@ #include "webkit/common/blob/scoped_file.h" #include "webkit/common/quota/quota_types.h" -namespace fileapi { +namespace storage { class AsyncFileUtil; class FileSystemContext; @@ -118,11 +118,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl // Sets the quota info in the operation_context_ and then runs the given // |task| if the returned quota status is successful, otherwise runs // |error_callback|. - void DidGetUsageAndQuotaAndRunTask( - const base::Closure& task, - const base::Closure& error_callback, - quota::QuotaStatusCode status, - int64 usage, int64 quota); + void DidGetUsageAndQuotaAndRunTask(const base::Closure& task, + const base::Closure& error_callback, + storage::QuotaStatusCode status, + int64 usage, + int64 quota); // The 'body' methods that perform the actual work (i.e. posting the // file task on proxy_) after the quota check. @@ -201,6 +201,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationImpl DISALLOW_COPY_AND_ASSIGN(FileSystemOperationImpl); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_IMPL_H_ diff --git a/webkit/browser/fileapi/file_system_operation_runner.cc b/webkit/browser/fileapi/file_system_operation_runner.cc index 1d588a7..0644b2f 100644 --- a/webkit/browser/fileapi/file_system_operation_runner.cc +++ b/webkit/browser/fileapi/file_system_operation_runner.cc @@ -16,7 +16,7 @@ #include "webkit/browser/fileapi/file_writer_delegate.h" #include "webkit/common/blob/shareable_file_reference.h" -namespace fileapi { +namespace storage { typedef FileSystemOperationRunner::OperationID OperationID; @@ -238,7 +238,7 @@ OperationID FileSystemOperationRunner::Remove( OperationID FileSystemOperationRunner::Write( const net::URLRequestContext* url_request_context, const FileSystemURL& url, - scoped_ptr<webkit_blob::BlobDataHandle> blob, + scoped_ptr<storage::BlobDataHandle> blob, int64 offset, const WriteCallback& callback) { base::File::Error error = base::File::FILE_OK; @@ -268,10 +268,8 @@ OperationID FileSystemOperationRunner::Write( new FileWriterDelegate(writer.Pass(), flush_policy)); scoped_ptr<net::URLRequest> blob_request( - webkit_blob::BlobProtocolHandler::CreateBlobRequest( - blob.Pass(), - url_request_context, - writer_delegate.get())); + storage::BlobProtocolHandler::CreateBlobRequest( + blob.Pass(), url_request_context, writer_delegate.get())); PrepareForWrite(handle.id, url); operation->Write( @@ -598,7 +596,7 @@ void FileSystemOperationRunner::DidCreateSnapshot( base::File::Error rv, 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 (handle.scope) { finished_operations_.insert(handle.id); base::MessageLoopProxy::current()->PostTask( @@ -686,4 +684,4 @@ void FileSystemOperationRunner::FinishOperation(OperationID id) { } } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_operation_runner.h b/webkit/browser/fileapi/file_system_operation_runner.h index e943f28..5e593c7 100644 --- a/webkit/browser/fileapi/file_system_operation_runner.h +++ b/webkit/browser/fileapi/file_system_operation_runner.h @@ -22,7 +22,7 @@ namespace net { class URLRequestContext; } -namespace fileapi { +namespace storage { class FileSystemURL; class FileSystemContext; @@ -111,7 +111,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner // |url_request_context| is used to read contents in |blob|. OperationID Write(const net::URLRequestContext* url_request_context, const FileSystemURL& url, - scoped_ptr<webkit_blob::BlobDataHandle> blob, + scoped_ptr<storage::BlobDataHandle> blob, int64 offset, const WriteCallback& callback); @@ -279,7 +279,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner base::File::Error rv, 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 OnCopyProgress( const OperationHandle& handle, @@ -317,6 +317,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOperationRunner DISALLOW_COPY_AND_ASSIGN(FileSystemOperationRunner); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPERATION_RUNNER_H_ diff --git a/webkit/browser/fileapi/file_system_options.cc b/webkit/browser/fileapi/file_system_options.cc index bef2f52..c1d6ff2 100644 --- a/webkit/browser/fileapi/file_system_options.cc +++ b/webkit/browser/fileapi/file_system_options.cc @@ -4,7 +4,7 @@ #include "webkit/browser/fileapi/file_system_options.h" -namespace fileapi { +namespace storage { FileSystemOptions::FileSystemOptions( ProfileMode profile_mode, @@ -18,4 +18,4 @@ FileSystemOptions::FileSystemOptions( FileSystemOptions::~FileSystemOptions() { } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_options.h b/webkit/browser/fileapi/file_system_options.h index 25133da..c1ed7bfe 100644 --- a/webkit/browser/fileapi/file_system_options.h +++ b/webkit/browser/fileapi/file_system_options.h @@ -14,7 +14,7 @@ namespace leveldb { class Env; } -namespace fileapi { +namespace storage { // Provides runtime options that may change FileSystem API behavior. // This object is copyable. @@ -57,6 +57,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemOptions { leveldb::Env* env_override_; }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_OPTIONS_H_ diff --git a/webkit/browser/fileapi/file_system_quota_client.cc b/webkit/browser/fileapi/file_system_quota_client.cc index 3dce218..f58a522 100644 --- a/webkit/browser/fileapi/file_system_quota_client.cc +++ b/webkit/browser/fileapi/file_system_quota_client.cc @@ -24,9 +24,9 @@ #include "webkit/browser/fileapi/sandbox_file_system_backend.h" #include "webkit/common/fileapi/file_system_util.h" -using quota::StorageType; +using storage::StorageType; -namespace fileapi { +namespace storage { namespace { @@ -57,25 +57,24 @@ void GetOriginsForHostOnFileTaskRunner( quota_util->GetOriginsForHostOnFileTaskRunner(type, host, origins_ptr); } -void DidGetOrigins( - const quota::QuotaClient::GetOriginsCallback& callback, - std::set<GURL>* origins_ptr) { +void DidGetOrigins(const storage::QuotaClient::GetOriginsCallback& callback, + std::set<GURL>* origins_ptr) { callback.Run(*origins_ptr); } -quota::QuotaStatusCode DeleteOriginOnFileTaskRunner( +storage::QuotaStatusCode DeleteOriginOnFileTaskRunner( FileSystemContext* context, const GURL& origin, FileSystemType type) { FileSystemBackend* provider = context->GetFileSystemBackend(type); if (!provider || !provider->GetQuotaUtil()) - return quota::kQuotaErrorNotSupported; + return storage::kQuotaErrorNotSupported; base::File::Error result = provider->GetQuotaUtil()->DeleteOriginDataOnFileTaskRunner( context, context->quota_manager_proxy(), origin, type); if (result == base::File::FILE_OK) - return quota::kQuotaStatusOk; - return quota::kQuotaErrorInvalidModification; + return storage::kQuotaStatusOk; + return storage::kQuotaErrorInvalidModification; } } // namespace @@ -89,8 +88,8 @@ FileSystemQuotaClient::FileSystemQuotaClient( FileSystemQuotaClient::~FileSystemQuotaClient() {} -quota::QuotaClient::ID FileSystemQuotaClient::id() const { - return quota::QuotaClient::kFileSystem; +storage::QuotaClient::ID FileSystemQuotaClient::id() const { + return storage::QuotaClient::kFileSystem; } void FileSystemQuotaClient::OnQuotaManagerDestroyed() { @@ -197,7 +196,8 @@ void FileSystemQuotaClient::DeleteOriginData( callback); } -bool FileSystemQuotaClient::DoesSupport(quota::StorageType storage_type) const { +bool FileSystemQuotaClient::DoesSupport( + storage::StorageType storage_type) const { FileSystemType type = QuotaStorageTypeToFileSystemType(storage_type); DCHECK(type != kFileSystemTypeUnknown); return file_system_context_->IsSandboxFileSystem(type); @@ -207,4 +207,4 @@ base::SequencedTaskRunner* FileSystemQuotaClient::file_task_runner() const { return file_system_context_->default_file_task_runner(); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_quota_client.h b/webkit/browser/fileapi/file_system_quota_client.h index f3cf68d..c520fc2 100644 --- a/webkit/browser/fileapi/file_system_quota_client.h +++ b/webkit/browser/fileapi/file_system_quota_client.h @@ -22,7 +22,7 @@ namespace base { class SequencedTaskRunner; } -namespace fileapi { +namespace storage { class FileSystemContext; @@ -32,7 +32,7 @@ class FileSystemContext; // All of the public methods of this class are called by the quota manager // (except for the constructor/destructor). class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemQuotaClient - : public NON_EXPORTED_BASE(quota::QuotaClient) { + : public NON_EXPORTED_BASE(storage::QuotaClient) { public: FileSystemQuotaClient( FileSystemContext* file_system_context, @@ -40,23 +40,20 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemQuotaClient virtual ~FileSystemQuotaClient(); // QuotaClient methods. - virtual quota::QuotaClient::ID id() const OVERRIDE; + virtual storage::QuotaClient::ID id() const OVERRIDE; virtual void OnQuotaManagerDestroyed() OVERRIDE; virtual void GetOriginUsage(const GURL& origin_url, - quota::StorageType type, + storage::StorageType type, const GetUsageCallback& callback) OVERRIDE; - virtual void GetOriginsForType( - quota::StorageType type, - const GetOriginsCallback& callback) OVERRIDE; - virtual void GetOriginsForHost( - quota::StorageType type, - const std::string& host, - const GetOriginsCallback& callback) OVERRIDE; - virtual void DeleteOriginData( - const GURL& origin, - quota::StorageType type, - const DeletionCallback& callback) OVERRIDE; - virtual bool DoesSupport(quota::StorageType type) const OVERRIDE; + virtual void GetOriginsForType(storage::StorageType type, + const GetOriginsCallback& callback) OVERRIDE; + virtual void GetOriginsForHost(storage::StorageType type, + const std::string& host, + const GetOriginsCallback& callback) OVERRIDE; + virtual void DeleteOriginData(const GURL& origin, + storage::StorageType type, + const DeletionCallback& callback) OVERRIDE; + virtual bool DoesSupport(storage::StorageType type) const OVERRIDE; private: base::SequencedTaskRunner* file_task_runner() const; @@ -68,6 +65,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemQuotaClient DISALLOW_COPY_AND_ASSIGN(FileSystemQuotaClient); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_CLIENT_H_ diff --git a/webkit/browser/fileapi/file_system_quota_util.h b/webkit/browser/fileapi/file_system_quota_util.h index 7e6badf..cffd70a 100644 --- a/webkit/browser/fileapi/file_system_quota_util.h +++ b/webkit/browser/fileapi/file_system_quota_util.h @@ -19,11 +19,11 @@ namespace base { class SequencedTaskRunner; } -namespace quota { +namespace storage { class QuotaManagerProxy; } -namespace fileapi { +namespace storage { class FileSystemContext; class QuotaReservation; @@ -40,24 +40,22 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemQuotaUtil { // to the quota manager via |proxy|. virtual base::File::Error DeleteOriginDataOnFileTaskRunner( FileSystemContext* context, - quota::QuotaManagerProxy* proxy, + storage::QuotaManagerProxy* proxy, const GURL& origin_url, FileSystemType type) = 0; - virtual void GetOriginsForTypeOnFileTaskRunner( - fileapi::FileSystemType type, - std::set<GURL>* origins) = 0; + virtual void GetOriginsForTypeOnFileTaskRunner(storage::FileSystemType type, + std::set<GURL>* origins) = 0; - virtual void GetOriginsForHostOnFileTaskRunner( - fileapi::FileSystemType type, - const std::string& host, - std::set<GURL>* origins) = 0; + virtual void GetOriginsForHostOnFileTaskRunner(storage::FileSystemType type, + const std::string& host, + std::set<GURL>* origins) = 0; // Returns the amount of data used for the origin for usage tracking. virtual int64 GetOriginUsageOnFileTaskRunner( - fileapi::FileSystemContext* file_system_context, + storage::FileSystemContext* file_system_context, const GURL& origin_url, - fileapi::FileSystemType type) = 0; + storage::FileSystemType type) = 0; // Creates new reservation object for the origin and the type. virtual scoped_refptr<QuotaReservation> @@ -88,6 +86,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemQuotaUtil { FileSystemType type) const = 0; }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_QUOTA_UTIL_H_ diff --git a/webkit/browser/fileapi/file_system_url.cc b/webkit/browser/fileapi/file_system_url.cc index 7e879b3..29b2b3fb 100644 --- a/webkit/browser/fileapi/file_system_url.cc +++ b/webkit/browser/fileapi/file_system_url.cc @@ -12,7 +12,7 @@ #include "webkit/common/fileapi/file_system_types.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { namespace { @@ -150,4 +150,4 @@ bool FileSystemURL::Comparator::operator()(const FileSystemURL& lhs, return lhs.path_ < rhs.path_; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_url.h b/webkit/browser/fileapi/file_system_url.h index ead0762..bf69111 100644 --- a/webkit/browser/fileapi/file_system_url.h +++ b/webkit/browser/fileapi/file_system_url.h @@ -14,7 +14,7 @@ #include "webkit/common/fileapi/file_system_mount_option.h" #include "webkit/common/fileapi/file_system_types.h" -namespace fileapi { +namespace storage { // A class representing a filesystem URL which consists of origin URL, // type and an internal path used inside the filesystem. @@ -175,6 +175,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemURL { typedef std::set<FileSystemURL, FileSystemURL::Comparator> FileSystemURLSet; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_H_ diff --git a/webkit/browser/fileapi/file_system_url_request_job.cc b/webkit/browser/fileapi/file_system_url_request_job.cc index d8f610d..bdfd931 100644 --- a/webkit/browser/fileapi/file_system_url_request_job.cc +++ b/webkit/browser/fileapi/file_system_url_request_job.cc @@ -35,7 +35,7 @@ using net::URLRequest; using net::URLRequestJob; using net::URLRequestStatus; -namespace fileapi { +namespace storage { static net::HttpResponseHeaders* CreateHttpResponseHeaders() { // HttpResponseHeaders expects its input string to be terminated by two NULs. @@ -260,4 +260,4 @@ void FileSystemURLRequestJob::NotifyFailed(int rv) { NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv)); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_url_request_job.h b/webkit/browser/fileapi/file_system_url_request_job.h index 29b42a5..5aad9e7 100644 --- a/webkit/browser/fileapi/file_system_url_request_job.h +++ b/webkit/browser/fileapi/file_system_url_request_job.h @@ -22,11 +22,11 @@ namespace base { class FilePath; } -namespace webkit_blob { +namespace storage { class FileStreamReader; } -namespace fileapi { +namespace storage { class FileSystemContext; // A request job that handles reading filesystem: URLs @@ -69,7 +69,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemURLRequestJob const std::string storage_domain_; FileSystemContext* file_system_context_; - scoped_ptr<webkit_blob::FileStreamReader> reader_; + scoped_ptr<storage::FileStreamReader> reader_; FileSystemURL url_; bool is_directory_; scoped_ptr<net::HttpResponseInfo> response_info_; @@ -80,6 +80,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemURLRequestJob DISALLOW_COPY_AND_ASSIGN(FileSystemURLRequestJob); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_H_ diff --git a/webkit/browser/fileapi/file_system_url_request_job_factory.cc b/webkit/browser/fileapi/file_system_url_request_job_factory.cc index 3add372..6cc3ad0 100644 --- a/webkit/browser/fileapi/file_system_url_request_job_factory.cc +++ b/webkit/browser/fileapi/file_system_url_request_job_factory.cc @@ -12,7 +12,7 @@ #include "webkit/browser/fileapi/file_system_dir_url_request_job.h" #include "webkit/browser/fileapi/file_system_url_request_job.h" -namespace fileapi { +namespace storage { namespace { @@ -70,4 +70,4 @@ net::URLRequestJobFactory::ProtocolHandler* CreateFileSystemProtocolHandler( return new FileSystemProtocolHandler(storage_domain, context); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_url_request_job_factory.h b/webkit/browser/fileapi/file_system_url_request_job_factory.h index bcc55dc..00b1831 100644 --- a/webkit/browser/fileapi/file_system_url_request_job_factory.h +++ b/webkit/browser/fileapi/file_system_url_request_job_factory.h @@ -15,7 +15,7 @@ namespace base { class MessageLoopProxy; } // namespace base -namespace fileapi { +namespace storage { class FileSystemContext; @@ -26,6 +26,6 @@ WEBKIT_STORAGE_BROWSER_EXPORT net::URLRequestJobFactory::ProtocolHandler* CreateFileSystemProtocolHandler(const std::string& storage_domain, FileSystemContext* context); -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_REQUEST_JOB_FACTORY_H_ diff --git a/webkit/browser/fileapi/file_system_usage_cache.cc b/webkit/browser/fileapi/file_system_usage_cache.cc index 89c6db1..fa0f78f 100644 --- a/webkit/browser/fileapi/file_system_usage_cache.cc +++ b/webkit/browser/fileapi/file_system_usage_cache.cc @@ -14,7 +14,7 @@ #include "base/stl_util.h" #include "webkit/browser/fileapi/timed_task_helper.h" -namespace fileapi { +namespace storage { namespace { const int64 kCloseDelaySeconds = 5; @@ -304,4 +304,4 @@ bool FileSystemUsageCache::HasCacheFileHandle(const base::FilePath& file_path) { return ContainsKey(cache_files_, file_path); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_system_usage_cache.h b/webkit/browser/fileapi/file_system_usage_cache.h index d4451e3..0d268a2 100644 --- a/webkit/browser/fileapi/file_system_usage_cache.h +++ b/webkit/browser/fileapi/file_system_usage_cache.h @@ -15,7 +15,7 @@ #include "base/sequenced_task_runner.h" #include "webkit/browser/webkit_storage_browser_export.h" -namespace fileapi { +namespace storage { class TimedTaskHelper; @@ -100,6 +100,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemUsageCache { DISALLOW_COPY_AND_ASSIGN(FileSystemUsageCache); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ diff --git a/webkit/browser/fileapi/file_writer_delegate.cc b/webkit/browser/fileapi/file_writer_delegate.cc index 3c88fd2..976debe 100644 --- a/webkit/browser/fileapi/file_writer_delegate.cc +++ b/webkit/browser/fileapi/file_writer_delegate.cc @@ -16,7 +16,7 @@ #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { static const int kReadBufSize = 32768; @@ -241,4 +241,4 @@ void FileWriterDelegate::OnFlushed(base::File::Error error, write_callback_.Run(error, bytes_written, progress_status); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/file_writer_delegate.h b/webkit/browser/fileapi/file_writer_delegate.h index e9f3413..2544c5c 100644 --- a/webkit/browser/fileapi/file_writer_delegate.h +++ b/webkit/browser/fileapi/file_writer_delegate.h @@ -15,7 +15,7 @@ #include "net/url_request/url_request.h" #include "webkit/browser/webkit_storage_browser_export.h" -namespace fileapi { +namespace storage { class FileStreamWriter; @@ -105,6 +105,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileWriterDelegate DISALLOW_COPY_AND_ASSIGN(FileWriterDelegate); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_FILE_WRITER_DELEGATE_H_ diff --git a/webkit/browser/fileapi/isolated_context.cc b/webkit/browser/fileapi/isolated_context.cc index a187a05..147e588 100644 --- a/webkit/browser/fileapi/isolated_context.cc +++ b/webkit/browser/fileapi/isolated_context.cc @@ -14,7 +14,7 @@ #include "base/strings/stringprintf.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace fileapi { +namespace storage { namespace { @@ -481,4 +481,4 @@ std::string IsolatedContext::GetNewFileSystemId() const { return id; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/isolated_context.h b/webkit/browser/fileapi/isolated_context.h index 213082d..5cc141f 100644 --- a/webkit/browser/fileapi/isolated_context.h +++ b/webkit/browser/fileapi/isolated_context.h @@ -19,11 +19,11 @@ #include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/fileapi/file_system_types.h" -namespace fileapi { +namespace storage { class FileSystemURL; } -namespace fileapi { +namespace storage { // Manages isolated filesystem mount points which have no well-known names // and are identified by a string 'filesystem ID', which usually just looks @@ -196,6 +196,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT IsolatedContext : public MountPoints { DISALLOW_COPY_AND_ASSIGN(IsolatedContext); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_ISOLATED_CONTEXT_H_ diff --git a/webkit/browser/fileapi/isolated_file_system_backend.cc b/webkit/browser/fileapi/isolated_file_system_backend.cc index b31c1f9..b2aee2b 100644 --- a/webkit/browser/fileapi/isolated_file_system_backend.cc +++ b/webkit/browser/fileapi/isolated_file_system_backend.cc @@ -26,7 +26,7 @@ #include "webkit/common/fileapi/file_system_types.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { IsolatedFileSystemBackend::IsolatedFileSystemBackend() : isolated_file_util_(new AsyncFileUtilAdapter(new LocalFileUtil())), @@ -101,27 +101,29 @@ FileSystemOperation* IsolatedFileSystemBackend::CreateFileSystemOperation( } bool IsolatedFileSystemBackend::SupportsStreaming( - const fileapi::FileSystemURL& url) const { + const storage::FileSystemURL& url) const { return false; } bool IsolatedFileSystemBackend::HasInplaceCopyImplementation( - fileapi::FileSystemType type) const { + storage::FileSystemType type) const { DCHECK(type == kFileSystemTypeNativeLocal || type == kFileSystemTypeDragged || type == kFileSystemTypeForTransientFile); return false; } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> IsolatedFileSystemBackend::CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, FileSystemContext* context) const { - 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<FileStreamWriter> IsolatedFileSystemBackend::CreateFileStreamWriter( @@ -141,4 +143,4 @@ FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { return NULL; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/isolated_file_system_backend.h b/webkit/browser/fileapi/isolated_file_system_backend.h index 4d67269..a64b0b7 100644 --- a/webkit/browser/fileapi/isolated_file_system_backend.h +++ b/webkit/browser/fileapi/isolated_file_system_backend.h @@ -8,7 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "webkit/browser/fileapi/file_system_backend.h" -namespace fileapi { +namespace storage { class AsyncFileUtilAdapter; @@ -33,8 +33,8 @@ class IsolatedFileSystemBackend : public FileSystemBackend { base::File::Error* error_code) const OVERRIDE; virtual bool SupportsStreaming(const FileSystemURL& url) const OVERRIDE; virtual bool HasInplaceCopyImplementation( - fileapi::FileSystemType type) const OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( + storage::FileSystemType type) const OVERRIDE; + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, @@ -51,6 +51,6 @@ class IsolatedFileSystemBackend : public FileSystemBackend { scoped_ptr<AsyncFileUtilAdapter> transient_file_util_; }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_ISOLATED_FILE_SYSTEM_BACKEND_H_ diff --git a/webkit/browser/fileapi/local_file_stream_writer.cc b/webkit/browser/fileapi/local_file_stream_writer.cc index 508cc50..6f58ffa 100644 --- a/webkit/browser/fileapi/local_file_stream_writer.cc +++ b/webkit/browser/fileapi/local_file_stream_writer.cc @@ -10,7 +10,7 @@ #include "net/base/io_buffer.h" #include "net/base/net_errors.h" -namespace fileapi { +namespace storage { namespace { @@ -254,4 +254,4 @@ bool LocalFileStreamWriter::CancelIfRequested() { return true; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/local_file_stream_writer.h b/webkit/browser/fileapi/local_file_stream_writer.h index 47bea5d..dc98824 100644 --- a/webkit/browser/fileapi/local_file_stream_writer.h +++ b/webkit/browser/fileapi/local_file_stream_writer.h @@ -25,7 +25,7 @@ namespace net { class FileStream; } -namespace fileapi { +namespace storage { // This class is a thin wrapper around net::FileStream for writing local files. class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileStreamWriter @@ -95,6 +95,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileStreamWriter DISALLOW_COPY_AND_ASSIGN(LocalFileStreamWriter); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_ diff --git a/webkit/browser/fileapi/local_file_util.cc b/webkit/browser/fileapi/local_file_util.cc index 3b823aa..fff13b5 100644 --- a/webkit/browser/fileapi/local_file_util.cc +++ b/webkit/browser/fileapi/local_file_util.cc @@ -16,7 +16,7 @@ #include "webkit/common/fileapi/file_system_types.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { AsyncFileUtil* AsyncFileUtil::CreateForLocalFileSystem() { return new AsyncFileUtilAdapter(new LocalFileUtil()); @@ -202,8 +202,10 @@ base::File::Error LocalFileUtil::CopyOrMoveFile( return error; return NativeFileUtil::CopyOrMoveFile( - src_file_path, dest_file_path, option, - fileapi::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, copy)); + src_file_path, + dest_file_path, + option, + storage::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, copy)); } base::File::Error LocalFileUtil::CopyInForeignFile( @@ -219,8 +221,10 @@ base::File::Error LocalFileUtil::CopyInForeignFile( if (error != base::File::FILE_OK) return error; return NativeFileUtil::CopyOrMoveFile( - src_file_path, dest_file_path, FileSystemOperation::OPTION_NONE, - fileapi::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, + src_file_path, + dest_file_path, + FileSystemOperation::OPTION_NONE, + storage::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, true /* copy */)); } @@ -244,7 +248,7 @@ base::File::Error LocalFileUtil::DeleteDirectory( return NativeFileUtil::DeleteDirectory(file_path); } -webkit_blob::ScopedFile LocalFileUtil::CreateSnapshotFile( +storage::ScopedFile LocalFileUtil::CreateSnapshotFile( FileSystemOperationContext* context, const FileSystemURL& url, base::File::Error* error, @@ -255,7 +259,7 @@ webkit_blob::ScopedFile LocalFileUtil::CreateSnapshotFile( *error = GetFileInfo(context, url, file_info, platform_path); if (*error == base::File::FILE_OK && file_info->is_directory) *error = base::File::FILE_ERROR_NOT_A_FILE; - return webkit_blob::ScopedFile(); + return storage::ScopedFile(); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/local_file_util.h b/webkit/browser/fileapi/local_file_util.h index 18199ad..b22d225 100644 --- a/webkit/browser/fileapi/local_file_util.h +++ b/webkit/browser/fileapi/local_file_util.h @@ -17,7 +17,7 @@ class Time; class GURL; -namespace fileapi { +namespace storage { class FileSystemOperationContext; class FileSystemURL; @@ -78,7 +78,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileUtil virtual base::File::Error DeleteDirectory( FileSystemOperationContext* context, const FileSystemURL& url) OVERRIDE; - virtual webkit_blob::ScopedFile CreateSnapshotFile( + virtual storage::ScopedFile CreateSnapshotFile( FileSystemOperationContext* context, const FileSystemURL& url, base::File::Error* error, @@ -89,6 +89,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileUtil DISALLOW_COPY_AND_ASSIGN(LocalFileUtil); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_LOCAL_FILE_UTIL_H_ diff --git a/webkit/browser/fileapi/mount_points.cc b/webkit/browser/fileapi/mount_points.cc index cd7c7b2..9523071 100644 --- a/webkit/browser/fileapi/mount_points.cc +++ b/webkit/browser/fileapi/mount_points.cc @@ -4,12 +4,11 @@ #include "webkit/browser/fileapi/mount_points.h" -namespace fileapi { +namespace storage { MountPoints::MountPointInfo::MountPointInfo() {} MountPoints::MountPointInfo::MountPointInfo( const std::string& name, const base::FilePath& path) : name(name), path(path) {} -} // namespace fileapi - +} // namespace storage diff --git a/webkit/browser/fileapi/mount_points.h b/webkit/browser/fileapi/mount_points.h index d206ab9..6548998 100644 --- a/webkit/browser/fileapi/mount_points.h +++ b/webkit/browser/fileapi/mount_points.h @@ -15,12 +15,12 @@ class GURL; -namespace fileapi { +namespace storage { class FileSystemMountOption; class FileSystemURL; } -namespace fileapi { +namespace storage { // Represents a set of mount points for File API. class WEBKIT_STORAGE_BROWSER_EXPORT MountPoints { @@ -65,7 +65,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT MountPoints { // registered in this context, returns empty, invalid FileSystemURL. virtual FileSystemURL CreateCrackedFileSystemURL( const GURL& origin, - fileapi::FileSystemType type, + storage::FileSystemType type, const base::FilePath& path) const = 0; // Returns the mount point root path registered for a given |mount_name|. @@ -103,6 +103,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT MountPoints { DISALLOW_COPY_AND_ASSIGN(MountPoints); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_MOUNT_POINTS_H_ diff --git a/webkit/browser/fileapi/native_file_util.cc b/webkit/browser/fileapi/native_file_util.cc index c022994..2fa3ef9 100644 --- a/webkit/browser/fileapi/native_file_util.cc +++ b/webkit/browser/fileapi/native_file_util.cc @@ -11,7 +11,7 @@ #include "webkit/browser/fileapi/file_system_operation_context.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace fileapi { +namespace storage { namespace { @@ -312,4 +312,4 @@ base::File::Error NativeFileUtil::DeleteDirectory(const base::FilePath& path) { return base::File::FILE_OK; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/native_file_util.h b/webkit/browser/fileapi/native_file_util.h index bd87581..7edb21e 100644 --- a/webkit/browser/fileapi/native_file_util.h +++ b/webkit/browser/fileapi/native_file_util.h @@ -16,7 +16,7 @@ namespace base { class Time; } -namespace fileapi { +namespace storage { // A thin wrapper class for accessing the OS native filesystem. // This performs common error checks necessary to implement FileUtil family @@ -68,6 +68,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE NativeFileUtil { DISALLOW_IMPLICIT_CONSTRUCTORS(NativeFileUtil); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_NATIVE_FILE_UTIL_H_ diff --git a/webkit/browser/fileapi/obfuscated_file_util.cc b/webkit/browser/fileapi/obfuscated_file_util.cc index 73722d4..da58125 100644 --- a/webkit/browser/fileapi/obfuscated_file_util.cc +++ b/webkit/browser/fileapi/obfuscated_file_util.cc @@ -43,7 +43,7 @@ // file_util::DoAnother(local_path); // } -namespace fileapi { +namespace storage { namespace { @@ -73,7 +73,7 @@ int64 UsageForPath(size_t length) { } bool AllocateQuota(FileSystemOperationContext* context, int64 growth) { - if (context->allowed_bytes_growth() == quota::QuotaManager::kNoLimit) + if (context->allowed_bytes_growth() == storage::QuotaManager::kNoLimit) return true; int64 new_quota = context->allowed_bytes_growth() - growth; @@ -227,7 +227,7 @@ class ObfuscatedOriginEnumerator origins_.pop_back(); } current_ = record; - return webkit_database::GetOriginFromIdentifier(record.origin); + return storage::GetOriginFromIdentifier(record.origin); } // Returns the current origin's information. @@ -250,7 +250,7 @@ class ObfuscatedOriginEnumerator }; ObfuscatedFileUtil::ObfuscatedFileUtil( - quota::SpecialStoragePolicy* special_storage_policy, + storage::SpecialStoragePolicy* special_storage_policy, const base::FilePath& file_system_directory, leveldb::Env* env_override, base::SequencedTaskRunner* file_task_runner, @@ -276,7 +276,7 @@ base::File ObfuscatedFileUtil::CreateOrOpen( const FileSystemURL& url, int file_flags) { base::File file = CreateOrOpenInternal(context, url, file_flags); if (file.IsValid() && file_flags & base::File::FLAG_WRITE && - context->quota_limit_type() == quota::kQuotaLimitTypeUnlimited && + context->quota_limit_type() == storage::kQuotaLimitTypeUnlimited && sandbox_delegate_) { sandbox_delegate_->StickyInvalidateUsageCache(url.origin(), url.type()); } @@ -579,7 +579,7 @@ base::File::Error ObfuscatedFileUtil::CopyOrMoveFile( src_local_path, dest_local_path, option, - fileapi::NativeFileUtil::CopyOrMoveModeForDestination( + storage::NativeFileUtil::CopyOrMoveModeForDestination( dest_url, true /* copy */)); } else { // non-overwrite error = CreateFile(context, src_local_path, dest_url, &dest_file_info); @@ -682,9 +682,10 @@ base::File::Error ObfuscatedFileUtil::CopyInForeignFile( base::FilePath dest_local_path = DataPathToLocalPath(dest_url, dest_file_info.data_path); error = NativeFileUtil::CopyOrMoveFile( - src_file_path, dest_local_path, + src_file_path, + dest_local_path, FileSystemOperation::OPTION_NONE, - fileapi::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, + storage::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, true /* copy */)); } else { error = CreateFile(context, src_file_path, dest_url, &dest_file_info); @@ -777,7 +778,7 @@ base::File::Error ObfuscatedFileUtil::DeleteDirectory( return base::File::FILE_OK; } -webkit_blob::ScopedFile ObfuscatedFileUtil::CreateSnapshotFile( +storage::ScopedFile ObfuscatedFileUtil::CreateSnapshotFile( FileSystemOperationContext* context, const FileSystemURL& url, base::File::Error* error, @@ -789,7 +790,7 @@ webkit_blob::ScopedFile ObfuscatedFileUtil::CreateSnapshotFile( *file_info = base::File::Info(); *error = base::File::FILE_ERROR_NOT_A_FILE; } - return webkit_blob::ScopedFile(); + return storage::ScopedFile(); } scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> @@ -897,7 +898,7 @@ bool ObfuscatedFileUtil::DeleteDirectoryForOriginAndType( InitOriginDatabase(origin, false); if (origin_database_) { origin_database_->RemovePathForOrigin( - webkit_database::GetIdentifierFromOrigin(origin)); + storage::GetIdentifierFromOrigin(origin)); } if (!base::DeleteFile(origin_path, true /* recursive */)) return false; @@ -947,7 +948,7 @@ void ObfuscatedFileUtil::MaybePrepopulateDatabase( std::string origin_string = database.GetPrimaryOrigin(); if (origin_string.empty() || !database.HasOriginPath(origin_string)) return; - const GURL origin = webkit_database::GetOriginFromIdentifier(origin_string); + const GURL origin = storage::GetOriginFromIdentifier(origin_string); // Prepopulate the directory database(s) if and only if this instance // has primary origin and the directory database is already there. @@ -1099,9 +1100,10 @@ base::File::Error ObfuscatedFileUtil::CreateFile( error = NativeFileUtil::EnsureFileExists(dest_local_path, &created); } else { error = NativeFileUtil::CopyOrMoveFile( - src_file_path, dest_local_path, + src_file_path, + dest_local_path, FileSystemOperation::OPTION_NONE, - fileapi::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, + storage::NativeFileUtil::CopyOrMoveModeForDestination(dest_url, true /* copy */)); created = true; } @@ -1148,8 +1150,7 @@ std::string ObfuscatedFileUtil::GetDirectoryDatabaseKey( return std::string(); } // For isolated origin we just use a type string as a key. - return webkit_database::GetIdentifierFromOrigin(origin) + - type_string; + return storage::GetIdentifierFromOrigin(origin) + type_string; } // TODO(ericu): How to do the whole validation-without-creation thing? @@ -1194,7 +1195,7 @@ base::FilePath ObfuscatedFileUtil::GetDirectoryForOrigin( return base::FilePath(); } base::FilePath directory_name; - std::string id = webkit_database::GetIdentifierFromOrigin(origin); + std::string id = storage::GetIdentifierFromOrigin(origin); bool exists_in_db = origin_database_->HasOriginPath(id); if (!exists_in_db && !create) { @@ -1287,7 +1288,7 @@ bool ObfuscatedFileUtil::InitOriginDatabase(const GURL& origin_hint, return true; const std::string isolated_origin_string = - webkit_database::GetIdentifierFromOrigin(origin_hint); + storage::GetIdentifierFromOrigin(origin_hint); // TODO(kinuko): Deprecate this after a few release cycles, e.g. around M33. base::FilePath isolated_origin_dir = file_system_directory_.Append( @@ -1420,4 +1421,4 @@ bool ObfuscatedFileUtil::HasIsolatedStorage(const GURL& origin) { special_storage_policy_->HasIsolatedStorage(origin); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/obfuscated_file_util.h b/webkit/browser/fileapi/obfuscated_file_util.h index ada4e6f..1b2b58b 100644 --- a/webkit/browser/fileapi/obfuscated_file_util.h +++ b/webkit/browser/fileapi/obfuscated_file_util.h @@ -34,13 +34,13 @@ class ObfuscatedFileUtilTest; class QuotaBackendImplTest; } -namespace quota { +namespace storage { class SpecialStoragePolicy; } class GURL; -namespace fileapi { +namespace storage { class FileSystemOperationContext; class SandboxOriginDatabaseInterface; @@ -101,14 +101,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE ObfuscatedFileUtil // for any known type exists the origin directory may get deleted when // one origin/type pair is deleted. // - ObfuscatedFileUtil( - quota::SpecialStoragePolicy* special_storage_policy, - const base::FilePath& file_system_directory, - leveldb::Env* env_override, - base::SequencedTaskRunner* file_task_runner, - const GetTypeStringForURLCallback& get_type_string_for_url, - const std::set<std::string>& known_type_strings, - SandboxFileSystemBackendDelegate* sandbox_delegate); + ObfuscatedFileUtil(storage::SpecialStoragePolicy* special_storage_policy, + const base::FilePath& file_system_directory, + leveldb::Env* env_override, + base::SequencedTaskRunner* file_task_runner, + const GetTypeStringForURLCallback& get_type_string_for_url, + const std::set<std::string>& known_type_strings, + SandboxFileSystemBackendDelegate* sandbox_delegate); virtual ~ObfuscatedFileUtil(); // FileSystemFileUtil overrides. @@ -161,7 +160,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE ObfuscatedFileUtil virtual base::File::Error DeleteDirectory( FileSystemOperationContext* context, const FileSystemURL& url) OVERRIDE; - virtual webkit_blob::ScopedFile CreateSnapshotFile( + virtual storage::ScopedFile CreateSnapshotFile( FileSystemOperationContext* context, const FileSystemURL& url, base::File::Error* error, @@ -237,7 +236,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE ObfuscatedFileUtil // (temporary, persistent) file systems. Used only for testing. // Note: this is implemented in sandbox_file_system_backend_delegate.cc. static ObfuscatedFileUtil* CreateForTesting( - quota::SpecialStoragePolicy* special_storage_policy, + storage::SpecialStoragePolicy* special_storage_policy, const base::FilePath& file_system_directory, leveldb::Env* env_override, base::SequencedTaskRunner* file_task_runner); @@ -336,7 +335,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE ObfuscatedFileUtil typedef std::map<std::string, SandboxDirectoryDatabase*> DirectoryMap; DirectoryMap directories_; scoped_ptr<SandboxOriginDatabaseInterface> origin_database_; - scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; + scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; base::FilePath file_system_directory_; leveldb::Env* env_override_; @@ -355,6 +354,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE ObfuscatedFileUtil DISALLOW_COPY_AND_ASSIGN(ObfuscatedFileUtil); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_OBFUSCATED_FILE_UTIL_H_ diff --git a/webkit/browser/fileapi/open_file_system_mode.h b/webkit/browser/fileapi/open_file_system_mode.h index 72a2bcb..3bc352f 100644 --- a/webkit/browser/fileapi/open_file_system_mode.h +++ b/webkit/browser/fileapi/open_file_system_mode.h @@ -5,7 +5,7 @@ #ifndef WEBKIT_BROWSER_FILEAPI_OPEN_FILE_SYSTEM_MODE_H_ #define WEBKIT_BROWSER_FILEAPI_OPEN_FILE_SYSTEM_MODE_H_ -namespace fileapi { +namespace storage { // Determines the behavior on OpenFileSystem when a specified // FileSystem does not exist. @@ -17,6 +17,6 @@ enum OpenFileSystemMode { OPEN_FILE_SYSTEM_FAIL_IF_NONEXISTENT, }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_OPEN_FILE_SYSTEM_MODE_H_ diff --git a/webkit/browser/fileapi/plugin_private_file_system_backend.cc b/webkit/browser/fileapi/plugin_private_file_system_backend.cc index ce5e614..7beb1b7 100644 --- a/webkit/browser/fileapi/plugin_private_file_system_backend.cc +++ b/webkit/browser/fileapi/plugin_private_file_system_backend.cc @@ -22,7 +22,7 @@ #include "webkit/browser/fileapi/quota/quota_reservation.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { class PluginPrivateFileSystemBackend::FileSystemIDToPluginMap { public: @@ -87,12 +87,12 @@ base::File::Error OpenFileSystemOnFileTaskRunner( PluginPrivateFileSystemBackend::PluginPrivateFileSystemBackend( base::SequencedTaskRunner* file_task_runner, const base::FilePath& profile_path, - quota::SpecialStoragePolicy* special_storage_policy, + storage::SpecialStoragePolicy* special_storage_policy, const FileSystemOptions& file_system_options) : file_task_runner_(file_task_runner), file_system_options_(file_system_options), - base_path_(profile_path.Append( - kFileSystemDirectory).Append(kPluginPrivateDirectory)), + base_path_(profile_path.Append(kFileSystemDirectory) + .Append(kPluginPrivateDirectory)), plugin_map_(new FileSystemIDToPluginMap(file_task_runner)), weak_factory_(this) { file_util_.reset( @@ -179,22 +179,22 @@ FileSystemOperation* PluginPrivateFileSystemBackend::CreateFileSystemOperation( } bool PluginPrivateFileSystemBackend::SupportsStreaming( - const fileapi::FileSystemURL& url) const { + const storage::FileSystemURL& url) const { return false; } bool PluginPrivateFileSystemBackend::HasInplaceCopyImplementation( - fileapi::FileSystemType type) const { + storage::FileSystemType type) const { return false; } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> PluginPrivateFileSystemBackend::CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, FileSystemContext* context) const { - return scoped_ptr<webkit_blob::FileStreamReader>(); + return scoped_ptr<storage::FileStreamReader>(); } scoped_ptr<FileStreamWriter> @@ -212,7 +212,7 @@ FileSystemQuotaUtil* PluginPrivateFileSystemBackend::GetQuotaUtil() { base::File::Error PluginPrivateFileSystemBackend::DeleteOriginDataOnFileTaskRunner( FileSystemContext* context, - quota::QuotaManagerProxy* proxy, + storage::QuotaManagerProxy* proxy, const GURL& origin_url, FileSystemType type) { if (!CanHandleType(type)) @@ -303,4 +303,4 @@ ObfuscatedFileUtil* PluginPrivateFileSystemBackend::obfuscated_file_util() { static_cast<AsyncFileUtilAdapter*>(file_util_.get())->sync_file_util()); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/plugin_private_file_system_backend.h b/webkit/browser/fileapi/plugin_private_file_system_backend.h index 73f8731..1288928 100644 --- a/webkit/browser/fileapi/plugin_private_file_system_backend.h +++ b/webkit/browser/fileapi/plugin_private_file_system_backend.h @@ -22,11 +22,11 @@ namespace content { class PluginPrivateFileSystemBackendTest; } -namespace quota { +namespace storage { class SpecialStoragePolicy; } -namespace fileapi { +namespace storage { class ObfuscatedFileUtil; @@ -40,7 +40,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT PluginPrivateFileSystemBackend PluginPrivateFileSystemBackend( base::SequencedTaskRunner* file_task_runner, const base::FilePath& profile_path, - quota::SpecialStoragePolicy* special_storage_policy, + storage::SpecialStoragePolicy* special_storage_policy, const FileSystemOptions& file_system_options); virtual ~PluginPrivateFileSystemBackend(); @@ -74,8 +74,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT PluginPrivateFileSystemBackend base::File::Error* error_code) const OVERRIDE; virtual bool SupportsStreaming(const FileSystemURL& url) const OVERRIDE; virtual bool HasInplaceCopyImplementation( - fileapi::FileSystemType type) const OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( + storage::FileSystemType type) const OVERRIDE; + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, @@ -89,7 +89,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT PluginPrivateFileSystemBackend // FileSystemQuotaUtil overrides. virtual base::File::Error DeleteOriginDataOnFileTaskRunner( FileSystemContext* context, - quota::QuotaManagerProxy* proxy, + storage::QuotaManagerProxy* proxy, const GURL& origin_url, FileSystemType type) OVERRIDE; virtual void GetOriginsForTypeOnFileTaskRunner( @@ -142,6 +142,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT PluginPrivateFileSystemBackend DISALLOW_COPY_AND_ASSIGN(PluginPrivateFileSystemBackend); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_PLUGIN_PRIVATE_FILE_SYSTEM_BACKEND_H_ diff --git a/webkit/browser/fileapi/quota/open_file_handle.cc b/webkit/browser/fileapi/quota/open_file_handle.cc index 27f50b1..b8c0b29 100644 --- a/webkit/browser/fileapi/quota/open_file_handle.cc +++ b/webkit/browser/fileapi/quota/open_file_handle.cc @@ -7,7 +7,7 @@ #include "webkit/browser/fileapi/quota/open_file_handle_context.h" #include "webkit/browser/fileapi/quota/quota_reservation.h" -namespace fileapi { +namespace storage { OpenFileHandle::~OpenFileHandle() { DCHECK(sequence_checker_.CalledOnValidSequencedThread()); @@ -52,4 +52,4 @@ OpenFileHandle::OpenFileHandle(QuotaReservation* reservation, DCHECK(sequence_checker_.CalledOnValidSequencedThread()); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/quota/open_file_handle.h b/webkit/browser/fileapi/quota/open_file_handle.h index 2bd7e93..1f25b96 100644 --- a/webkit/browser/fileapi/quota/open_file_handle.h +++ b/webkit/browser/fileapi/quota/open_file_handle.h @@ -14,7 +14,7 @@ namespace base { class FilePath; } -namespace fileapi { +namespace storage { class QuotaReservation; class OpenFileHandleContext; @@ -65,6 +65,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT OpenFileHandle { DISALLOW_COPY_AND_ASSIGN(OpenFileHandle); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_QUOTA_OPEN_FILE_HANDLE_H_ diff --git a/webkit/browser/fileapi/quota/open_file_handle_context.cc b/webkit/browser/fileapi/quota/open_file_handle_context.cc index 57e284f..33f5bab 100644 --- a/webkit/browser/fileapi/quota/open_file_handle_context.cc +++ b/webkit/browser/fileapi/quota/open_file_handle_context.cc @@ -7,7 +7,7 @@ #include "base/file_util.h" #include "webkit/browser/fileapi/quota/quota_reservation_buffer.h" -namespace fileapi { +namespace storage { OpenFileHandleContext::OpenFileHandleContext( const base::FilePath& platform_path, @@ -69,4 +69,4 @@ OpenFileHandleContext::~OpenFileHandleContext() { reservation_buffer_->DetachOpenFileHandleContext(this); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/quota/open_file_handle_context.h b/webkit/browser/fileapi/quota/open_file_handle_context.h index 5b0cbcb9c..b93bf14 100644 --- a/webkit/browser/fileapi/quota/open_file_handle_context.h +++ b/webkit/browser/fileapi/quota/open_file_handle_context.h @@ -15,7 +15,7 @@ #include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/fileapi/file_system_types.h" -namespace fileapi { +namespace storage { class QuotaReservationBuffer; @@ -56,6 +56,6 @@ class OpenFileHandleContext : public base::RefCounted<OpenFileHandleContext> { DISALLOW_COPY_AND_ASSIGN(OpenFileHandleContext); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_OPEN_FILE_HANDLE_CONTEXT_H_ diff --git a/webkit/browser/fileapi/quota/quota_backend_impl.cc b/webkit/browser/fileapi/quota/quota_backend_impl.cc index de0b3ac..fe2e11d 100644 --- a/webkit/browser/fileapi/quota/quota_backend_impl.cc +++ b/webkit/browser/fileapi/quota/quota_backend_impl.cc @@ -16,13 +16,13 @@ #include "webkit/browser/quota/quota_manager_proxy.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { QuotaBackendImpl::QuotaBackendImpl( base::SequencedTaskRunner* file_task_runner, ObfuscatedFileUtil* obfuscated_file_util, FileSystemUsageCache* file_system_usage_cache, - quota::QuotaManagerProxy* quota_manager_proxy) + storage::QuotaManagerProxy* quota_manager_proxy) : file_task_runner_(file_task_runner), obfuscated_file_util_(obfuscated_file_util), file_system_usage_cache_(file_system_usage_cache), @@ -102,12 +102,14 @@ void QuotaBackendImpl::DecrementDirtyCount(const GURL& origin, void QuotaBackendImpl::DidGetUsageAndQuotaForReserveQuota( const QuotaReservationInfo& info, const ReserveQuotaCallback& callback, - quota::QuotaStatusCode status, int64 usage, int64 quota) { + storage::QuotaStatusCode status, + int64 usage, + int64 quota) { DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); DCHECK(info.origin.is_valid()); DCHECK_LE(0, usage); DCHECK_LE(0, quota); - if (status != quota::kQuotaStatusOk) { + if (status != storage::kQuotaStatusOk) { callback.Run(base::File::FILE_ERROR_FAILED, 0); return; } @@ -136,8 +138,10 @@ void QuotaBackendImpl::ReserveQuotaInternal(const QuotaReservationInfo& info) { DCHECK(info.origin.is_valid()); DCHECK(quota_manager_proxy_); quota_manager_proxy_->NotifyStorageModified( - quota::QuotaClient::kFileSystem, info.origin, - FileSystemTypeToQuotaStorageType(info.type), info.delta); + storage::QuotaClient::kFileSystem, + info.origin, + FileSystemTypeToQuotaStorageType(info.type), + info.delta); } base::File::Error QuotaBackendImpl::GetUsageCachePath( @@ -162,4 +166,4 @@ QuotaBackendImpl::QuotaReservationInfo::QuotaReservationInfo( QuotaBackendImpl::QuotaReservationInfo::~QuotaReservationInfo() { } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/quota/quota_backend_impl.h b/webkit/browser/fileapi/quota/quota_backend_impl.h index ec4c45a..98c36a0 100644 --- a/webkit/browser/fileapi/quota/quota_backend_impl.h +++ b/webkit/browser/fileapi/quota/quota_backend_impl.h @@ -20,11 +20,11 @@ namespace content { class QuotaBackendImplTest; } -namespace quota { +namespace storage { class QuotaManagerProxy; } -namespace fileapi { +namespace storage { class FileSystemUsageCache; class ObfuscatedFileUtil; @@ -39,7 +39,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaBackendImpl QuotaBackendImpl(base::SequencedTaskRunner* file_task_runner, ObfuscatedFileUtil* obfuscated_file_util, FileSystemUsageCache* file_system_usage_cache, - quota::QuotaManagerProxy* quota_manager_proxy); + storage::QuotaManagerProxy* quota_manager_proxy); virtual ~QuotaBackendImpl(); // QuotaReservationManager::QuotaBackend overrides. @@ -75,12 +75,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaBackendImpl int64 delta; }; - void DidGetUsageAndQuotaForReserveQuota( - const QuotaReservationInfo& info, - const ReserveQuotaCallback& callback, - quota::QuotaStatusCode status, - int64 usage, - int64 quota); + void DidGetUsageAndQuotaForReserveQuota(const QuotaReservationInfo& info, + const ReserveQuotaCallback& callback, + storage::QuotaStatusCode status, + int64 usage, + int64 quota); void ReserveQuotaInternal( const QuotaReservationInfo& info); @@ -95,13 +94,13 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaBackendImpl ObfuscatedFileUtil* obfuscated_file_util_; FileSystemUsageCache* file_system_usage_cache_; - scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; + scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; base::WeakPtrFactory<QuotaBackendImpl> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(QuotaBackendImpl); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_QUOTA_QUOTA_BACKEND_IMPL_H_ diff --git a/webkit/browser/fileapi/quota/quota_reservation.cc b/webkit/browser/fileapi/quota/quota_reservation.cc index f199b35..5139d0b 100644 --- a/webkit/browser/fileapi/quota/quota_reservation.cc +++ b/webkit/browser/fileapi/quota/quota_reservation.cc @@ -8,7 +8,7 @@ #include "webkit/browser/fileapi/quota/open_file_handle.h" #include "webkit/browser/fileapi/quota/quota_reservation_buffer.h" -namespace fileapi { +namespace storage { void QuotaReservation::RefreshReservation( int64 size, @@ -124,4 +124,4 @@ bool QuotaReservation::DidUpdateReservedQuota( return true; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/quota/quota_reservation.h b/webkit/browser/fileapi/quota/quota_reservation.h index 9233a24..be107d6 100644 --- a/webkit/browser/fileapi/quota/quota_reservation.h +++ b/webkit/browser/fileapi/quota/quota_reservation.h @@ -16,7 +16,7 @@ class GURL; -namespace fileapi { +namespace storage { class QuotaReservationBuffer; class OpenFileHandle; @@ -90,6 +90,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaReservation DISALLOW_COPY_AND_ASSIGN(QuotaReservation); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_QUOTA_QUOTA_RESERVATION_H_ diff --git a/webkit/browser/fileapi/quota/quota_reservation_buffer.cc b/webkit/browser/fileapi/quota/quota_reservation_buffer.cc index 9e44319..cfa567f 100644 --- a/webkit/browser/fileapi/quota/quota_reservation_buffer.cc +++ b/webkit/browser/fileapi/quota/quota_reservation_buffer.cc @@ -9,7 +9,7 @@ #include "webkit/browser/fileapi/quota/open_file_handle_context.h" #include "webkit/browser/fileapi/quota/quota_reservation.h" -namespace fileapi { +namespace storage { QuotaReservationBuffer::QuotaReservationBuffer( base::WeakPtr<QuotaReservationManager> reservation_manager, @@ -102,5 +102,4 @@ bool QuotaReservationBuffer::DecrementDirtyCount( return false; } - -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/quota/quota_reservation_buffer.h b/webkit/browser/fileapi/quota/quota_reservation_buffer.h index 0d87a99..967e1b9 100644 --- a/webkit/browser/fileapi/quota/quota_reservation_buffer.h +++ b/webkit/browser/fileapi/quota/quota_reservation_buffer.h @@ -16,7 +16,7 @@ #include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/fileapi/file_system_types.h" -namespace fileapi { +namespace storage { class QuotaReservation; class OpenFileHandle; @@ -73,7 +73,7 @@ class QuotaReservationBuffer : public base::RefCounted<QuotaReservationBuffer> { base::WeakPtr<QuotaReservationManager> reservation_manager_; GURL origin_; - fileapi::FileSystemType type_; + storage::FileSystemType type_; int64 reserved_quota_; @@ -82,6 +82,6 @@ class QuotaReservationBuffer : public base::RefCounted<QuotaReservationBuffer> { DISALLOW_COPY_AND_ASSIGN(QuotaReservationBuffer); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_QUOTA_QUOTA_RESERVATION_BUFFER_H_ diff --git a/webkit/browser/fileapi/quota/quota_reservation_manager.cc b/webkit/browser/fileapi/quota/quota_reservation_manager.cc index efb54b2..6ab2c26 100644 --- a/webkit/browser/fileapi/quota/quota_reservation_manager.cc +++ b/webkit/browser/fileapi/quota/quota_reservation_manager.cc @@ -7,7 +7,7 @@ #include "webkit/browser/fileapi/quota/quota_reservation.h" #include "webkit/browser/fileapi/quota/quota_reservation_buffer.h" -namespace fileapi { +namespace storage { QuotaReservationManager::QuotaReservationManager( scoped_ptr<QuotaBackend> backend) @@ -88,4 +88,4 @@ scoped_refptr<QuotaReservation> QuotaReservationManager::CreateReservation( return GetReservationBuffer(origin, type)->CreateReservation();; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/quota/quota_reservation_manager.h b/webkit/browser/fileapi/quota/quota_reservation_manager.h index 6dc66ec..2e19450 100644 --- a/webkit/browser/fileapi/quota/quota_reservation_manager.h +++ b/webkit/browser/fileapi/quota/quota_reservation_manager.h @@ -21,7 +21,7 @@ namespace content { class QuotaReservationManagerTest; } -namespace fileapi { +namespace storage { class QuotaReservation; class QuotaReservationBuffer; @@ -122,6 +122,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaReservationManager { DISALLOW_COPY_AND_ASSIGN(QuotaReservationManager); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_QUOTA_QUOTA_RESERVATION_MANAGER_H_ diff --git a/webkit/browser/fileapi/recursive_operation_delegate.cc b/webkit/browser/fileapi/recursive_operation_delegate.cc index d1d85e0..7836b32 100644 --- a/webkit/browser/fileapi/recursive_operation_delegate.cc +++ b/webkit/browser/fileapi/recursive_operation_delegate.cc @@ -8,7 +8,7 @@ #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" -namespace fileapi { +namespace storage { namespace { // Don't start too many inflight operations. @@ -236,4 +236,4 @@ void RecursiveOperationDelegate::Done(base::File::Error error) { } } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/recursive_operation_delegate.h b/webkit/browser/fileapi/recursive_operation_delegate.h index 11f8da0..28d5b5e 100644 --- a/webkit/browser/fileapi/recursive_operation_delegate.h +++ b/webkit/browser/fileapi/recursive_operation_delegate.h @@ -14,7 +14,7 @@ #include "webkit/browser/fileapi/file_system_operation.h" #include "webkit/browser/fileapi/file_system_url.h" -namespace fileapi { +namespace storage { class FileSystemContext; class FileSystemOperationRunner; @@ -147,6 +147,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT RecursiveOperationDelegate DISALLOW_COPY_AND_ASSIGN(RecursiveOperationDelegate); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_RECURSIVE_OPERATION_DELEGATE_H_ diff --git a/webkit/browser/fileapi/remove_operation_delegate.cc b/webkit/browser/fileapi/remove_operation_delegate.cc index 6c7b2de..8e645cd 100644 --- a/webkit/browser/fileapi/remove_operation_delegate.cc +++ b/webkit/browser/fileapi/remove_operation_delegate.cc @@ -8,7 +8,7 @@ #include "webkit/browser/fileapi/file_system_context.h" #include "webkit/browser/fileapi/file_system_operation_runner.h" -namespace fileapi { +namespace storage { RemoveOperationDelegate::RemoveOperationDelegate( FileSystemContext* file_system_context, @@ -79,4 +79,4 @@ void RemoveOperationDelegate::DidRemoveFile(const StatusCallback& callback, callback.Run(error); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/remove_operation_delegate.h b/webkit/browser/fileapi/remove_operation_delegate.h index ee0252a..57380a3 100644 --- a/webkit/browser/fileapi/remove_operation_delegate.h +++ b/webkit/browser/fileapi/remove_operation_delegate.h @@ -9,7 +9,7 @@ #include "webkit/browser/fileapi/recursive_operation_delegate.h" -namespace fileapi { +namespace storage { class RemoveOperationDelegate : public RecursiveOperationDelegate { public: @@ -41,6 +41,6 @@ class RemoveOperationDelegate : public RecursiveOperationDelegate { DISALLOW_COPY_AND_ASSIGN(RemoveOperationDelegate); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_REMOVE_OPERATION_DELEGATE_H_ diff --git a/webkit/browser/fileapi/sandbox_directory_database.cc b/webkit/browser/fileapi/sandbox_directory_database.cc index 75aa691..7183fb8 100644 --- a/webkit/browser/fileapi/sandbox_directory_database.cc +++ b/webkit/browser/fileapi/sandbox_directory_database.cc @@ -23,9 +23,8 @@ namespace { -bool PickleFromFileInfo( - const fileapi::SandboxDirectoryDatabase::FileInfo& info, - Pickle* pickle) { +bool PickleFromFileInfo(const storage::SandboxDirectoryDatabase::FileInfo& info, + Pickle* pickle) { DCHECK(pickle); std::string data_path; // Round off here to match the behavior of the filesystem on real files. @@ -33,8 +32,8 @@ bool PickleFromFileInfo( base::Time::FromDoubleT(floor(info.modification_time.ToDoubleT())); std::string name; - data_path = fileapi::FilePathToString(info.data_path); - name = fileapi::FilePathToString(base::FilePath(info.name)); + data_path = storage::FilePathToString(info.data_path); + name = storage::FilePathToString(base::FilePath(info.name)); if (pickle->WriteInt64(info.parent_id) && pickle->WriteString(data_path) && @@ -46,9 +45,8 @@ bool PickleFromFileInfo( return false; } -bool FileInfoFromPickle( - const Pickle& pickle, - fileapi::SandboxDirectoryDatabase::FileInfo* info) { +bool FileInfoFromPickle(const Pickle& pickle, + storage::SandboxDirectoryDatabase::FileInfo* info) { PickleIterator iter(pickle); std::string data_path; std::string name; @@ -58,8 +56,8 @@ bool FileInfoFromPickle( pickle.ReadString(&iter, &data_path) && pickle.ReadString(&iter, &name) && pickle.ReadInt64(&iter, &internal_time)) { - info->data_path = fileapi::StringToFilePath(data_path); - info->name = fileapi::StringToFilePath(name).value(); + info->data_path = storage::StringToFilePath(data_path); + info->name = storage::StringToFilePath(name).value(); info->modification_time = base::Time::FromInternalValue(internal_time); return true; } @@ -93,16 +91,16 @@ enum RepairResult { }; std::string GetChildLookupKey( - fileapi::SandboxDirectoryDatabase::FileId parent_id, + storage::SandboxDirectoryDatabase::FileId parent_id, const base::FilePath::StringType& child_name) { std::string name; - name = fileapi::FilePathToString(base::FilePath(child_name)); + name = storage::FilePathToString(base::FilePath(child_name)); return std::string(kChildLookupPrefix) + base::Int64ToString(parent_id) + std::string(kChildLookupSeparator) + name; } std::string GetChildListingKeyPrefix( - fileapi::SandboxDirectoryDatabase::FileId parent_id) { + storage::SandboxDirectoryDatabase::FileId parent_id) { return std::string(kChildLookupPrefix) + base::Int64ToString(parent_id) + std::string(kChildLookupSeparator); } @@ -116,7 +114,7 @@ const char* LastIntegerKey() { } std::string GetFileLookupKey( - fileapi::SandboxDirectoryDatabase::FileId file_id) { + storage::SandboxDirectoryDatabase::FileId file_id) { return base::Int64ToString(file_id); } @@ -134,10 +132,10 @@ std::string GetFileLookupKey( // - Directory structure is tree, i.e. connected and acyclic. class DatabaseCheckHelper { public: - typedef fileapi::SandboxDirectoryDatabase::FileId FileId; - typedef fileapi::SandboxDirectoryDatabase::FileInfo FileInfo; + typedef storage::SandboxDirectoryDatabase::FileId FileId; + typedef storage::SandboxDirectoryDatabase::FileInfo FileInfo; - DatabaseCheckHelper(fileapi::SandboxDirectoryDatabase* dir_db, + DatabaseCheckHelper(storage::SandboxDirectoryDatabase* dir_db, leveldb::DB* db, const base::FilePath& path); @@ -155,7 +153,7 @@ class DatabaseCheckHelper { bool ScanDirectory(); bool ScanHierarchy(); - fileapi::SandboxDirectoryDatabase* dir_db_; + storage::SandboxDirectoryDatabase* dir_db_; leveldb::DB* db_; base::FilePath path_; @@ -170,14 +168,17 @@ class DatabaseCheckHelper { }; DatabaseCheckHelper::DatabaseCheckHelper( - fileapi::SandboxDirectoryDatabase* dir_db, + storage::SandboxDirectoryDatabase* dir_db, leveldb::DB* db, const base::FilePath& path) - : dir_db_(dir_db), db_(db), path_(path), + : dir_db_(dir_db), + db_(db), + path_(path), num_directories_in_db_(0), num_files_in_db_(0), num_hierarchy_links_in_db_(0), - last_file_id_(-1), last_integer_(-1) { + last_file_id_(-1), + last_integer_(-1) { DCHECK(dir_db_); DCHECK(db_); DCHECK(!path_.empty() && base::DirectoryExists(path_)); @@ -271,8 +272,8 @@ bool DatabaseCheckHelper::ScanDirectory() { // TODO(kinuko): Scans all local file system entries to verify each of them // has a database entry. const base::FilePath kExcludes[] = { - base::FilePath(kDirectoryDatabaseName), - base::FilePath(fileapi::FileSystemUsageCache::kUsageFileName), + base::FilePath(kDirectoryDatabaseName), + base::FilePath(storage::FileSystemUsageCache::kUsageFileName), }; // Any path in |pending_directories| is relative to |path_|. @@ -389,8 +390,8 @@ bool VerifyDataPath(const base::FilePath& data_path) { return false; // See if it's not pointing to the special system paths. const base::FilePath kExcludes[] = { - base::FilePath(kDirectoryDatabaseName), - base::FilePath(fileapi::FileSystemUsageCache::kUsageFileName), + base::FilePath(kDirectoryDatabaseName), + base::FilePath(storage::FileSystemUsageCache::kUsageFileName), }; for (size_t i = 0; i < arraysize(kExcludes); ++i) { if (data_path == kExcludes[i] || kExcludes[i].IsParent(data_path)) @@ -401,7 +402,7 @@ bool VerifyDataPath(const base::FilePath& data_path) { } // namespace -namespace fileapi { +namespace storage { SandboxDirectoryDatabase::FileInfo::FileInfo() : parent_id(0) { } @@ -935,4 +936,4 @@ void SandboxDirectoryDatabase::HandleError( db_.reset(); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/sandbox_directory_database.h b/webkit/browser/fileapi/sandbox_directory_database.h index 114af1b..0fb507b 100644 --- a/webkit/browser/fileapi/sandbox_directory_database.h +++ b/webkit/browser/fileapi/sandbox_directory_database.h @@ -29,7 +29,7 @@ class Status; class WriteBatch; } -namespace fileapi { +namespace storage { // This class WILL NOT protect you against producing directory loops, giving an // empty directory a backing data file, giving two files the same backing file, @@ -130,6 +130,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxDirectoryDatabase { DISALLOW_COPY_AND_ASSIGN(SandboxDirectoryDatabase); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_DIRECTORY_DATABASE_H_ diff --git a/webkit/browser/fileapi/sandbox_file_stream_writer.cc b/webkit/browser/fileapi/sandbox_file_stream_writer.cc index f5efaa6..8fd39bc 100644 --- a/webkit/browser/fileapi/sandbox_file_stream_writer.cc +++ b/webkit/browser/fileapi/sandbox_file_stream_writer.cc @@ -16,7 +16,7 @@ #include "webkit/browser/quota/quota_manager_proxy.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { namespace { @@ -114,7 +114,7 @@ void SandboxFileStreamWriter::DidCreateSnapshotFile( base::File::Error file_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) { DCHECK(!file_ref.get()); if (CancelIfRequested()) @@ -142,7 +142,7 @@ void SandboxFileStreamWriter::DidCreateSnapshotFile( initial_offset_, FileStreamWriter::OPEN_EXISTING_FILE)); - quota::QuotaManagerProxy* quota_manager_proxy = + storage::QuotaManagerProxy* quota_manager_proxy = file_system_context_->quota_manager_proxy(); if (!quota_manager_proxy) { // If we don't have the quota manager or the requested filesystem type @@ -162,11 +162,12 @@ void SandboxFileStreamWriter::DidCreateSnapshotFile( void SandboxFileStreamWriter::DidGetUsageAndQuota( const net::CompletionCallback& callback, - quota::QuotaStatusCode status, - int64 usage, int64 quota) { + storage::QuotaStatusCode status, + int64 usage, + int64 quota) { if (CancelIfRequested()) return; - if (status != quota::kQuotaStatusOk) { + if (status != storage::kQuotaStatusOk) { LOG(WARNING) << "Got unexpected quota error : " << status; callback.Run(net::ERR_FAILED); return; @@ -243,4 +244,4 @@ int SandboxFileStreamWriter::Flush(const net::CompletionCallback& callback) { return local_file_writer_->Flush(callback); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/sandbox_file_stream_writer.h b/webkit/browser/fileapi/sandbox_file_stream_writer.h index 53cbb50..58cae32 100644 --- a/webkit/browser/fileapi/sandbox_file_stream_writer.h +++ b/webkit/browser/fileapi/sandbox_file_stream_writer.h @@ -17,7 +17,7 @@ #include "webkit/common/fileapi/file_system_types.h" #include "webkit/common/quota/quota_types.h" -namespace fileapi { +namespace storage { class FileSystemContext; class FileSystemQuotaUtil; @@ -55,10 +55,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxFileStreamWriter base::File::Error file_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); void DidGetUsageAndQuota(const net::CompletionCallback& callback, - quota::QuotaStatusCode status, - int64 usage, int64 quota); + storage::QuotaStatusCode status, + int64 usage, + int64 quota); void DidInitializeForWrite(net::IOBuffer* buf, int buf_len, const net::CompletionCallback& callback, int init_status); @@ -90,6 +91,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxFileStreamWriter DISALLOW_COPY_AND_ASSIGN(SandboxFileStreamWriter); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_STREAM_WRITER_H_ diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.cc b/webkit/browser/fileapi/sandbox_file_system_backend.cc index b71c1c4..a0ab15d 100644 --- a/webkit/browser/fileapi/sandbox_file_system_backend.cc +++ b/webkit/browser/fileapi/sandbox_file_system_backend.cc @@ -26,10 +26,10 @@ #include "webkit/common/fileapi/file_system_types.h" #include "webkit/common/fileapi/file_system_util.h" -using quota::QuotaManagerProxy; -using quota::SpecialStoragePolicy; +using storage::QuotaManagerProxy; +using storage::SpecialStoragePolicy; -namespace fileapi { +namespace storage { SandboxFileSystemBackend::SandboxFileSystemBackend( SandboxFileSystemBackendDelegate* delegate) @@ -49,15 +49,13 @@ void SandboxFileSystemBackend::Initialize(FileSystemContext* context) { DCHECK(delegate_); // Set quota observers. - delegate_->RegisterQuotaUpdateObserver(fileapi::kFileSystemTypeTemporary); + delegate_->RegisterQuotaUpdateObserver(storage::kFileSystemTypeTemporary); delegate_->AddFileAccessObserver( - fileapi::kFileSystemTypeTemporary, - delegate_->quota_observer(), NULL); + storage::kFileSystemTypeTemporary, delegate_->quota_observer(), NULL); - delegate_->RegisterQuotaUpdateObserver(fileapi::kFileSystemTypePersistent); + delegate_->RegisterQuotaUpdateObserver(storage::kFileSystemTypePersistent); delegate_->AddFileAccessObserver( - fileapi::kFileSystemTypePersistent, - delegate_->quota_observer(), NULL); + storage::kFileSystemTypePersistent, delegate_->quota_observer(), NULL); } void SandboxFileSystemBackend::ResolveURL( @@ -111,24 +109,24 @@ FileSystemOperation* SandboxFileSystemBackend::CreateFileSystemOperation( SpecialStoragePolicy* policy = delegate_->special_storage_policy(); if (policy && policy->IsStorageUnlimited(url.origin())) - operation_context->set_quota_limit_type(quota::kQuotaLimitTypeUnlimited); + operation_context->set_quota_limit_type(storage::kQuotaLimitTypeUnlimited); else - operation_context->set_quota_limit_type(quota::kQuotaLimitTypeLimited); + operation_context->set_quota_limit_type(storage::kQuotaLimitTypeLimited); return FileSystemOperation::Create(url, context, operation_context.Pass()); } bool SandboxFileSystemBackend::SupportsStreaming( - const fileapi::FileSystemURL& url) const { + const storage::FileSystemURL& url) const { return false; } bool SandboxFileSystemBackend::HasInplaceCopyImplementation( - fileapi::FileSystemType type) const { + storage::FileSystemType type) const { return true; } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> SandboxFileSystemBackend::CreateFileStreamReader( const FileSystemURL& url, int64 offset, @@ -140,7 +138,7 @@ SandboxFileSystemBackend::CreateFileStreamReader( url, offset, expected_modification_time, context); } -scoped_ptr<fileapi::FileStreamWriter> +scoped_ptr<storage::FileStreamWriter> SandboxFileSystemBackend::CreateFileStreamWriter( const FileSystemURL& url, int64 offset, @@ -160,4 +158,4 @@ SandboxFileSystemBackend::CreateOriginEnumerator() { return delegate_->CreateOriginEnumerator(); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/sandbox_file_system_backend.h b/webkit/browser/fileapi/sandbox_file_system_backend.h index 0df2afa..f4673dd 100644 --- a/webkit/browser/fileapi/sandbox_file_system_backend.h +++ b/webkit/browser/fileapi/sandbox_file_system_backend.h @@ -19,7 +19,7 @@ #include "webkit/browser/quota/special_storage_policy.h" #include "webkit/browser/webkit_storage_browser_export.h" -namespace fileapi { +namespace storage { // TEMPORARY or PERSISTENT filesystems, which are placed under the user's // profile directory in a sandboxed way. @@ -47,8 +47,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend base::File::Error* error_code) const OVERRIDE; virtual bool SupportsStreaming(const FileSystemURL& url) const OVERRIDE; virtual bool HasInplaceCopyImplementation( - fileapi::FileSystemType type) const OVERRIDE; - virtual scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( + storage::FileSystemType type) const OVERRIDE; + virtual scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, @@ -79,6 +79,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackend DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackend); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_H_ diff --git a/webkit/browser/fileapi/sandbox_file_system_backend_delegate.cc b/webkit/browser/fileapi/sandbox_file_system_backend_delegate.cc index 6bb2efd..5894969 100644 --- a/webkit/browser/fileapi/sandbox_file_system_backend_delegate.cc +++ b/webkit/browser/fileapi/sandbox_file_system_backend_delegate.cc @@ -28,7 +28,7 @@ #include "webkit/browser/quota/quota_manager_proxy.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { namespace { @@ -170,27 +170,25 @@ std::string SandboxFileSystemBackendDelegate::GetTypeString( } SandboxFileSystemBackendDelegate::SandboxFileSystemBackendDelegate( - quota::QuotaManagerProxy* quota_manager_proxy, + storage::QuotaManagerProxy* quota_manager_proxy, base::SequencedTaskRunner* file_task_runner, const base::FilePath& profile_path, - quota::SpecialStoragePolicy* special_storage_policy, + storage::SpecialStoragePolicy* special_storage_policy, const FileSystemOptions& file_system_options) : file_task_runner_(file_task_runner), sandbox_file_util_(new AsyncFileUtilAdapter( - new ObfuscatedFileUtil( - special_storage_policy, - profile_path.Append(kFileSystemDirectory), - file_system_options.env_override(), - file_task_runner, - base::Bind(&GetTypeStringForURL), - GetKnownTypeStrings(), - this))), + new ObfuscatedFileUtil(special_storage_policy, + profile_path.Append(kFileSystemDirectory), + file_system_options.env_override(), + file_task_runner, + base::Bind(&GetTypeStringForURL), + GetKnownTypeStrings(), + this))), file_system_usage_cache_(new FileSystemUsageCache(file_task_runner)), - quota_observer_(new SandboxQuotaObserver( - quota_manager_proxy, - file_task_runner, - obfuscated_file_util(), - usage_cache())), + quota_observer_(new SandboxQuotaObserver(quota_manager_proxy, + file_task_runner, + obfuscated_file_util(), + usage_cache())), quota_reservation_manager_(new QuotaReservationManager( scoped_ptr<QuotaReservationManager::QuotaBackend>( new QuotaBackendImpl(file_task_runner_, @@ -297,16 +295,16 @@ SandboxFileSystemBackendDelegate::CreateFileSystemOperationContext( return operation_context.Pass(); } -scoped_ptr<webkit_blob::FileStreamReader> +scoped_ptr<storage::FileStreamReader> SandboxFileSystemBackendDelegate::CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, FileSystemContext* context) const { if (!IsAccessValid(url)) - return scoped_ptr<webkit_blob::FileStreamReader>(); - return scoped_ptr<webkit_blob::FileStreamReader>( - webkit_blob::FileStreamReader::CreateForFileSystemFile( + return scoped_ptr<storage::FileStreamReader>(); + return scoped_ptr<storage::FileStreamReader>( + storage::FileStreamReader::CreateForFileSystemFile( context, url, offset, expected_modification_time)); } @@ -327,7 +325,7 @@ SandboxFileSystemBackendDelegate::CreateFileStreamWriter( base::File::Error SandboxFileSystemBackendDelegate::DeleteOriginDataOnFileTaskRunner( FileSystemContext* file_system_context, - quota::QuotaManagerProxy* proxy, + storage::QuotaManagerProxy* proxy, const GURL& origin_url, FileSystemType type) { DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); @@ -337,11 +335,10 @@ SandboxFileSystemBackendDelegate::DeleteOriginDataOnFileTaskRunner( bool result = obfuscated_file_util()->DeleteDirectoryForOriginAndType( origin_url, GetTypeString(type)); if (result && proxy) { - proxy->NotifyStorageModified( - quota::QuotaClient::kFileSystem, - origin_url, - FileSystemTypeToQuotaStorageType(type), - -usage); + proxy->NotifyStorageModified(storage::QuotaClient::kFileSystem, + origin_url, + FileSystemTypeToQuotaStorageType(type), + -usage); } if (result) @@ -660,7 +657,7 @@ ObfuscatedFileUtil* SandboxFileSystemBackendDelegate::obfuscated_file_util() { // Declared in obfuscated_file_util.h. // static ObfuscatedFileUtil* ObfuscatedFileUtil::CreateForTesting( - quota::SpecialStoragePolicy* special_storage_policy, + storage::SpecialStoragePolicy* special_storage_policy, const base::FilePath& file_system_directory, leveldb::Env* env_override, base::SequencedTaskRunner* file_task_runner) { @@ -673,4 +670,4 @@ ObfuscatedFileUtil* ObfuscatedFileUtil::CreateForTesting( NULL); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/sandbox_file_system_backend_delegate.h b/webkit/browser/fileapi/sandbox_file_system_backend_delegate.h index 2b67cfc..5209f00 100644 --- a/webkit/browser/fileapi/sandbox_file_system_backend_delegate.h +++ b/webkit/browser/fileapi/sandbox_file_system_backend_delegate.h @@ -31,16 +31,16 @@ class SandboxFileSystemBackendDelegateTest; class SandboxFileSystemTestHelper; } -namespace quota { +namespace storage { class QuotaManagerProxy; class SpecialStoragePolicy; } -namespace webkit_blob { +namespace storage { class FileStreamReader; } -namespace fileapi { +namespace storage { class AsyncFileUtil; class FileStreamWriter; @@ -80,10 +80,10 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackendDelegate static std::string GetTypeString(FileSystemType type); SandboxFileSystemBackendDelegate( - quota::QuotaManagerProxy* quota_manager_proxy, + storage::QuotaManagerProxy* quota_manager_proxy, base::SequencedTaskRunner* file_task_runner, const base::FilePath& profile_path, - quota::SpecialStoragePolicy* special_storage_policy, + storage::SpecialStoragePolicy* special_storage_policy, const FileSystemOptions& file_system_options); virtual ~SandboxFileSystemBackendDelegate(); @@ -114,7 +114,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackendDelegate const FileSystemURL& url, FileSystemContext* context, base::File::Error* error_code) const; - scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( + scoped_ptr<storage::FileStreamReader> CreateFileStreamReader( const FileSystemURL& url, int64 offset, const base::Time& expected_modification_time, @@ -128,7 +128,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackendDelegate // FileSystemQuotaUtil overrides. virtual base::File::Error DeleteOriginDataOnFileTaskRunner( FileSystemContext* context, - quota::QuotaManagerProxy* proxy, + storage::QuotaManagerProxy* proxy, const GURL& origin_url, FileSystemType type) OVERRIDE; virtual void GetOriginsForTypeOnFileTaskRunner( @@ -183,7 +183,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackendDelegate FileSystemUsageCache* usage_cache() { return file_system_usage_cache_.get(); } SandboxQuotaObserver* quota_observer() { return quota_observer_.get(); } - quota::SpecialStoragePolicy* special_storage_policy() { + storage::SpecialStoragePolicy* special_storage_policy() { return special_storage_policy_.get(); } @@ -232,7 +232,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackendDelegate scoped_ptr<SandboxQuotaObserver> quota_observer_; scoped_ptr<QuotaReservationManager> quota_reservation_manager_; - scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; + scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; FileSystemOptions file_system_options_; @@ -255,6 +255,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SandboxFileSystemBackendDelegate DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackendDelegate); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ diff --git a/webkit/browser/fileapi/sandbox_isolated_origin_database.cc b/webkit/browser/fileapi/sandbox_isolated_origin_database.cc index 901c4fd..e6fcd39 100644 --- a/webkit/browser/fileapi/sandbox_isolated_origin_database.cc +++ b/webkit/browser/fileapi/sandbox_isolated_origin_database.cc @@ -8,7 +8,7 @@ #include "base/logging.h" #include "webkit/browser/fileapi/sandbox_origin_database.h" -namespace fileapi { +namespace storage { // Special directory name for isolated origin. const base::FilePath::CharType @@ -77,4 +77,4 @@ void SandboxIsolatedOriginDatabase::MigrateBackFromObsoleteOriginDatabase( } } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/sandbox_isolated_origin_database.h b/webkit/browser/fileapi/sandbox_isolated_origin_database.h index d3a882a..1a948b5 100644 --- a/webkit/browser/fileapi/sandbox_isolated_origin_database.h +++ b/webkit/browser/fileapi/sandbox_isolated_origin_database.h @@ -10,7 +10,7 @@ #include "webkit/browser/fileapi/sandbox_origin_database_interface.h" -namespace fileapi { +namespace storage { class SandboxOriginDatabase; @@ -56,6 +56,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxIsolatedOriginDatabase DISALLOW_COPY_AND_ASSIGN(SandboxIsolatedOriginDatabase); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_ISOLATED_ORIGIN_DATABASE_H_ diff --git a/webkit/browser/fileapi/sandbox_origin_database.cc b/webkit/browser/fileapi/sandbox_origin_database.cc index 3bbee52..d65e959 100644 --- a/webkit/browser/fileapi/sandbox_origin_database.cc +++ b/webkit/browser/fileapi/sandbox_origin_database.cc @@ -55,7 +55,7 @@ const char* LastPathKey() { } // namespace -namespace fileapi { +namespace storage { SandboxOriginDatabase::SandboxOriginDatabase( const base::FilePath& file_system_directory, @@ -344,4 +344,4 @@ bool SandboxOriginDatabase::GetLastPathNumber(int* number) { return true; } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/sandbox_origin_database.h b/webkit/browser/fileapi/sandbox_origin_database.h index 57d2e84..3fff77d 100644 --- a/webkit/browser/fileapi/sandbox_origin_database.h +++ b/webkit/browser/fileapi/sandbox_origin_database.h @@ -22,7 +22,7 @@ namespace tracked_objects { class Location; } -namespace fileapi { +namespace storage { // All methods of this class other than the constructor may be used only from // the browser's FILE thread. The constructor may be used on any thread. @@ -72,6 +72,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxOriginDatabase DISALLOW_COPY_AND_ASSIGN(SandboxOriginDatabase); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_H_ diff --git a/webkit/browser/fileapi/sandbox_origin_database_interface.cc b/webkit/browser/fileapi/sandbox_origin_database_interface.cc index e2f80c5..855e4c3 100644 --- a/webkit/browser/fileapi/sandbox_origin_database_interface.cc +++ b/webkit/browser/fileapi/sandbox_origin_database_interface.cc @@ -4,7 +4,7 @@ #include "webkit/browser/fileapi/sandbox_origin_database_interface.h" -namespace fileapi { +namespace storage { SandboxOriginDatabaseInterface::OriginRecord::OriginRecord() { } @@ -17,4 +17,4 @@ SandboxOriginDatabaseInterface::OriginRecord::OriginRecord( SandboxOriginDatabaseInterface::OriginRecord::~OriginRecord() { } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/sandbox_origin_database_interface.h b/webkit/browser/fileapi/sandbox_origin_database_interface.h index 8b88f93..ed20a5e 100644 --- a/webkit/browser/fileapi/sandbox_origin_database_interface.h +++ b/webkit/browser/fileapi/sandbox_origin_database_interface.h @@ -11,7 +11,7 @@ #include "base/files/file_path.h" #include "webkit/browser/webkit_storage_browser_export.h" -namespace fileapi { +namespace storage { class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxOriginDatabaseInterface { public: @@ -50,6 +50,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxOriginDatabaseInterface { SandboxOriginDatabaseInterface() {} }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_ORIGIN_DATABASE_INTERFACE_H_ diff --git a/webkit/browser/fileapi/sandbox_prioritized_origin_database.cc b/webkit/browser/fileapi/sandbox_prioritized_origin_database.cc index 55ce362..2f07a57 100644 --- a/webkit/browser/fileapi/sandbox_prioritized_origin_database.cc +++ b/webkit/browser/fileapi/sandbox_prioritized_origin_database.cc @@ -12,7 +12,7 @@ #include "webkit/browser/fileapi/sandbox_isolated_origin_database.h" #include "webkit/browser/fileapi/sandbox_origin_database.h" -namespace fileapi { +namespace storage { namespace { @@ -220,4 +220,4 @@ SandboxPrioritizedOriginDatabase::GetSandboxOriginDatabase() { return origin_database_.get(); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/sandbox_prioritized_origin_database.h b/webkit/browser/fileapi/sandbox_prioritized_origin_database.h index 6f390dc..56fac2c 100644 --- a/webkit/browser/fileapi/sandbox_prioritized_origin_database.h +++ b/webkit/browser/fileapi/sandbox_prioritized_origin_database.h @@ -15,7 +15,7 @@ namespace leveldb { class Env; } -namespace fileapi { +namespace storage { class ObfuscatedFileUtil; class SandboxIsolatedOriginDatabase; @@ -67,6 +67,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE SandboxPrioritizedOriginDatabase DISALLOW_COPY_AND_ASSIGN(SandboxPrioritizedOriginDatabase); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_PRIORITIZED_ORIGIN_DATABASE_H_ diff --git a/webkit/browser/fileapi/sandbox_quota_observer.cc b/webkit/browser/fileapi/sandbox_quota_observer.cc index 42b6d08..412fd50 100644 --- a/webkit/browser/fileapi/sandbox_quota_observer.cc +++ b/webkit/browser/fileapi/sandbox_quota_observer.cc @@ -13,17 +13,18 @@ #include "webkit/browser/quota/quota_manager_proxy.h" #include "webkit/common/fileapi/file_system_util.h" -namespace fileapi { +namespace storage { SandboxQuotaObserver::SandboxQuotaObserver( - quota::QuotaManagerProxy* quota_manager_proxy, + storage::QuotaManagerProxy* quota_manager_proxy, base::SequencedTaskRunner* update_notify_runner, ObfuscatedFileUtil* sandbox_file_util, FileSystemUsageCache* file_system_usage_cache) : quota_manager_proxy_(quota_manager_proxy), update_notify_runner_(update_notify_runner), sandbox_file_util_(sandbox_file_util), - file_system_usage_cache_(file_system_usage_cache) {} + file_system_usage_cache_(file_system_usage_cache) { +} SandboxQuotaObserver::~SandboxQuotaObserver() {} @@ -41,7 +42,7 @@ void SandboxQuotaObserver::OnUpdate(const FileSystemURL& url, if (quota_manager_proxy_.get()) { quota_manager_proxy_->NotifyStorageModified( - quota::QuotaClient::kFileSystem, + storage::QuotaClient::kFileSystem, url.origin(), FileSystemTypeToQuotaStorageType(url.type()), delta); @@ -83,7 +84,7 @@ void SandboxQuotaObserver::OnEndUpdate(const FileSystemURL& url) { void SandboxQuotaObserver::OnAccess(const FileSystemURL& url) { if (quota_manager_proxy_.get()) { quota_manager_proxy_->NotifyStorageAccessed( - quota::QuotaClient::kFileSystem, + storage::QuotaClient::kFileSystem, url.origin(), FileSystemTypeToQuotaStorageType(url.type())); } @@ -95,7 +96,7 @@ void SandboxQuotaObserver::SetUsageCacheEnabled( bool enabled) { if (quota_manager_proxy_.get()) { quota_manager_proxy_->SetUsageCacheEnabled( - quota::QuotaClient::kFileSystem, + storage::QuotaClient::kFileSystem, origin, FileSystemTypeToQuotaStorageType(type), enabled); @@ -136,4 +137,4 @@ void SandboxQuotaObserver::UpdateUsageCacheFile( file_system_usage_cache_->AtomicUpdateUsageByDelta(usage_file_path, delta); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/sandbox_quota_observer.h b/webkit/browser/fileapi/sandbox_quota_observer.h index 2c16860..7a90757 100644 --- a/webkit/browser/fileapi/sandbox_quota_observer.h +++ b/webkit/browser/fileapi/sandbox_quota_observer.h @@ -20,11 +20,11 @@ namespace base { class SequencedTaskRunner; } -namespace quota { +namespace storage { class QuotaManagerProxy; } -namespace fileapi { +namespace storage { class FileSystemUsageCache; class FileSystemURL; @@ -37,11 +37,10 @@ class SandboxQuotaObserver public: typedef std::map<base::FilePath, int64> PendingUpdateNotificationMap; - SandboxQuotaObserver( - quota::QuotaManagerProxy* quota_manager_proxy, - base::SequencedTaskRunner* update_notify_runner, - ObfuscatedFileUtil* sandbox_file_util, - FileSystemUsageCache* file_system_usage_cache_); + SandboxQuotaObserver(storage::QuotaManagerProxy* quota_manager_proxy, + base::SequencedTaskRunner* update_notify_runner, + ObfuscatedFileUtil* sandbox_file_util, + FileSystemUsageCache* file_system_usage_cache_); virtual ~SandboxQuotaObserver(); // FileUpdateObserver overrides. @@ -62,7 +61,7 @@ class SandboxQuotaObserver base::FilePath GetUsageCachePath(const FileSystemURL& url); - scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; + scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; scoped_refptr<base::SequencedTaskRunner> update_notify_runner_; // Not owned; sandbox_file_util_ should have identical lifetime with this. @@ -77,6 +76,6 @@ class SandboxQuotaObserver DISALLOW_COPY_AND_ASSIGN(SandboxQuotaObserver); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_QUOTA_OBSERVER_H_ diff --git a/webkit/browser/fileapi/task_runner_bound_observer_list.h b/webkit/browser/fileapi/task_runner_bound_observer_list.h index 36a3393..a3228ff 100644 --- a/webkit/browser/fileapi/task_runner_bound_observer_list.h +++ b/webkit/browser/fileapi/task_runner_bound_observer_list.h @@ -13,7 +13,7 @@ #include "base/sequenced_task_runner.h" #include "base/threading/thread.h" -namespace fileapi { +namespace storage { // A wrapper for dispatching method. template <class T, class Method, class Params> @@ -94,6 +94,6 @@ typedef TaskRunnerBoundObserverList<FileAccessObserver> AccessObserverList; typedef TaskRunnerBoundObserverList<FileChangeObserver> ChangeObserverList; typedef TaskRunnerBoundObserverList<FileUpdateObserver> UpdateObserverList; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_TASK_RUNNER_BOUND_OBSERVER_LIST_H_ diff --git a/webkit/browser/fileapi/timed_task_helper.cc b/webkit/browser/fileapi/timed_task_helper.cc index 50d1dd00..4794723 100644 --- a/webkit/browser/fileapi/timed_task_helper.cc +++ b/webkit/browser/fileapi/timed_task_helper.cc @@ -8,7 +8,7 @@ #include "base/logging.h" #include "base/sequenced_task_runner.h" -namespace fileapi { +namespace storage { struct TimedTaskHelper::Tracker { explicit Tracker(TimedTaskHelper* timer) : timer(timer) {} @@ -89,4 +89,4 @@ void TimedTaskHelper::PostDelayedTask(scoped_ptr<Tracker> tracker, delay); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/timed_task_helper.h b/webkit/browser/fileapi/timed_task_helper.h index fcfb80a..9f9162f 100644 --- a/webkit/browser/fileapi/timed_task_helper.h +++ b/webkit/browser/fileapi/timed_task_helper.h @@ -17,7 +17,7 @@ namespace base { class SequencedTaskRunner; } -namespace fileapi { +namespace storage { // Works similarly as base::Timer, but takes SequencedTaskRunner and // runs tasks on it (instead of implicitly bound to a thread). @@ -54,6 +54,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT TimedTaskHelper { DISALLOW_COPY_AND_ASSIGN(TimedTaskHelper); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_TIMED_TASK_HELPER_H_ diff --git a/webkit/browser/fileapi/transient_file_util.cc b/webkit/browser/fileapi/transient_file_util.cc index 4cac5ca..334b5ed 100644 --- a/webkit/browser/fileapi/transient_file_util.cc +++ b/webkit/browser/fileapi/transient_file_util.cc @@ -12,9 +12,9 @@ #include "webkit/browser/fileapi/file_system_url.h" #include "webkit/browser/fileapi/isolated_context.h" -using webkit_blob::ScopedFile; +using storage::ScopedFile; -namespace fileapi { +namespace storage { namespace { @@ -52,4 +52,4 @@ ScopedFile TransientFileUtil::CreateSnapshotFile( return scoped_file.Pass(); } -} // namespace fileapi +} // namespace storage diff --git a/webkit/browser/fileapi/transient_file_util.h b/webkit/browser/fileapi/transient_file_util.h index 6ffb48c..0a1d746c 100644 --- a/webkit/browser/fileapi/transient_file_util.h +++ b/webkit/browser/fileapi/transient_file_util.h @@ -9,7 +9,7 @@ #include "webkit/browser/fileapi/local_file_util.h" #include "webkit/browser/webkit_storage_browser_export.h" -namespace fileapi { +namespace storage { class FileSystemOperationContext; @@ -20,7 +20,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE TransientFileUtil virtual ~TransientFileUtil() {} // LocalFileUtil overrides. - virtual webkit_blob::ScopedFile CreateSnapshotFile( + virtual storage::ScopedFile CreateSnapshotFile( FileSystemOperationContext* context, const FileSystemURL& url, base::File::Error* error, @@ -31,6 +31,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE TransientFileUtil DISALLOW_COPY_AND_ASSIGN(TransientFileUtil); }; -} // namespace fileapi +} // namespace storage #endif // WEBKIT_BROWSER_FILEAPI_TRANSIENT_FILE_UTIL_H_ diff --git a/webkit/browser/quota/quota_callbacks.h b/webkit/browser/quota/quota_callbacks.h index 84f52c0..7018aba 100644 --- a/webkit/browser/quota/quota_callbacks.h +++ b/webkit/browser/quota/quota_callbacks.h @@ -18,7 +18,7 @@ class GURL; -namespace quota { +namespace storage { struct UsageInfo; typedef std::vector<UsageInfo> UsageInfoEntries; @@ -124,6 +124,6 @@ typedef CallbackQueueMap<QuotaCallback, std::string, Tuple2<QuotaStatusCode, int64> > HostQuotaCallbackMap; -} // namespace quota +} // namespace storage #endif // WEBKIT_QUOTA_QUOTA_TYPES_H_ diff --git a/webkit/browser/quota/quota_client.h b/webkit/browser/quota/quota_client.h index 5c0da46..a113a6c 100644 --- a/webkit/browser/quota/quota_client.h +++ b/webkit/browser/quota/quota_client.h @@ -14,7 +14,7 @@ #include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/quota/quota_types.h" -namespace quota { +namespace storage { // An abstract interface for quota manager clients. // Each storage API must provide an implementation of this interface and @@ -76,6 +76,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaClient { // TODO(dmikurube): Replace it to std::vector for efficiency. typedef std::list<QuotaClient*> QuotaClientList; -} // namespace quota +} // namespace storage #endif // WEBKIT_BROWSER_QUOTA_QUOTA_CLIENT_H_ diff --git a/webkit/browser/quota/quota_database.cc b/webkit/browser/quota/quota_database.cc index 03bed77..de07cc8a 100644 --- a/webkit/browser/quota/quota_database.cc +++ b/webkit/browser/quota/quota_database.cc @@ -18,7 +18,7 @@ #include "url/gurl.h" #include "webkit/browser/quota/special_storage_policy.h" -namespace quota { +namespace storage { namespace { // Definitions for database schema. @@ -654,4 +654,4 @@ bool operator<(const QuotaDatabase::OriginInfoTableEntry& lhs, return lhs.last_access_time < rhs.last_access_time; } -} // namespace quota +} // namespace storage diff --git a/webkit/browser/quota/quota_database.h b/webkit/browser/quota/quota_database.h index c64fde7..4e3128f 100644 --- a/webkit/browser/quota/quota_database.h +++ b/webkit/browser/quota/quota_database.h @@ -30,7 +30,7 @@ class MetaTable; class GURL; -namespace quota { +namespace storage { class SpecialStoragePolicy; @@ -185,6 +185,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE QuotaDatabase { DISALLOW_COPY_AND_ASSIGN(QuotaDatabase); }; -} // namespace quota +} // namespace storage #endif // WEBKIT_BROWSER_QUOTA_QUOTA_DATABASE_H_ diff --git a/webkit/browser/quota/quota_manager.cc b/webkit/browser/quota/quota_manager.cc index e468822..0193787 100644 --- a/webkit/browser/quota/quota_manager.cc +++ b/webkit/browser/quota/quota_manager.cc @@ -35,7 +35,7 @@ (name), static_cast<int>((sample) / kMBytes), \ 1, 10 * 1024 * 1024 /* 10TB */, 100) -namespace quota { +namespace storage { namespace { @@ -1628,4 +1628,4 @@ void QuotaManager::PostTaskAndReplyWithResultForDBThread( reply); } -} // namespace quota +} // namespace storage diff --git a/webkit/browser/quota/quota_manager.h b/webkit/browser/quota/quota_manager.h index ebb953a..9fe9586 100644 --- a/webkit/browser/quota/quota_manager.h +++ b/webkit/browser/quota/quota_manager.h @@ -46,7 +46,7 @@ class StorageMonitorTest; } -namespace quota { +namespace storage { class QuotaDatabase; class QuotaManagerProxy; @@ -454,6 +454,6 @@ struct QuotaManagerDeleter { } }; -} // namespace quota +} // namespace storage #endif // WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_H_ diff --git a/webkit/browser/quota/quota_manager_proxy.cc b/webkit/browser/quota/quota_manager_proxy.cc index 20b42c3..7cc39c7 100644 --- a/webkit/browser/quota/quota_manager_proxy.cc +++ b/webkit/browser/quota/quota_manager_proxy.cc @@ -12,7 +12,7 @@ #include "base/strings/string_number_conversions.h" #include "base/task_runner_util.h" -namespace quota { +namespace storage { namespace { @@ -157,4 +157,4 @@ QuotaManagerProxy::QuotaManagerProxy( QuotaManagerProxy::~QuotaManagerProxy() { } -} // namespace quota +} // namespace storage diff --git a/webkit/browser/quota/quota_manager_proxy.h b/webkit/browser/quota/quota_manager_proxy.h index 21c97c6..c58a44b 100644 --- a/webkit/browser/quota/quota_manager_proxy.h +++ b/webkit/browser/quota/quota_manager_proxy.h @@ -25,7 +25,7 @@ class SequencedTaskRunner; class SingleThreadTaskRunner; } -namespace quota { +namespace storage { // The proxy may be called and finally released on any thread. class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManagerProxy @@ -73,6 +73,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT QuotaManagerProxy DISALLOW_COPY_AND_ASSIGN(QuotaManagerProxy); }; -} // namespace quota +} // namespace storage #endif // WEBKIT_BROWSER_QUOTA_QUOTA_MANAGER_PROXY_H_ diff --git a/webkit/browser/quota/quota_task.cc b/webkit/browser/quota/quota_task.cc index 3aa4e51..98594a9 100644 --- a/webkit/browser/quota/quota_task.cc +++ b/webkit/browser/quota/quota_task.cc @@ -15,7 +15,7 @@ using base::TaskRunner; -namespace quota { +namespace storage { // QuotaTask --------------------------------------------------------------- @@ -76,4 +76,4 @@ void QuotaTaskObserver::UnregisterTask(QuotaTask* task) { running_quota_tasks_.erase(task); } -} // namespace quota +} // namespace storage diff --git a/webkit/browser/quota/quota_task.h b/webkit/browser/quota/quota_task.h index 65344e9..9204c29 100644 --- a/webkit/browser/quota/quota_task.h +++ b/webkit/browser/quota/quota_task.h @@ -18,7 +18,7 @@ class SingleThreadTaskRunner; class TaskRunner; } -namespace quota { +namespace storage { class QuotaTaskObserver; diff --git a/webkit/browser/quota/quota_temporary_storage_evictor.cc b/webkit/browser/quota/quota_temporary_storage_evictor.cc index 47a36f8..3eaad3f 100644 --- a/webkit/browser/quota/quota_temporary_storage_evictor.cc +++ b/webkit/browser/quota/quota_temporary_storage_evictor.cc @@ -29,7 +29,7 @@ const int kThresholdOfErrorsToStopEviction = 5; const int kHistogramReportIntervalMinutes = 60; } -namespace quota { +namespace storage { const int QuotaTemporaryStorageEvictor:: kMinAvailableDiskSpaceToStartEvictionNotSpecified = -1; @@ -258,4 +258,4 @@ void QuotaTemporaryStorageEvictor::OnEvictionComplete( } } -} // namespace quota +} // namespace storage diff --git a/webkit/browser/quota/quota_temporary_storage_evictor.h b/webkit/browser/quota/quota_temporary_storage_evictor.h index 244fa0f..222aa6d 100644 --- a/webkit/browser/quota/quota_temporary_storage_evictor.h +++ b/webkit/browser/quota/quota_temporary_storage_evictor.h @@ -20,7 +20,7 @@ namespace content { class QuotaTemporaryStorageEvictorTest; } -namespace quota { +namespace storage { class QuotaEvictionHandler; struct UsageAndQuota; @@ -129,6 +129,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE QuotaTemporaryStorageEvictor DISALLOW_COPY_AND_ASSIGN(QuotaTemporaryStorageEvictor); }; -} // namespace quota +} // namespace storage #endif // WEBKIT_BROWSER_QUOTA_QUOTA_TEMPORARY_STORAGE_EVICTOR_H_ diff --git a/webkit/browser/quota/special_storage_policy.cc b/webkit/browser/quota/special_storage_policy.cc index 9aacb04..eac7ba0 100644 --- a/webkit/browser/quota/special_storage_policy.cc +++ b/webkit/browser/quota/special_storage_policy.cc @@ -4,7 +4,7 @@ #include "webkit/browser/quota/special_storage_policy.h" -namespace quota { +namespace storage { SpecialStoragePolicy::Observer::~Observer() {} @@ -35,4 +35,4 @@ void SpecialStoragePolicy::NotifyCleared() { FOR_EACH_OBSERVER(Observer, observers_, OnCleared()); } -} // namespace quota +} // namespace storage diff --git a/webkit/browser/quota/special_storage_policy.h b/webkit/browser/quota/special_storage_policy.h index c8beb44..83e5052 100644 --- a/webkit/browser/quota/special_storage_policy.h +++ b/webkit/browser/quota/special_storage_policy.h @@ -13,7 +13,7 @@ class GURL; -namespace quota { +namespace storage { // Special rights are granted to 'extensions' and 'applications'. The // storage subsystems query this interface to determine which origins @@ -81,6 +81,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT SpecialStoragePolicy ObserverList<Observer> observers_; }; -} // namespace quota +} // namespace storage #endif // WEBKIT_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ diff --git a/webkit/browser/quota/storage_monitor.cc b/webkit/browser/quota/storage_monitor.cc index bb56af3..366d4d7 100644 --- a/webkit/browser/quota/storage_monitor.cc +++ b/webkit/browser/quota/storage_monitor.cc @@ -11,7 +11,7 @@ #include "webkit/browser/quota/quota_manager.h" #include "webkit/common/quota/quota_status_code.h" -namespace quota { +namespace storage { // StorageObserverList: @@ -376,4 +376,4 @@ void StorageMonitor::NotifyUsageChange( it->second->NotifyUsageChange(filter, delta); } -} // namespace quota +} // namespace storage diff --git a/webkit/browser/quota/storage_monitor.h b/webkit/browser/quota/storage_monitor.h index e52fd18d..0550ecf 100644 --- a/webkit/browser/quota/storage_monitor.h +++ b/webkit/browser/quota/storage_monitor.h @@ -16,7 +16,7 @@ namespace content { class StorageMonitorTestBase; } -namespace quota { +namespace storage { class QuotaManager; @@ -175,6 +175,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE StorageMonitor { DISALLOW_COPY_AND_ASSIGN(StorageMonitor); }; -} // namespace quota +} // namespace storage #endif // WEBKIT_BROWSER_QUOTA_STORAGE_MONITOR_H_ diff --git a/webkit/browser/quota/storage_observer.cc b/webkit/browser/quota/storage_observer.cc index 907ed59..ec0fe23 100644 --- a/webkit/browser/quota/storage_observer.cc +++ b/webkit/browser/quota/storage_observer.cc @@ -4,7 +4,7 @@ #include "webkit/browser/quota/storage_observer.h" -namespace quota { +namespace storage { // StorageObserver::Filter @@ -62,4 +62,4 @@ bool StorageObserver::Event::operator==(const Event& other) const { quota == other.quota; } -} // namespace quota +} // namespace storage diff --git a/webkit/browser/quota/storage_observer.h b/webkit/browser/quota/storage_observer.h index bc6389d..513f448 100644 --- a/webkit/browser/quota/storage_observer.h +++ b/webkit/browser/quota/storage_observer.h @@ -11,7 +11,7 @@ #include "webkit/browser/quota/quota_client.h" #include "webkit/common/quota/quota_types.h" -namespace quota { +namespace storage { // This interface is implemented by observers that wish to monitor storage // events, such as changes in quota or usage. @@ -74,6 +74,6 @@ class WEBKIT_STORAGE_BROWSER_EXPORT StorageObserver { virtual ~StorageObserver() {} }; -} // namespace quota +} // namespace storage #endif // WEBKIT_BROWSER_QUOTA_STORAGE_OBSERVER_H_ diff --git a/webkit/browser/quota/usage_tracker.cc b/webkit/browser/quota/usage_tracker.cc index 2e4659f..c2aa4c6 100644 --- a/webkit/browser/quota/usage_tracker.cc +++ b/webkit/browser/quota/usage_tracker.cc @@ -17,7 +17,7 @@ #include "webkit/browser/quota/storage_monitor.h" #include "webkit/browser/quota/storage_observer.h" -namespace quota { +namespace storage { namespace { @@ -691,4 +691,4 @@ bool ClientUsageTracker::IsStorageUnlimited(const GURL& origin) const { special_storage_policy_->IsStorageUnlimited(origin); } -} // namespace quota +} // namespace storage diff --git a/webkit/browser/quota/usage_tracker.h b/webkit/browser/quota/usage_tracker.h index 91bd18c..e807884 100644 --- a/webkit/browser/quota/usage_tracker.h +++ b/webkit/browser/quota/usage_tracker.h @@ -22,7 +22,7 @@ #include "webkit/browser/webkit_storage_browser_export.h" #include "webkit/common/quota/quota_types.h" -namespace quota { +namespace storage { class ClientUsageTracker; class StorageMonitor; @@ -197,6 +197,6 @@ class ClientUsageTracker : public SpecialStoragePolicy::Observer, DISALLOW_COPY_AND_ASSIGN(ClientUsageTracker); }; -} // namespace quota +} // namespace storage #endif // WEBKIT_BROWSER_QUOTA_USAGE_TRACKER_H_ |