diff options
Diffstat (limited to 'webkit/fileapi/syncable')
12 files changed, 43 insertions, 42 deletions
diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.cc b/webkit/fileapi/syncable/canned_syncable_file_system.cc index e2746e5..d6c7c4d 100644 --- a/webkit/fileapi/syncable/canned_syncable_file_system.cc +++ b/webkit/fileapi/syncable/canned_syncable_file_system.cc @@ -89,7 +89,7 @@ void OnGetMetadataAndVerifyData( const CannedSyncableFileSystem::StatusCallback& callback, base::PlatformFileError result, const base::PlatformFileInfo& file_info, - const FilePath& platform_path) { + const base::FilePath& platform_path) { if (result != base::PLATFORM_FILE_OK) { callback.Run(result); return; @@ -104,11 +104,11 @@ void OnGetMetadataAndVerifyData( void OnGetMetadata( base::PlatformFileInfo* file_info_out, - FilePath* platform_path_out, + base::FilePath* platform_path_out, const CannedSyncableFileSystem::StatusCallback& callback, base::PlatformFileError result, const base::PlatformFileInfo& file_info, - const FilePath& platform_path) { + const base::FilePath& platform_path) { DCHECK(file_info_out); DCHECK(platform_path_out); *file_info_out = file_info; @@ -375,7 +375,7 @@ PlatformFileError CannedSyncableFileSystem::VerifyFile( PlatformFileError CannedSyncableFileSystem::GetMetadata( const FileSystemURL& url, base::PlatformFileInfo* info, - FilePath* platform_path) { + base::FilePath* platform_path) { return RunOnThread<PlatformFileError>( io_task_runner_, FROM_HERE, @@ -540,7 +540,7 @@ void CannedSyncableFileSystem::DoVerifyFile( void CannedSyncableFileSystem::DoGetMetadata( const FileSystemURL& url, base::PlatformFileInfo* info, - FilePath* platform_path, + base::FilePath* platform_path, const StatusCallback& callback) { EXPECT_TRUE(is_filesystem_opened_); NewOperation()->GetMetadata( diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.h b/webkit/fileapi/syncable/canned_syncable_file_system.h index f297068..d520387 100644 --- a/webkit/fileapi/syncable/canned_syncable_file_system.h +++ b/webkit/fileapi/syncable/canned_syncable_file_system.h @@ -110,7 +110,7 @@ class CannedSyncableFileSystem const std::string& expected_data); base::PlatformFileError GetMetadata(const FileSystemURL& url, base::PlatformFileInfo* info, - FilePath* platform_path); + base::FilePath* platform_path); // Returns the # of bytes written (>=0) or an error code (<0). int64 Write(net::URLRequestContext* url_request_context, @@ -172,7 +172,7 @@ class CannedSyncableFileSystem const StatusCallback& callback); void DoGetMetadata(const FileSystemURL& url, base::PlatformFileInfo* info, - FilePath* platform_path, + base::FilePath* platform_path, const StatusCallback& callback); void DoWrite(net::URLRequestContext* url_request_context, const FileSystemURL& url, diff --git a/webkit/fileapi/syncable/local_file_change_tracker.cc b/webkit/fileapi/syncable/local_file_change_tracker.cc index b5ee20d..4257350 100644 --- a/webkit/fileapi/syncable/local_file_change_tracker.cc +++ b/webkit/fileapi/syncable/local_file_change_tracker.cc @@ -21,7 +21,7 @@ namespace fileapi { namespace { -const FilePath::CharType kDatabaseName[] = +const base::FilePath::CharType kDatabaseName[] = FILE_PATH_LITERAL("LocalFileChangeTracker"); const char kMark[] = "d"; } // namespace @@ -30,7 +30,7 @@ const char kMark[] = "d"; // object must be destructed on file_task_runner. class LocalFileChangeTracker::TrackerDB { public: - explicit TrackerDB(const FilePath& base_path); + explicit TrackerDB(const base::FilePath& base_path); SyncStatusCode MarkDirty(const std::string& url); SyncStatusCode ClearDirty(const std::string& url); @@ -47,7 +47,7 @@ class LocalFileChangeTracker::TrackerDB { void HandleError(const tracked_objects::Location& from_here, const leveldb::Status& status); - const FilePath base_path_; + const base::FilePath base_path_; scoped_ptr<leveldb::DB> db_; SyncStatusCode db_status_; @@ -60,7 +60,7 @@ LocalFileChangeTracker::ChangeInfo::~ChangeInfo() {} // LocalFileChangeTracker ------------------------------------------------------ LocalFileChangeTracker::LocalFileChangeTracker( - const FilePath& base_path, + const base::FilePath& base_path, base::SequencedTaskRunner* file_task_runner) : initialized_(false), file_task_runner_(file_task_runner), @@ -217,7 +217,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges( new FileSystemOperationContext(file_system_context)); base::PlatformFileInfo file_info; - FilePath platform_path; + base::FilePath platform_path; while (!dirty_files.empty()) { const FileSystemURL url = dirty_files.front(); @@ -241,7 +241,7 @@ SyncStatusCode LocalFileChangeTracker::CollectLastDirtyChanges( file_util->CreateFileEnumerator(context.get(), url, false /* recursive */)); - FilePath path_each; + base::FilePath path_each; while (!(path_each = enumerator->Next()).empty()) { dirty_files.push(CreateSyncableFileSystemURL( url.origin(), url.filesystem_id(), path_each)); @@ -288,7 +288,7 @@ void LocalFileChangeTracker::RecordChange( // TrackerDB ------------------------------------------------------------------- -LocalFileChangeTracker::TrackerDB::TrackerDB(const FilePath& base_path) +LocalFileChangeTracker::TrackerDB::TrackerDB(const base::FilePath& base_path) : base_path_(base_path), db_status_(SYNC_STATUS_OK) {} diff --git a/webkit/fileapi/syncable/local_file_change_tracker.h b/webkit/fileapi/syncable/local_file_change_tracker.h index 9636027..b92ddaa 100644 --- a/webkit/fileapi/syncable/local_file_change_tracker.h +++ b/webkit/fileapi/syncable/local_file_change_tracker.h @@ -39,7 +39,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileChangeTracker // |file_task_runner| must be the one where the observee file operations run. // (So that we can make sure DB operations are done before actual update // happens) - LocalFileChangeTracker(const FilePath& base_path, + LocalFileChangeTracker(const base::FilePath& base_path, base::SequencedTaskRunner* file_task_runner); virtual ~LocalFileChangeTracker(); diff --git a/webkit/fileapi/syncable/local_file_sync_context.cc b/webkit/fileapi/syncable/local_file_sync_context.cc index 367e848..b237aaa 100644 --- a/webkit/fileapi/syncable/local_file_sync_context.cc +++ b/webkit/fileapi/syncable/local_file_sync_context.cc @@ -174,7 +174,7 @@ void LocalFileSyncContext::RegisterURLForWaitingSync( void LocalFileSyncContext::ApplyRemoteChange( FileSystemContext* file_system_context, const FileChange& change, - const FilePath& local_path, + const base::FilePath& local_path, const FileSystemURL& url, const SyncStatusCallback& callback) { if (!io_task_runner_->RunsTasksOnCurrentThread()) { @@ -564,7 +564,7 @@ void LocalFileSyncContext::DidGetWritingStatusForSync( FileChangeList changes; file_system_context->change_tracker()->GetChangesForURL(url, &changes); - FilePath platform_path; + base::FilePath platform_path; base::PlatformFileInfo file_info; FileSystemFileUtil* file_util = file_system_context->GetFileUtil(url.type()); DCHECK(file_util); @@ -624,7 +624,7 @@ void LocalFileSyncContext::DidGetFileMetadata( const SyncFileMetadataCallback& callback, base::PlatformFileError file_error, const base::PlatformFileInfo& file_info, - const FilePath& platform_path) { + const base::FilePath& platform_path) { DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); SyncFileMetadata metadata; if (file_error == base::PLATFORM_FILE_OK) { diff --git a/webkit/fileapi/syncable/local_file_sync_context.h b/webkit/fileapi/syncable/local_file_sync_context.h index 6ffc901..a2107f2a 100644 --- a/webkit/fileapi/syncable/local_file_sync_context.h +++ b/webkit/fileapi/syncable/local_file_sync_context.h @@ -115,7 +115,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSyncContext void ApplyRemoteChange( FileSystemContext* file_system_context, const FileChange& change, - const FilePath& local_path, + const base::FilePath& local_path, const FileSystemURL& url, const SyncStatusCallback& callback); @@ -236,7 +236,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSyncContext const SyncFileMetadataCallback& callback, base::PlatformFileError file_error, const base::PlatformFileInfo& file_info, - const FilePath& platform_path); + const base::FilePath& platform_path); base::TimeDelta NotifyChangesDuration(); diff --git a/webkit/fileapi/syncable/local_file_sync_context_unittest.cc b/webkit/fileapi/syncable/local_file_sync_context_unittest.cc index 0f2ad44..4cb59c7 100644 --- a/webkit/fileapi/syncable/local_file_sync_context_unittest.cc +++ b/webkit/fileapi/syncable/local_file_sync_context_unittest.cc @@ -119,7 +119,7 @@ class LocalFileSyncContextTest : public testing::Test { SyncStatusCode ApplyRemoteChange(FileSystemContext* file_system_context, const FileChange& change, - const FilePath& local_path, + const base::FilePath& local_path, const FileSystemURL& url, SyncFileType expected_file_type) { SCOPED_TRACE(testing::Message() << "ApplyChange for " << @@ -431,7 +431,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion) { SYNC_FILE_TYPE_FILE); EXPECT_EQ(SYNC_STATUS_OK, ApplyRemoteChange(file_system.file_system_context(), - change, FilePath(), kFile, + change, base::FilePath(), kFile, SYNC_FILE_TYPE_FILE)); // The implementation doesn't check file type for deletion, and it must be ok @@ -439,7 +439,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForDeletion) { change = FileChange(FileChange::FILE_CHANGE_DELETE, SYNC_FILE_TYPE_UNKNOWN); EXPECT_EQ(SYNC_STATUS_OK, ApplyRemoteChange(file_system.file_system_context(), - change, FilePath(), kDir, + change, base::FilePath(), kDir, SYNC_FILE_TYPE_DIRECTORY)); // Check the directory/files are deleted successfully. @@ -506,8 +506,8 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { file_system.ClearChangeForURLInTracker(*urls.begin()); // Prepare temporary files which represent the remote file data. - const FilePath kFilePath1(temp_dir.path().Append(FPL("file1"))); - const FilePath kFilePath2(temp_dir.path().Append(FPL("file2"))); + const base::FilePath kFilePath1(temp_dir.path().Append(FPL("file1"))); + const base::FilePath kFilePath2(temp_dir.path().Append(FPL("file2"))); ASSERT_EQ(static_cast<int>(arraysize(kTestFileData1) - 1), file_util::WriteFile(kFilePath1, kTestFileData1, @@ -565,7 +565,7 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) { SYNC_FILE_TYPE_DIRECTORY); EXPECT_EQ(SYNC_STATUS_OK, ApplyRemoteChange(file_system.file_system_context(), - change, FilePath(), kDir, + change, base::FilePath(), kDir, SYNC_FILE_TYPE_UNKNOWN)); // This should not happen, but calling ApplyRemoteChange diff --git a/webkit/fileapi/syncable/sync_file_metadata.h b/webkit/fileapi/syncable/sync_file_metadata.h index 266241f..097c377 100644 --- a/webkit/fileapi/syncable/sync_file_metadata.h +++ b/webkit/fileapi/syncable/sync_file_metadata.h @@ -43,7 +43,7 @@ struct WEBKIT_STORAGE_EXPORT LocalFileSyncInfo { ~LocalFileSyncInfo(); FileSystemURL url; - FilePath local_file_path; + base::FilePath local_file_path; SyncFileMetadata metadata; FileChangeList changes; }; diff --git a/webkit/fileapi/syncable/syncable_file_system_operation.cc b/webkit/fileapi/syncable/syncable_file_system_operation.cc index 0387535..e2145b5 100644 --- a/webkit/fileapi/syncable/syncable_file_system_operation.cc +++ b/webkit/fileapi/syncable/syncable_file_system_operation.cc @@ -183,7 +183,7 @@ void SyncableFileSystemOperation::GetMetadata( DCHECK(CalledOnValidThread()); if (!operation_runner_) { callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, - base::PlatformFileInfo(), FilePath()); + base::PlatformFileInfo(), base::FilePath()); delete file_system_operation_; delete this; return; @@ -330,7 +330,7 @@ void SyncableFileSystemOperation::CreateSnapshotFile( DCHECK(CalledOnValidThread()); if (!operation_runner_) { callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, - base::PlatformFileInfo(), FilePath(), NULL); + base::PlatformFileInfo(), base::FilePath(), NULL); delete file_system_operation_; delete this; return; diff --git a/webkit/fileapi/syncable/syncable_file_system_util.cc b/webkit/fileapi/syncable/syncable_file_system_util.cc index e8d87d9..efb9122 100644 --- a/webkit/fileapi/syncable/syncable_file_system_util.cc +++ b/webkit/fileapi/syncable/syncable_file_system_util.cc @@ -14,7 +14,7 @@ namespace fileapi { bool RegisterSyncableFileSystem(const std::string& service_name) { return ExternalMountPoints::GetSystemInstance()->RegisterFileSystem( - service_name, kFileSystemTypeSyncable, FilePath()); + service_name, kFileSystemTypeSyncable, base::FilePath()); } bool RevokeSyncableFileSystem(const std::string& service_name) { @@ -33,11 +33,11 @@ GURL GetSyncableFileSystemRootURI(const GURL& origin, FileSystemURL CreateSyncableFileSystemURL(const GURL& origin, const std::string& service_name, - const FilePath& path) { + const base::FilePath& path) { return ExternalMountPoints::GetSystemInstance()->CreateCrackedFileSystemURL( origin, kFileSystemTypeExternal, - FilePath::FromUTF8Unsafe(service_name).Append(path)); + base::FilePath::FromUTF8Unsafe(service_name).Append(path)); } bool SerializeSyncableFileSystemURL(const FileSystemURL& url, diff --git a/webkit/fileapi/syncable/syncable_file_system_util.h b/webkit/fileapi/syncable/syncable_file_system_util.h index 439a086..542856c 100644 --- a/webkit/fileapi/syncable/syncable_file_system_util.h +++ b/webkit/fileapi/syncable/syncable_file_system_util.h @@ -38,7 +38,8 @@ WEBKIT_STORAGE_EXPORT GURL GetSyncableFileSystemRootURI( // path: '/foo/bar', // returns 'filesystem:http://www.example.com/external/service_name/foo/bar' WEBKIT_STORAGE_EXPORT FileSystemURL CreateSyncableFileSystemURL( - const GURL& origin, const std::string& service_name, const FilePath& path); + const GURL& origin, const std::string& service_name, + const base::FilePath& path); // Serializes a given FileSystemURL |url| and sets the serialized string to // |serialized_url|. If the URL does not represent a syncable filesystem, diff --git a/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc b/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc index 91b0baa..6e8dcc0 100644 --- a/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc +++ b/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc @@ -25,14 +25,14 @@ const char kNonSyncableFileSystemRootURI[] = const char kOrigin[] = "http://www.example.com/"; const char kServiceName[] = "service"; -const FilePath::CharType kPath[] = FILE_PATH_LITERAL("dir/file"); +const base::FilePath::CharType kPath[] = FILE_PATH_LITERAL("dir/file"); FileSystemURL CreateFileSystemURL(const std::string& url) { return ExternalMountPoints::GetSystemInstance()->CrackURL(GURL(url)); } -FilePath CreateNormalizedFilePath(const FilePath::CharType* path) { - return FilePath(path).NormalizePathSeparators(); +base::FilePath CreateNormalizedFilePath(const base::FilePath::CharType* path) { + return base::FilePath(path).NormalizePathSeparators(); } } // namespace @@ -45,9 +45,9 @@ TEST(SyncableFileSystemUtilTest, GetSyncableFileSystemRootURI) { TEST(SyncableFileSystemUtilTest, CreateSyncableFileSystemURL) { ScopedExternalFileSystem scoped_fs( - kServiceName, kFileSystemTypeSyncable, FilePath()); + kServiceName, kFileSystemTypeSyncable, base::FilePath()); - const FilePath path(kPath); + const base::FilePath path(kPath); const FileSystemURL expected_url = CreateFileSystemURL(kSyncableFileSystemRootURI + path.AsUTF8Unsafe()); const FileSystemURL url = @@ -60,13 +60,13 @@ TEST(SyncableFileSystemUtilTest, CreateSyncableFileSystemURL) { TEST(SyncableFileSystemUtilTest, SerializeAndDesirializeSyncableFileSystemURL) { ScopedExternalFileSystem scoped_fs( - kServiceName, kFileSystemTypeSyncable, FilePath()); + kServiceName, kFileSystemTypeSyncable, base::FilePath()); const std::string expected_url_str = kSyncableFileSystemRootURI + CreateNormalizedFilePath(kPath).AsUTF8Unsafe(); const FileSystemURL expected_url = CreateFileSystemURL(expected_url_str); const FileSystemURL url = - CreateSyncableFileSystemURL(GURL(kOrigin), kServiceName, FilePath(kPath)); + CreateSyncableFileSystemURL(GURL(kOrigin), kServiceName, base::FilePath(kPath)); std::string serialized; EXPECT_TRUE(SerializeSyncableFileSystemURL(url, &serialized)); @@ -81,9 +81,9 @@ TEST(SyncableFileSystemUtilTest, TEST(SyncableFileSystemUtilTest, FailInSerializingAndDeserializingSyncableFileSystemURL) { ScopedExternalFileSystem scoped_fs( - kServiceName, kFileSystemTypeSyncable, FilePath()); + kServiceName, kFileSystemTypeSyncable, base::FilePath()); - const FilePath normalized_path = CreateNormalizedFilePath(kPath); + const base::FilePath normalized_path = CreateNormalizedFilePath(kPath); const std::string non_registered_url = kNonRegisteredFileSystemRootURI + normalized_path.AsUTF8Unsafe(); const std::string non_syncable_url = |