OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync_file_system_service.h" | 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | |
10 #include <string> | 9 #include <string> |
| 10 #include <utility> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/format_macros.h" | 13 #include "base/format_macros.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
19 #include "base/stl_util.h" | 19 #include "base/stl_util.h" |
20 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 } | 448 } |
449 | 449 |
450 void SyncFileSystemService::Initialize( | 450 void SyncFileSystemService::Initialize( |
451 scoped_ptr<LocalFileSyncService> local_service, | 451 scoped_ptr<LocalFileSyncService> local_service, |
452 scoped_ptr<RemoteFileSyncService> remote_service) { | 452 scoped_ptr<RemoteFileSyncService> remote_service) { |
453 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 453 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
454 DCHECK(local_service); | 454 DCHECK(local_service); |
455 DCHECK(remote_service); | 455 DCHECK(remote_service); |
456 DCHECK(profile_); | 456 DCHECK(profile_); |
457 | 457 |
458 local_service_ = local_service.Pass(); | 458 local_service_ = std::move(local_service); |
459 remote_service_ = remote_service.Pass(); | 459 remote_service_ = std::move(remote_service); |
460 | 460 |
461 scoped_ptr<LocalSyncRunner> local_syncer( | 461 scoped_ptr<LocalSyncRunner> local_syncer( |
462 new LocalSyncRunner(kLocalSyncName, this)); | 462 new LocalSyncRunner(kLocalSyncName, this)); |
463 scoped_ptr<RemoteSyncRunner> remote_syncer( | 463 scoped_ptr<RemoteSyncRunner> remote_syncer( |
464 new RemoteSyncRunner(kRemoteSyncName, this, remote_service_.get())); | 464 new RemoteSyncRunner(kRemoteSyncName, this, remote_service_.get())); |
465 | 465 |
466 local_service_->AddChangeObserver(local_syncer.get()); | 466 local_service_->AddChangeObserver(local_syncer.get()); |
467 local_service_->SetLocalChangeProcessorCallback( | 467 local_service_->SetLocalChangeProcessorCallback( |
468 base::Bind(&GetLocalChangeProcessorAdapter, AsWeakPtr())); | 468 base::Bind(&GetLocalChangeProcessorAdapter, AsWeakPtr())); |
469 | 469 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 local_sync_runners_.begin(); | 762 local_sync_runners_.begin(); |
763 iter != local_sync_runners_.end(); ++iter) | 763 iter != local_sync_runners_.end(); ++iter) |
764 ((*iter)->*method)(); | 764 ((*iter)->*method)(); |
765 for (ScopedVector<SyncProcessRunner>::iterator iter = | 765 for (ScopedVector<SyncProcessRunner>::iterator iter = |
766 remote_sync_runners_.begin(); | 766 remote_sync_runners_.begin(); |
767 iter != remote_sync_runners_.end(); ++iter) | 767 iter != remote_sync_runners_.end(); ++iter) |
768 ((*iter)->*method)(); | 768 ((*iter)->*method)(); |
769 } | 769 } |
770 | 770 |
771 } // namespace sync_file_system | 771 } // namespace sync_file_system |
OLD | NEW |