OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/local/local_file_sync_context.h" | 5 #include "chrome/browser/sync_file_system/local/local_file_sync_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 FROM_HERE, | 456 FROM_HERE, |
457 base::Bind(&LocalFileSyncContext::GetFileMetadata, this, | 457 base::Bind(&LocalFileSyncContext::GetFileMetadata, this, |
458 make_scoped_refptr(file_system_context), url, callback)); | 458 make_scoped_refptr(file_system_context), url, callback)); |
459 return; | 459 return; |
460 } | 460 } |
461 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); | 461 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); |
462 | 462 |
463 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( | 463 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( |
464 file_system_context, url); | 464 file_system_context, url); |
465 file_system_context->operation_runner()->GetMetadata( | 465 file_system_context->operation_runner()->GetMetadata( |
466 url_for_sync, base::Bind(&LocalFileSyncContext::DidGetFileMetadata, | 466 url_for_sync, FileSystemOperation::GET_METADATA_FIELD_IS_DIRECTORY | |
467 this, callback)); | 467 FileSystemOperation::GET_METADATA_FIELD_SIZE | |
| 468 FileSystemOperation::GET_METADATA_FIELD_LAST_MODIFIED, |
| 469 base::Bind(&LocalFileSyncContext::DidGetFileMetadata, this, callback)); |
468 } | 470 } |
469 | 471 |
470 void LocalFileSyncContext::HasPendingLocalChanges( | 472 void LocalFileSyncContext::HasPendingLocalChanges( |
471 FileSystemContext* file_system_context, | 473 FileSystemContext* file_system_context, |
472 const FileSystemURL& url, | 474 const FileSystemURL& url, |
473 const HasPendingLocalChangeCallback& callback) { | 475 const HasPendingLocalChangeCallback& callback) { |
474 // This gets called on UI thread and relays the task on FILE thread. | 476 // This gets called on UI thread and relays the task on FILE thread. |
475 DCHECK(file_system_context); | 477 DCHECK(file_system_context); |
476 if (!file_system_context->default_file_task_runner()-> | 478 if (!file_system_context->default_file_task_runner()-> |
477 RunsTasksOnCurrentThread()) { | 479 RunsTasksOnCurrentThread()) { |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 return; | 1073 return; |
1072 } | 1074 } |
1073 | 1075 |
1074 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( | 1076 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( |
1075 file_system_context, dest_url); | 1077 file_system_context, dest_url); |
1076 file_system_context->operation_runner()->CopyInForeignFile( | 1078 file_system_context->operation_runner()->CopyInForeignFile( |
1077 local_path, url_for_sync, callback); | 1079 local_path, url_for_sync, callback); |
1078 } | 1080 } |
1079 | 1081 |
1080 } // namespace sync_file_system | 1082 } // namespace sync_file_system |
OLD | NEW |