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

Unified Diff: chrome/browser/sync/glue/typed_url_change_processor.cc

Issue 8341094: Changed change processors to use ScopedStopObserving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unnecessary call to StartObserving(). Created 9 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 | « chrome/browser/sync/glue/typed_url_change_processor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/typed_url_change_processor.cc
diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc
index 83bdb90d483f9c7f3778ba21275d0e5b56ad45c4..ca865b653fdc3087d434cffa0fbe17f551dbf6cc 100644
--- a/chrome/browser/sync/glue/typed_url_change_processor.cc
+++ b/chrome/browser/sync/glue/typed_url_change_processor.cc
@@ -307,7 +307,9 @@ void TypedUrlChangeProcessor::CommitChangesFromSyncModel() {
if (!running())
return;
- StopObserving();
+ // Make sure we stop listening for changes while we're modifying the backend,
+ // so we don't try to re-apply these changes to the sync DB.
+ ScopedStopObserving<TypedUrlChangeProcessor> stop_observing(this);
if (!pending_deleted_urls_.empty())
history_backend_->DeleteURLs(pending_deleted_urls_);
@@ -327,8 +329,6 @@ void TypedUrlChangeProcessor::CommitChangesFromSyncModel() {
pending_new_visits_.clear();
pending_deleted_visits_.clear();
pending_deleted_urls_.clear();
-
- StartObserving();
}
void TypedUrlChangeProcessor::StartImpl(Profile* profile) {
« no previous file with comments | « chrome/browser/sync/glue/typed_url_change_processor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698