| 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_service.h" | 5 #include "chrome/browser/sync_file_system/local/local_file_sync_service.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 return; | 338 return; |
| 339 origin_change_map_.SetOriginEnabled(origin, enabled); | 339 origin_change_map_.SetOriginEnabled(origin, enabled); |
| 340 } | 340 } |
| 341 | 341 |
| 342 LocalFileSyncService::LocalFileSyncService(Profile* profile, | 342 LocalFileSyncService::LocalFileSyncService(Profile* profile, |
| 343 leveldb::Env* env_override) | 343 leveldb::Env* env_override) |
| 344 : profile_(profile), | 344 : profile_(profile), |
| 345 sync_context_(new LocalFileSyncContext( | 345 sync_context_(new LocalFileSyncContext( |
| 346 profile_->GetPath(), | 346 profile_->GetPath(), |
| 347 env_override, | 347 env_override, |
| 348 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI).get(), | 348 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI).get(), |
| 349 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO) | 349 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO).get())), |
| 350 .get())), | |
| 351 local_change_processor_(nullptr) { | 350 local_change_processor_(nullptr) { |
| 352 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 351 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 353 sync_context_->AddOriginChangeObserver(this); | 352 sync_context_->AddOriginChangeObserver(this); |
| 354 } | 353 } |
| 355 | 354 |
| 356 void LocalFileSyncService::DidInitializeFileSystemContext( | 355 void LocalFileSyncService::DidInitializeFileSystemContext( |
| 357 const GURL& app_origin, | 356 const GURL& app_origin, |
| 358 storage::FileSystemContext* file_system_context, | 357 storage::FileSystemContext* file_system_context, |
| 359 const SyncStatusCallback& callback, | 358 const SyncStatusCallback& callback, |
| 360 SyncStatusCode status) { | 359 SyncStatusCode status) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 | 489 |
| 491 LocalChangeProcessor* LocalFileSyncService::GetLocalChangeProcessor( | 490 LocalChangeProcessor* LocalFileSyncService::GetLocalChangeProcessor( |
| 492 const FileSystemURL& url) { | 491 const FileSystemURL& url) { |
| 493 if (!get_local_change_processor_.is_null()) | 492 if (!get_local_change_processor_.is_null()) |
| 494 return get_local_change_processor_.Run(url.origin()); | 493 return get_local_change_processor_.Run(url.origin()); |
| 495 DCHECK(local_change_processor_); | 494 DCHECK(local_change_processor_); |
| 496 return local_change_processor_; | 495 return local_change_processor_; |
| 497 } | 496 } |
| 498 | 497 |
| 499 } // namespace sync_file_system | 498 } // namespace sync_file_system |
| OLD | NEW |