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/glue/shared_change_processor.h" | 5 #include "chrome/browser/sync/glue/shared_change_processor.h" |
6 | 6 |
7 #include "chrome/browser/sync/glue/generic_change_processor.h" | 7 #include "chrome/browser/sync/glue/generic_change_processor.h" |
8 #include "chrome/browser/sync/profile_sync_components_factory.h" | 8 #include "chrome/browser/sync/profile_sync_components_factory.h" |
9 #include "chrome/browser/sync/profile_sync_service.h" | 9 #include "chrome/browser/sync/profile_sync_service.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 DCHECK_NE(type, syncer::UNSPECIFIED); | 57 DCHECK_NE(type, syncer::UNSPECIFIED); |
58 backend_loop_ = base::MessageLoopProxy::current(); | 58 backend_loop_ = base::MessageLoopProxy::current(); |
59 AutoLock lock(monitor_lock_); | 59 AutoLock lock(monitor_lock_); |
60 if (disconnected_) | 60 if (disconnected_) |
61 return base::WeakPtr<syncer::SyncableService>(); | 61 return base::WeakPtr<syncer::SyncableService>(); |
62 type_ = type; | 62 type_ = type; |
63 sync_service_ = sync_service; | 63 sync_service_ = sync_service; |
64 error_handler_ = error_handler; | 64 error_handler_ = error_handler; |
65 base::WeakPtr<syncer::SyncableService> local_service = | 65 base::WeakPtr<syncer::SyncableService> local_service = |
66 sync_factory->GetSyncableServiceForType(type); | 66 sync_factory->GetSyncableServiceForType(type); |
67 if (!local_service) { | 67 if (!local_service.get()) { |
68 NOTREACHED() << "SyncableService destroyed before DTC was stopped."; | 68 NOTREACHED() << "SyncableService destroyed before DTC was stopped."; |
69 disconnected_ = true; | 69 disconnected_ = true; |
70 return base::WeakPtr<syncer::SyncableService>(); | 70 return base::WeakPtr<syncer::SyncableService>(); |
71 } | 71 } |
72 | 72 |
73 // TODO(zea): Pass |merge_result| to the generic change processor. | 73 // TODO(zea): Pass |merge_result| to the generic change processor. |
74 generic_change_processor_ = | 74 generic_change_processor_ = |
75 sync_factory->CreateGenericChangeProcessor(sync_service_, | 75 sync_factory->CreateGenericChangeProcessor(sync_service_, |
76 error_handler, | 76 error_handler, |
77 local_service, | 77 local_service, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 const std::string& message) { | 171 const std::string& message) { |
172 AutoLock lock(monitor_lock_); | 172 AutoLock lock(monitor_lock_); |
173 if (!disconnected_) { | 173 if (!disconnected_) { |
174 return error_handler_->CreateAndUploadError(location, message, type_); | 174 return error_handler_->CreateAndUploadError(location, message, type_); |
175 } else { | 175 } else { |
176 return syncer::SyncError(location, message, type_); | 176 return syncer::SyncError(location, message, type_); |
177 } | 177 } |
178 } | 178 } |
179 | 179 |
180 } // namespace browser_sync | 180 } // namespace browser_sync |
OLD | NEW |