| 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/glue/sync_backend_host_impl.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/invalidation/invalidation_service.h" | 10 #include "chrome/browser/invalidation/invalidation_service.h" |
| 10 #include "chrome/browser/invalidation/invalidation_service_factory.h" | 11 #include "chrome/browser/invalidation/invalidation_service_factory.h" |
| 11 #include "chrome/browser/network_time/network_time_tracker.h" | 12 #include "chrome/browser/network_time/network_time_tracker.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/sync/glue/sync_backend_host_core.h" | 14 #include "chrome/browser/sync/glue/sync_backend_host_core.h" |
| 14 #include "chrome/browser/sync/glue/sync_backend_registrar.h" | 15 #include "chrome/browser/sync/glue/sync_backend_registrar.h" |
| 15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 16 #include "components/sync_driver/sync_frontend.h" | 17 #include "components/sync_driver/sync_frontend.h" |
| 17 #include "components/sync_driver/sync_prefs.h" | 18 #include "components/sync_driver/sync_prefs.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 profile_(profile), | 53 profile_(profile), |
| 53 name_(name), | 54 name_(name), |
| 54 initialized_(false), | 55 initialized_(false), |
| 55 sync_prefs_(sync_prefs), | 56 sync_prefs_(sync_prefs), |
| 56 frontend_(NULL), | 57 frontend_(NULL), |
| 57 cached_passphrase_type_(syncer::IMPLICIT_PASSPHRASE), | 58 cached_passphrase_type_(syncer::IMPLICIT_PASSPHRASE), |
| 58 invalidator_( | 59 invalidator_( |
| 59 invalidation::InvalidationServiceFactory::GetForProfile(profile)), | 60 invalidation::InvalidationServiceFactory::GetForProfile(profile)), |
| 60 invalidation_handler_registered_(false), | 61 invalidation_handler_registered_(false), |
| 61 weak_ptr_factory_(this) { | 62 weak_ptr_factory_(this) { |
| 63 CHECK(invalidator_); |
| 62 core_ = new SyncBackendHostCore( | 64 core_ = new SyncBackendHostCore( |
| 63 name_, | 65 name_, |
| 64 profile_->GetPath().Append(kSyncDataFolderName), | 66 profile_->GetPath().Append(kSyncDataFolderName), |
| 65 sync_prefs_->HasSyncSetupCompleted(), | 67 sync_prefs_->HasSyncSetupCompleted(), |
| 66 weak_ptr_factory_.GetWeakPtr()); | 68 weak_ptr_factory_.GetWeakPtr()); |
| 67 } | 69 } |
| 68 | 70 |
| 69 SyncBackendHostImpl::~SyncBackendHostImpl() { | 71 SyncBackendHostImpl::~SyncBackendHostImpl() { |
| 70 DCHECK(!core_.get() && !frontend_) << "Must call Shutdown before destructor."; | 72 DCHECK(!core_.get() && !frontend_) << "Must call Shutdown before destructor."; |
| 71 DCHECK(!registrar_.get()); | 73 DCHECK(!registrar_.get()); |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { | 776 base::MessageLoop* SyncBackendHostImpl::GetSyncLoopForTesting() { |
| 775 return registrar_->sync_thread()->message_loop(); | 777 return registrar_->sync_thread()->message_loop(); |
| 776 } | 778 } |
| 777 | 779 |
| 778 } // namespace browser_sync | 780 } // namespace browser_sync |
| 779 | 781 |
| 780 #undef SDVLOG | 782 #undef SDVLOG |
| 781 | 783 |
| 782 #undef SLOG | 784 #undef SLOG |
| 783 | 785 |
| OLD | NEW |