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

Unified Diff: chrome/browser/extensions/app_notification_manager.cc

Issue 9749012: [Sync] Have SyncableService's take ownership of their SyncChangeProcessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser_tests Created 8 years, 9 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
Index: chrome/browser/extensions/app_notification_manager.cc
diff --git a/chrome/browser/extensions/app_notification_manager.cc b/chrome/browser/extensions/app_notification_manager.cc
index 5a254f3c237b03b93a62db249d2d5790d964f701..c9aca6b638ce7972c1ee456954ec1948208d45e9 100644
--- a/chrome/browser/extensions/app_notification_manager.cc
+++ b/chrome/browser/extensions/app_notification_manager.cc
@@ -66,7 +66,6 @@ const unsigned int AppNotificationManager::kMaxNotificationPerApp = 5;
AppNotificationManager::AppNotificationManager(Profile* profile)
: profile_(profile),
- sync_processor_(NULL),
models_associated_(false),
processing_syncer_changes_(false) {
registrar_.Add(this,
@@ -383,15 +382,16 @@ SyncError AppNotificationManager::ProcessSyncChanges(
SyncError AppNotificationManager::MergeDataAndStartSyncing(
syncable::ModelType type,
const SyncDataList& initial_sync_data,
- SyncChangeProcessor* sync_processor) {
+ scoped_ptr<SyncChangeProcessor> sync_processor) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// AppNotificationDataTypeController ensures that modei is fully should before
// this method is called by waiting until the load notification is received
// from AppNotificationManager.
DCHECK(loaded());
DCHECK_EQ(type, syncable::APP_NOTIFICATIONS);
- DCHECK(!sync_processor_);
- sync_processor_ = sync_processor;
+ DCHECK(!sync_processor_.get());
+ DCHECK(sync_processor.get());
+ sync_processor_ = sync_processor.Pass();
// We may add, or remove notifications here, so ensure we don't step on
// our own toes.
@@ -443,7 +443,7 @@ SyncError AppNotificationManager::MergeDataAndStartSyncing(
void AppNotificationManager::StopSyncing(syncable::ModelType type) {
DCHECK_EQ(type, syncable::APP_NOTIFICATIONS);
models_associated_ = false;
- sync_processor_ = NULL;
+ sync_processor_.reset();
}
void AppNotificationManager::SyncAddChange(const AppNotification& notif) {

Powered by Google App Engine
This is Rietveld 408576698