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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 488 |
489 void LocalFileSyncContext::InitializeFileSystemContextOnIOThread( | 489 void LocalFileSyncContext::InitializeFileSystemContextOnIOThread( |
490 const GURL& source_url, | 490 const GURL& source_url, |
491 FileSystemContext* file_system_context) { | 491 FileSystemContext* file_system_context) { |
492 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); | 492 DCHECK(io_task_runner_->RunsTasksOnCurrentThread()); |
493 DCHECK(file_system_context); | 493 DCHECK(file_system_context); |
494 SyncFileSystemBackend* backend = | 494 SyncFileSystemBackend* backend = |
495 SyncFileSystemBackend::GetBackend(file_system_context); | 495 SyncFileSystemBackend::GetBackend(file_system_context); |
496 DCHECK(backend); | 496 DCHECK(backend); |
497 if (!backend->change_tracker()) { | 497 if (!backend->change_tracker()) { |
498 // First registers the service name. | |
499 RegisterSyncableFileSystem(); | |
500 // Create and initialize LocalFileChangeTracker and call back this method | 498 // Create and initialize LocalFileChangeTracker and call back this method |
501 // later again. | 499 // later again. |
502 std::set<GURL>* origins_with_changes = new std::set<GURL>; | 500 std::set<GURL>* origins_with_changes = new std::set<GURL>; |
503 scoped_ptr<LocalFileChangeTracker>* tracker_ptr( | 501 scoped_ptr<LocalFileChangeTracker>* tracker_ptr( |
504 new scoped_ptr<LocalFileChangeTracker>); | 502 new scoped_ptr<LocalFileChangeTracker>); |
505 base::PostTaskAndReplyWithResult( | 503 base::PostTaskAndReplyWithResult( |
506 file_system_context->default_file_task_runner(), | 504 file_system_context->default_file_task_runner(), |
507 FROM_HERE, | 505 FROM_HERE, |
508 base::Bind(&LocalFileSyncContext::InitializeChangeTrackerOnFileThread, | 506 base::Bind(&LocalFileSyncContext::InitializeChangeTrackerOnFileThread, |
509 this, tracker_ptr, | 507 this, tracker_ptr, |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 return; | 825 return; |
828 } | 826 } |
829 | 827 |
830 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( | 828 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( |
831 file_system_context, dest_url); | 829 file_system_context, dest_url); |
832 file_system_context->operation_runner()->CopyInForeignFile( | 830 file_system_context->operation_runner()->CopyInForeignFile( |
833 local_path, url_for_sync, callback); | 831 local_path, url_for_sync, callback); |
834 } | 832 } |
835 | 833 |
836 } // namespace sync_file_system | 834 } // namespace sync_file_system |
OLD | NEW |