| 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/file_util.h" | 8 #include "base/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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 leveldb::Env* env_override, | 49 leveldb::Env* env_override, |
| 50 base::SingleThreadTaskRunner* ui_task_runner, | 50 base::SingleThreadTaskRunner* ui_task_runner, |
| 51 base::SingleThreadTaskRunner* io_task_runner) | 51 base::SingleThreadTaskRunner* io_task_runner) |
| 52 : local_base_path_(base_path.Append(FILE_PATH_LITERAL("local"))), | 52 : local_base_path_(base_path.Append(FILE_PATH_LITERAL("local"))), |
| 53 env_override_(env_override), | 53 env_override_(env_override), |
| 54 ui_task_runner_(ui_task_runner), | 54 ui_task_runner_(ui_task_runner), |
| 55 io_task_runner_(io_task_runner), | 55 io_task_runner_(io_task_runner), |
| 56 shutdown_on_ui_(false), | 56 shutdown_on_ui_(false), |
| 57 shutdown_on_io_(false), | 57 shutdown_on_io_(false), |
| 58 mock_notify_changes_duration_in_sec_(-1) { | 58 mock_notify_changes_duration_in_sec_(-1) { |
| 59 DCHECK(base_path.IsAbsolute()); |
| 59 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); | 60 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); |
| 60 } | 61 } |
| 61 | 62 |
| 62 void LocalFileSyncContext::MaybeInitializeFileSystemContext( | 63 void LocalFileSyncContext::MaybeInitializeFileSystemContext( |
| 63 const GURL& source_url, | 64 const GURL& source_url, |
| 64 FileSystemContext* file_system_context, | 65 FileSystemContext* file_system_context, |
| 65 const SyncStatusCallback& callback) { | 66 const SyncStatusCallback& callback) { |
| 66 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); | 67 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); |
| 67 if (ContainsKey(file_system_contexts_, file_system_context)) { | 68 if (ContainsKey(file_system_contexts_, file_system_context)) { |
| 68 // The context has been already initialized. Just dispatch the callback | 69 // The context has been already initialized. Just dispatch the callback |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 return; | 1000 return; |
| 1000 } | 1001 } |
| 1001 | 1002 |
| 1002 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( | 1003 FileSystemURL url_for_sync = CreateSyncableFileSystemURLForSync( |
| 1003 file_system_context, dest_url); | 1004 file_system_context, dest_url); |
| 1004 file_system_context->operation_runner()->CopyInForeignFile( | 1005 file_system_context->operation_runner()->CopyInForeignFile( |
| 1005 local_path, url_for_sync, callback); | 1006 local_path, url_for_sync, callback); |
| 1006 } | 1007 } |
| 1007 | 1008 |
| 1008 } // namespace sync_file_system | 1009 } // namespace sync_file_system |
| OLD | NEW |