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

Unified Diff: components/sync_driver/shared_change_processor.cc

Issue 671603005: Delete GenericChangeProcessor synchronously when possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_driver/shared_change_processor.cc
diff --git a/components/sync_driver/shared_change_processor.cc b/components/sync_driver/shared_change_processor.cc
index c1cf407e74647f25db86a9309fccb236b4bfeeb6..ce494303414c8cede1730a9eb0b7b7b7f8f32c8c 100644
--- a/components/sync_driver/shared_change_processor.cc
+++ b/components/sync_driver/shared_change_processor.cc
@@ -24,21 +24,20 @@ SharedChangeProcessor::SharedChangeProcessor()
SharedChangeProcessor::~SharedChangeProcessor() {
// We can either be deleted when the DTC is destroyed (on UI
- // thread), or when the syncer::SyncableService stop's syncing (datatype
+ // thread), or when the syncer::SyncableService stops syncing (datatype
// thread). |generic_change_processor_|, if non-NULL, must be
// deleted on |backend_loop_|.
- if (frontend_loop_->BelongsToCurrentThread()) {
- if (backend_loop_.get()) {
+ if (backend_loop_.get()) {
+ if (backend_loop_->BelongsToCurrentThread()) {
+ delete generic_change_processor_;
+ } else {
+ DCHECK(frontend_loop_->BelongsToCurrentThread());
if (!backend_loop_->DeleteSoon(FROM_HERE, generic_change_processor_)) {
NOTREACHED();
}
- } else {
- DCHECK(!generic_change_processor_);
}
} else {
- DCHECK(backend_loop_.get());
- DCHECK(backend_loop_->BelongsToCurrentThread());
- delete generic_change_processor_;
+ DCHECK(!generic_change_processor_);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698