| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/sync/glue/sync_backend_host.h" | 7 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 17 #include "base/location.h" | 17 #include "base/location.h" |
| 18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
| 19 #include "base/threading/thread_restrictions.h" | 19 #include "base/threading/thread_restrictions.h" |
| 20 #include "base/timer.h" | 20 #include "base/timer.h" |
| 21 #include "base/tracked_objects.h" | 21 #include "base/tracked_objects.h" |
| 22 #include "base/utf_string_conversions.h" | 22 #include "base/utf_string_conversions.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "chrome/browser/invalidation/invalidator_storage.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/signin/token_service.h" | 26 #include "chrome/browser/signin/token_service.h" |
| 26 #include "chrome/browser/signin/token_service_factory.h" | 27 #include "chrome/browser/signin/token_service_factory.h" |
| 27 #include "chrome/browser/sync/glue/android_invalidator_bridge.h" | 28 #include "chrome/browser/sync/glue/android_invalidator_bridge.h" |
| 28 #include "chrome/browser/sync/glue/android_invalidator_bridge_proxy.h" | 29 #include "chrome/browser/sync/glue/android_invalidator_bridge_proxy.h" |
| 29 #include "chrome/browser/sync/glue/change_processor.h" | 30 #include "chrome/browser/sync/glue/change_processor.h" |
| 30 #include "chrome/browser/sync/glue/chrome_encryptor.h" | 31 #include "chrome/browser/sync/glue/chrome_encryptor.h" |
| 31 #include "chrome/browser/sync/glue/device_info.h" | 32 #include "chrome/browser/sync/glue/device_info.h" |
| 32 #include "chrome/browser/sync/glue/sync_backend_registrar.h" | 33 #include "chrome/browser/sync/glue/sync_backend_registrar.h" |
| 33 #include "chrome/browser/sync/glue/synced_device_tracker.h" | 34 #include "chrome/browser/sync/glue/synced_device_tracker.h" |
| 34 #include "chrome/browser/sync/invalidations/invalidator_storage.h" | |
| 35 #include "chrome/browser/sync/sync_prefs.h" | 35 #include "chrome/browser/sync/sync_prefs.h" |
| 36 #include "chrome/common/chrome_notification_types.h" | 36 #include "chrome/common/chrome_notification_types.h" |
| 37 #include "chrome/common/chrome_notification_types.h" | 37 #include "chrome/common/chrome_notification_types.h" |
| 38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
| 39 #include "chrome/common/chrome_version_info.h" | 39 #include "chrome/common/chrome_version_info.h" |
| 40 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
| 41 #include "content/public/browser/notification_details.h" | 41 #include "content/public/browser/notification_details.h" |
| 42 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
| 43 #include "content/public/browser/notification_source.h" | 43 #include "content/public/browser/notification_source.h" |
| 44 #include "content/public/common/content_client.h" | 44 #include "content/public/common/content_client.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 340 |
| 341 return notifier_options; | 341 return notifier_options; |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // namespace | 344 } // namespace |
| 345 | 345 |
| 346 SyncBackendHost::SyncBackendHost( | 346 SyncBackendHost::SyncBackendHost( |
| 347 const std::string& name, | 347 const std::string& name, |
| 348 Profile* profile, | 348 Profile* profile, |
| 349 const base::WeakPtr<SyncPrefs>& sync_prefs, | 349 const base::WeakPtr<SyncPrefs>& sync_prefs, |
| 350 const base::WeakPtr<InvalidatorStorage>& invalidator_storage) | 350 const base::WeakPtr<invalidation::InvalidatorStorage>& invalidator_storage) |
| 351 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), | 351 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), |
| 352 sync_thread_("Chrome_SyncThread"), | 352 sync_thread_("Chrome_SyncThread"), |
| 353 frontend_loop_(MessageLoop::current()), | 353 frontend_loop_(MessageLoop::current()), |
| 354 profile_(profile), | 354 profile_(profile), |
| 355 name_(name), | 355 name_(name), |
| 356 core_(new Core(name, profile_->GetPath().Append(kSyncDataFolderName), | 356 core_(new Core(name, profile_->GetPath().Append(kSyncDataFolderName), |
| 357 weak_ptr_factory_.GetWeakPtr())), | 357 weak_ptr_factory_.GetWeakPtr())), |
| 358 initialization_state_(NOT_ATTEMPTED), | 358 initialization_state_(NOT_ATTEMPTED), |
| 359 sync_prefs_(sync_prefs), | 359 sync_prefs_(sync_prefs), |
| 360 invalidator_factory_( | 360 invalidator_factory_( |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1655 DVLOG(1) << "Connection status changed: " | 1655 DVLOG(1) << "Connection status changed: " |
| 1656 << syncer::ConnectionStatusToString(status); | 1656 << syncer::ConnectionStatusToString(status); |
| 1657 frontend_->OnConnectionStatusChange(status); | 1657 frontend_->OnConnectionStatusChange(status); |
| 1658 } | 1658 } |
| 1659 | 1659 |
| 1660 #undef SDVLOG | 1660 #undef SDVLOG |
| 1661 | 1661 |
| 1662 #undef SLOG | 1662 #undef SLOG |
| 1663 | 1663 |
| 1664 } // namespace browser_sync | 1664 } // namespace browser_sync |
| OLD | NEW |