OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, SYNC_FILE_TYPE_FILE), | 1921 FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, SYNC_FILE_TYPE_FILE), |
1922 base::Bind(&DriveFileSyncService::DidResolveConflictToLocalChange, | 1922 base::Bind(&DriveFileSyncService::DidResolveConflictToLocalChange, |
1923 AsWeakPtr(), base::Passed(¶m))); | 1923 AsWeakPtr(), base::Passed(¶m))); |
1924 } | 1924 } |
1925 | 1925 |
1926 void DriveFileSyncService::StartOverRemoteSync( | 1926 void DriveFileSyncService::StartOverRemoteSync( |
1927 scoped_ptr<ProcessRemoteChangeParam> param, | 1927 scoped_ptr<ProcessRemoteChangeParam> param, |
1928 SyncStatusCode status) { | 1928 SyncStatusCode status) { |
1929 DCHECK(param); | 1929 DCHECK(param); |
1930 SyncFileMetadata& local_metadata = param->local_metadata; | 1930 SyncFileMetadata& local_metadata = param->local_metadata; |
1931 pending_tasks_.push_front(base::Bind( | 1931 DidPrepareForProcessRemoteChange( |
1932 &DriveFileSyncService::DidPrepareForProcessRemoteChange, | 1932 param.Pass(), status, local_metadata, FileChangeList()); |
1933 AsWeakPtr(), base::Passed(¶m), status, | |
1934 local_metadata, FileChangeList())); | |
1935 param->token->ResetTask(FROM_HERE); | |
1936 NotifyTaskDone(status, param->token.Pass()); | |
1937 } | 1933 } |
1938 | 1934 |
1939 bool DriveFileSyncService::AppendRemoteChange( | 1935 bool DriveFileSyncService::AppendRemoteChange( |
1940 const GURL& origin, | 1936 const GURL& origin, |
1941 const google_apis::ResourceEntry& entry, | 1937 const google_apis::ResourceEntry& entry, |
1942 int64 changestamp, | 1938 int64 changestamp, |
1943 RemoteSyncType sync_type) { | 1939 RemoteSyncType sync_type) { |
1944 // TODO(tzik): Normalize the path here. | 1940 // TODO(tzik): Normalize the path here. |
1945 base::FilePath path = base::FilePath::FromUTF8Unsafe(entry.title()); | 1941 base::FilePath path = base::FilePath::FromUTF8Unsafe(entry.title()); |
1946 if (entry.is_folder()) | 1942 if (entry.is_folder()) |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2465 pending_batch_sync_origins_.insert(origin); | 2461 pending_batch_sync_origins_.insert(origin); |
2466 } | 2462 } |
2467 callback.Run(status, resource_id); | 2463 callback.Run(status, resource_id); |
2468 } | 2464 } |
2469 | 2465 |
2470 std::string DriveFileSyncService::sync_root_resource_id() { | 2466 std::string DriveFileSyncService::sync_root_resource_id() { |
2471 return metadata_store_->sync_root_directory(); | 2467 return metadata_store_->sync_root_directory(); |
2472 } | 2468 } |
2473 | 2469 |
2474 } // namespace sync_file_system | 2470 } // namespace sync_file_system |
OLD | NEW |