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

Unified Diff: chrome/browser/sync/glue/generic_change_processor.h

Issue 8274020: Revert 105404 - [Sync] Refactor non-frontend DTC to handle new API properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
Index: chrome/browser/sync/glue/generic_change_processor.h
===================================================================
--- chrome/browser/sync/glue/generic_change_processor.h (revision 105407)
+++ chrome/browser/sync/glue/generic_change_processor.h (working copy)
@@ -9,8 +9,6 @@
#include <vector>
#include "base/compiler_specific.h"
-#include "base/memory/weak_ptr.h"
-#include "base/threading/non_thread_safe.h"
#include "chrome/browser/sync/api/sync_change_processor.h"
#include "chrome/browser/sync/glue/change_processor.h"
@@ -28,16 +26,11 @@
// handles all interaction with the sync api, both translating pushes from the
// local service into transactions and receiving changes from the sync model,
// which then get converted into SyncChange's and sent to the local service.
-//
-// As a rule, the GenericChangeProcessor is not thread safe, and should only
-// be used on the same thread in which it was created.
class GenericChangeProcessor : public ChangeProcessor,
- public SyncChangeProcessor,
- public base::NonThreadSafe {
+ public SyncChangeProcessor {
public:
- // Create a change processor and connect it to the syncer.
- GenericChangeProcessor(UnrecoverableErrorHandler* error_handler,
- const base::WeakPtr<SyncableService>& local_service,
+ GenericChangeProcessor(SyncableService* local_service,
+ UnrecoverableErrorHandler* error_handler,
sync_api::UserShare* user_share);
virtual ~GenericChangeProcessor();
@@ -56,26 +49,22 @@
const SyncChangeList& change_list) OVERRIDE;
// Fills |current_sync_data| with all the syncer data for the specified type.
- SyncError GetSyncDataForType(syncable::ModelType type,
- SyncDataList* current_sync_data);
+ virtual SyncError GetSyncDataForType(syncable::ModelType type,
+ SyncDataList* current_sync_data);
// Generic versions of AssociatorInterface methods. Called by
- // SyncableServiceAdapter or the DataTypeController.
+ // SyncableServiceAdapter.
bool SyncModelHasUserCreatedNodes(syncable::ModelType type,
bool* has_nodes);
bool CryptoReadyIfNecessary(syncable::ModelType type);
-
protected:
// ChangeProcessor interface.
- virtual void StartImpl(Profile* profile) OVERRIDE; // Does nothing.
- // Called from UI thread (as part of deactivating datatype), but does
- // nothing and is guaranteed to still be alive, so it's okay.
- virtual void StopImpl() OVERRIDE; // Does nothing.
- virtual sync_api::UserShare* share_handle() const OVERRIDE;
-
+ virtual void StartImpl(Profile* profile) OVERRIDE; // Not implemented.
+ virtual void StopImpl() OVERRIDE; // Not implemented.
+ virtual sync_api::UserShare* share_handle() OVERRIDE;
private:
// The SyncableService this change processor will forward changes on to.
- const base::WeakPtr<SyncableService> local_service_;
+ SyncableService* local_service_;
// The current list of changes received from the syncer. We buffer because
// we must ensure no syncapi transaction is held when we pass it on to
@@ -88,9 +77,7 @@
// listening to changes (the local_service_ will be interacting with us
// when it starts up). As such we can't wait until Start(_) has been called,
// and have to keep a local pointer to the user_share.
- sync_api::UserShare* const share_handle_;
-
- DISALLOW_COPY_AND_ASSIGN(GenericChangeProcessor);
+ sync_api::UserShare* user_share_;
};
} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/glue/frontend_data_type_controller.cc ('k') | chrome/browser/sync/glue/generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698