| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 base::WeakPtrFactory<RemoteSyncRunner> factory_; | 244 base::WeakPtrFactory<RemoteSyncRunner> factory_; |
| 245 DISALLOW_COPY_AND_ASSIGN(RemoteSyncRunner); | 245 DISALLOW_COPY_AND_ASSIGN(RemoteSyncRunner); |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 //----------------------------------------------------------------------------- | 248 //----------------------------------------------------------------------------- |
| 249 // SyncFileSystemService | 249 // SyncFileSystemService |
| 250 | 250 |
| 251 void SyncFileSystemService::Shutdown() { | 251 void SyncFileSystemService::Shutdown() { |
| 252 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 252 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 253 | 253 |
| 254 local_sync_runners_.clear(); |
| 255 remote_sync_runners_.clear(); |
| 256 |
| 254 local_service_->Shutdown(); | 257 local_service_->Shutdown(); |
| 255 local_service_.reset(); | 258 local_service_.reset(); |
| 256 | 259 |
| 257 remote_service_.reset(); | 260 remote_service_.reset(); |
| 258 v2_remote_service_.reset(); | 261 v2_remote_service_.reset(); |
| 259 | 262 |
| 260 ProfileSyncServiceBase* profile_sync_service = | 263 ProfileSyncServiceBase* profile_sync_service = |
| 261 ProfileSyncServiceFactory::GetForProfile(profile_); | 264 ProfileSyncServiceFactory::GetForProfile(profile_); |
| 262 if (profile_sync_service) | 265 if (profile_sync_service) |
| 263 profile_sync_service->RemoveObserver(this); | 266 profile_sync_service->RemoveObserver(this); |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); | 752 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); |
| 750 v2_remote_service_->AddFileStatusObserver(this); | 753 v2_remote_service_->AddFileStatusObserver(this); |
| 751 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); | 754 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); |
| 752 v2_remote_service_->SetSyncEnabled(sync_enabled_); | 755 v2_remote_service_->SetSyncEnabled(sync_enabled_); |
| 753 remote_sync_runners_.push_back(v2_remote_syncer.release()); | 756 remote_sync_runners_.push_back(v2_remote_syncer.release()); |
| 754 } | 757 } |
| 755 return v2_remote_service_.get(); | 758 return v2_remote_service_.get(); |
| 756 } | 759 } |
| 757 | 760 |
| 758 } // namespace sync_file_system | 761 } // namespace sync_file_system |
| OLD | NEW |