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

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

Issue 12022041: Separate local and remote sync invalidations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 11 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/sync_backend_host.h
diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h
index 768618fb0fc3ff9e0b3874b1aaeeb051abffc699..30e9d7fa8ed6189535fc096cd34842c13a2b00f9 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -16,6 +16,8 @@
#include "base/threading/thread.h"
#include "chrome/browser/sync/glue/backend_data_type_configurer.h"
#include "chrome/browser/sync/glue/chrome_extensions_activity_monitor.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "googleurl/src/gurl.h"
#include "sync/internal_api/public/base/model_type.h"
@@ -41,8 +43,8 @@ class SyncManagerFactory;
namespace browser_sync {
+class AndroidInvalidatorBridge;
class ChangeProcessor;
-class ChromeSyncNotificationBridge;
class InvalidatorStorage;
class SyncBackendRegistrar;
class SyncPrefs;
@@ -143,7 +145,9 @@ class SyncFrontend : public syncer::InvalidationHandler {
// syncapi element, the SyncManager, on its own thread. This class handles
// dispatch of potentially blocking calls to appropriate threads and ensures
// that the SyncFrontend is only accessed on the UI loop.
-class SyncBackendHost : public BackendDataTypeConfigurer {
+class SyncBackendHost
+ : public BackendDataTypeConfigurer,
+ public content::NotificationObserver {
public:
typedef syncer::SyncStatus Status;
@@ -308,7 +312,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
const GURL& service_url,
MakeHttpBridgeFactoryFn make_http_bridge_factory_fn,
const syncer::SyncCredentials& credentials,
- ChromeSyncNotificationBridge* chrome_sync_notification_bridge,
+ AndroidInvalidatorBridge* android_invalidator_bridge,
syncer::InvalidatorFactory* invalidator_factory,
syncer::SyncManagerFactory* sync_manager_factory,
bool delete_sync_data_folder,
@@ -330,7 +334,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
// Overridden by tests.
MakeHttpBridgeFactoryFn make_http_bridge_factory_fn;
syncer::SyncCredentials credentials;
- ChromeSyncNotificationBridge* const chrome_sync_notification_bridge;
+ AndroidInvalidatorBridge* const android_invalidator_bridge;
syncer::InvalidatorFactory* const invalidator_factory;
syncer::SyncManagerFactory* const sync_manager_factory;
std::string lsid;
@@ -483,12 +487,20 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
const syncer::ObjectIdInvalidationMap& invalidation_map,
syncer::IncomingInvalidationSource source);
+ // NotificationObserver implementation.
+ virtual void Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
// Handles stopping the core's SyncManager, accounting for whether
// initialization is done yet.
void StopSyncManagerForShutdown(const base::Closure& closure);
base::WeakPtrFactory<SyncBackendHost> weak_ptr_factory_;
+ content::NotificationRegistrar notification_registrar_;
+
// A thread where all the sync operations happen.
base::Thread sync_thread_;
@@ -508,9 +520,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer {
const base::WeakPtr<SyncPrefs> sync_prefs_;
- // A bridge that converts Chrome notifications (on the UI thread)
- // into invalidations (on the sync thread).
- scoped_ptr<ChromeSyncNotificationBridge> chrome_sync_notification_bridge_;
+ scoped_ptr<AndroidInvalidatorBridge> android_invalidator_bridge_;
syncer::InvalidatorFactory invalidator_factory_;
« no previous file with comments | « chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc ('k') | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698