Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host_impl.cc

Issue 218903005: Make push messaging not create InvalidationService for login and guest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make code resilient against tests that do not create the Default profile first. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698