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 13 matching lines...) Expand all Loading... |
24 // We're always created on the UI thread. | 24 // We're always created on the UI thread. |
25 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 25 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
26 } | 26 } |
27 | 27 |
28 SharedChangeProcessor::~SharedChangeProcessor() { | 28 SharedChangeProcessor::~SharedChangeProcessor() { |
29 // We can either be deleted when the DTC is destroyed (on UI | 29 // We can either be deleted when the DTC is destroyed (on UI |
30 // thread), or when the syncer::SyncableService stop's syncing (datatype | 30 // thread), or when the syncer::SyncableService stop's syncing (datatype |
31 // thread). |generic_change_processor_|, if non-NULL, must be | 31 // thread). |generic_change_processor_|, if non-NULL, must be |
32 // deleted on |backend_loop_|. | 32 // deleted on |backend_loop_|. |
33 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 33 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
34 if (backend_loop_) { | 34 if (backend_loop_.get()) { |
35 if (!backend_loop_->DeleteSoon(FROM_HERE, generic_change_processor_)) { | 35 if (!backend_loop_->DeleteSoon(FROM_HERE, generic_change_processor_)) { |
36 NOTREACHED(); | 36 NOTREACHED(); |
37 } | 37 } |
38 } else { | 38 } else { |
39 DCHECK(!generic_change_processor_); | 39 DCHECK(!generic_change_processor_); |
40 } | 40 } |
41 } else { | 41 } else { |
42 DCHECK(backend_loop_.get()); | 42 DCHECK(backend_loop_.get()); |
43 DCHECK(backend_loop_->BelongsToCurrentThread()); | 43 DCHECK(backend_loop_->BelongsToCurrentThread()); |
44 delete generic_change_processor_; | 44 delete generic_change_processor_; |
(...skipping 126 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 |