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/location.h" | 8 #include "base/location.h" |
9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 452 |
453 void LocalFileSyncContext::InitializeFileSystemContextOnIOThread( | 453 void LocalFileSyncContext::InitializeFileSystemContextOnIOThread( |
454 const GURL& source_url, | 454 const GURL& source_url, |
455 FileSystemContext* file_system_context) { | 455 FileSystemContext* file_system_context) { |
456 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); | 456 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); |
457 DCHECK(file_system_context); | 457 DCHECK(file_system_context); |
458 SyncFileSystemBackend* backend = | 458 SyncFileSystemBackend* backend = |
459 SyncFileSystemBackend::GetBackend(file_system_context); | 459 SyncFileSystemBackend::GetBackend(file_system_context); |
460 DCHECK(backend); | 460 DCHECK(backend); |
461 if (!backend->change_tracker()) { | 461 if (!backend->change_tracker()) { |
462 // First registers the service name. | |
463 RegisterSyncableFileSystem(); | |
464 // Create and initialize LocalFileChangeTracker and call back this method | 462 // Create and initialize LocalFileChangeTracker and call back this method |
465 // later again. | 463 // later again. |
466 std::set<GURL>* origins_with_changes = new std::set<GURL>; | 464 std::set<GURL>* origins_with_changes = new std::set<GURL>; |
467 scoped_ptr<LocalFileChangeTracker>* tracker_ptr( | 465 scoped_ptr<LocalFileChangeTracker>* tracker_ptr( |
468 new scoped_ptr<LocalFileChangeTracker>); | 466 new scoped_ptr<LocalFileChangeTracker>); |
469 base::PostTaskAndReplyWithResult( | 467 base::PostTaskAndReplyWithResult( |
470 file_system_context->default_file_task_runner(), | 468 file_system_context->default_file_task_runner(), |
471 FROM_HERE, | 469 FROM_HERE, |
472 base::Bind(&LocalFileSyncContext::InitializeChangeTrackerOnFileThread, | 470 base::Bind(&LocalFileSyncContext::InitializeChangeTrackerOnFileThread, |
473 this, tracker_ptr, | 471 this, tracker_ptr, |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 return; | 760 return; |
763 } | 761 } |
764 | 762 |
765 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( | 763 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( |
766 file_system_context, dest_url); | 764 file_system_context, dest_url); |
767 file_system_context->operation_runner()->CopyInForeignFile( | 765 file_system_context->operation_runner()->CopyInForeignFile( |
768 local_path, url_for_sync, callback); | 766 local_path, url_for_sync, callback); |
769 } | 767 } |
770 | 768 |
771 } // namespace sync_file_system | 769 } // namespace sync_file_system |
OLD | NEW |