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

Unified Diff: chrome/browser/sync_file_system/drive_file_sync_service.cc

Issue 12315004: Migrated sync_file_type and file_change from namespace fileapi to sync_file_system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: f Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync_file_system/drive_file_sync_service.cc
diff --git a/chrome/browser/sync_file_system/drive_file_sync_service.cc b/chrome/browser/sync_file_system/drive_file_sync_service.cc
index 81c827e5ad30271d926eeb999aeffe0572c5209e..131b962b2bd2af31e290a196fe5b14ba3556f980 100644
--- a/chrome/browser/sync_file_system/drive_file_sync_service.cc
+++ b/chrome/browser/sync_file_system/drive_file_sync_service.cc
@@ -83,13 +83,11 @@ void DidRemoveOrigin(const GURL& origin, fileapi::SyncStatusCode status) {
<< " status=" << status;
}
-fileapi::FileChange CreateFileChange(bool is_deleted) {
+FileChange CreateFileChange(bool is_deleted) {
if (is_deleted) {
- return fileapi::FileChange(fileapi::FileChange::FILE_CHANGE_DELETE,
- fileapi::SYNC_FILE_TYPE_UNKNOWN);
+ return FileChange(FileChange::FILE_CHANGE_DELETE, SYNC_FILE_TYPE_UNKNOWN);
}
- return fileapi::FileChange(fileapi::FileChange::FILE_CHANGE_ADD_OR_UPDATE,
- fileapi::SYNC_FILE_TYPE_FILE);
+ return FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, SYNC_FILE_TYPE_FILE);
}
} // namespace
@@ -229,8 +227,7 @@ bool DriveFileSyncService::ChangeQueueComparator::operator()(
DriveFileSyncService::RemoteChange::RemoteChange()
: changestamp(0),
sync_type(REMOTE_SYNC_TYPE_INCREMENTAL),
- change(fileapi::FileChange::FILE_CHANGE_ADD_OR_UPDATE,
- fileapi::SYNC_FILE_TYPE_UNKNOWN) {
+ change(FileChange::FILE_CHANGE_ADD_OR_UPDATE, SYNC_FILE_TYPE_UNKNOWN) {
}
DriveFileSyncService::RemoteChange::RemoteChange(
@@ -239,7 +236,7 @@ DriveFileSyncService::RemoteChange::RemoteChange(
const std::string& md5_checksum,
RemoteSyncType sync_type,
const fileapi::FileSystemURL& url,
- const fileapi::FileChange& change,
+ const FileChange& change,
PendingChangeQueue::iterator position_in_queue)
: changestamp(changestamp),
resource_id(resource_id),
@@ -518,7 +515,7 @@ void DriveFileSyncService::SetSyncEnabled(bool enabled) {
}
void DriveFileSyncService::ApplyLocalChange(
- const fileapi::FileChange& local_file_change,
+ const FileChange& local_file_change,
const base::FilePath& local_file_path,
const fileapi::FileSystemURL& url,
const fileapi::SyncStatusCallback& callback) {
@@ -1072,11 +1069,11 @@ void DriveFileSyncService::DidGetRemoteFileMetadata(
const fileapi::SyncFileMetadataCallback& callback,
google_apis::GDataErrorCode error,
scoped_ptr<google_apis::ResourceEntry> entry) {
- fileapi::SyncFileType file_type = fileapi::SYNC_FILE_TYPE_UNKNOWN;
+ SyncFileType file_type = SYNC_FILE_TYPE_UNKNOWN;
if (entry->is_file())
- file_type = fileapi::SYNC_FILE_TYPE_FILE;
+ file_type = SYNC_FILE_TYPE_FILE;
else if (entry->is_folder())
- file_type = fileapi::SYNC_FILE_TYPE_DIRECTORY;
+ file_type = SYNC_FILE_TYPE_DIRECTORY;
callback.Run(GDataErrorCodeToSyncStatusCodeWrapper(error),
fileapi::SyncFileMetadata(file_type,
entry->file_size(),
@@ -1085,7 +1082,7 @@ void DriveFileSyncService::DidGetRemoteFileMetadata(
DriveFileSyncService::LocalSyncOperationType
DriveFileSyncService::ResolveLocalSyncOperationType(
- const fileapi::FileChange& local_file_change,
+ const FileChange& local_file_change,
const fileapi::FileSystemURL& url) {
DriveMetadata metadata;
const bool has_metadata =
@@ -1108,7 +1105,7 @@ DriveFileSyncService::ResolveLocalSyncOperationType(
if (has_remote_change) {
// Remote change for the file identified by |url| exists in the pending
// change queue.
- const fileapi::FileChange& remote_file_change = remote_change.change;
+ const FileChange& remote_file_change = remote_change.change;
// (RemoteChange) + (LocalChange) -> (Operation Type)
// AddOrUpdate + AddOrUpdate -> CONFLICT
@@ -1315,7 +1312,7 @@ void DriveFileSyncService::DidPrepareForProcessRemoteChange(
scoped_ptr<ProcessRemoteChangeParam> param,
fileapi::SyncStatusCode status,
const fileapi::SyncFileMetadata& metadata,
- const fileapi::FileChangeList& local_changes) {
+ const FileChangeList& local_changes) {
if (status != fileapi::SYNC_STATUS_OK) {
AbortRemoteSync(param.Pass(), status);
return;
@@ -1323,7 +1320,7 @@ void DriveFileSyncService::DidPrepareForProcessRemoteChange(
const fileapi::FileSystemURL& url = param->remote_change.url;
const DriveMetadata& drive_metadata = param->drive_metadata;
- const fileapi::FileChange& remote_file_change = param->remote_change.change;
+ const FileChange& remote_file_change = param->remote_change.change;
status = metadata_store_->ReadEntry(param->remote_change.url,
&param->drive_metadata);
@@ -1338,7 +1335,7 @@ void DriveFileSyncService::DidPrepareForProcessRemoteChange(
param->drive_metadata.set_to_be_fetched(false);
}
bool missing_local_file =
- (metadata.file_type == fileapi::SYNC_FILE_TYPE_UNKNOWN);
+ (metadata.file_type == SYNC_FILE_TYPE_UNKNOWN);
if (param->drive_metadata.conflicted()) {
if (missing_local_file) {
@@ -1393,8 +1390,7 @@ void DriveFileSyncService::DidPrepareForProcessRemoteChange(
RemoteChangeProcessor* processor = param->processor;
processor->RecordFakeLocalChange(
url,
- fileapi::FileChange(fileapi::FileChange::FILE_CHANGE_ADD_OR_UPDATE,
- fileapi::SYNC_FILE_TYPE_FILE),
+ FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, SYNC_FILE_TYPE_FILE),
base::Bind(&DriveFileSyncService::DidResolveConflictToLocalChange,
AsWeakPtr(), base::Passed(&param)));
return;
@@ -1450,7 +1446,7 @@ void DriveFileSyncService::DidPrepareForProcessRemoteChange(
DCHECK(!missing_local_file);
param->sync_action = fileapi::SYNC_ACTION_DELETED;
- const fileapi::FileChange& file_change = remote_file_change;
+ const FileChange& file_change = remote_file_change;
param->processor->ApplyRemoteChange(
file_change, base::FilePath(), url,
base::Bind(&DriveFileSyncService::DidApplyRemoteChange, AsWeakPtr(),
@@ -1542,7 +1538,7 @@ void DriveFileSyncService::DidDownloadFileForRemoteSync(
}
param->drive_metadata.set_md5_checksum(md5_checksum);
- const fileapi::FileChange& change = param->remote_change.change;
+ const FileChange& change = param->remote_change.change;
const base::FilePath& temporary_file_path = param->temporary_file_path;
const fileapi::FileSystemURL& url = param->remote_change.url;
param->processor->ApplyRemoteChange(
@@ -1743,7 +1739,7 @@ bool DriveFileSyncService::AppendRemoteChangeInternal(
remote_resource_id != local_resource_id)
return false;
- fileapi::FileChange file_change(CreateFileChange(is_deleted));
+ FileChange file_change(CreateFileChange(is_deleted));
// Do not return in this block. These changes should be done together.
{

Powered by Google App Engine
This is Rietveld 408576698