From 618a4ac762817cdd51bf0d30b36cfeffd41b0507 Mon Sep 17 00:00:00 2001 From: "akalin@chromium.org" Date: Mon, 11 Oct 2010 17:27:46 +0000 Subject: [Sync] Added some plumbing needed for notifications persistence support BUG=58556 TEST=ChromeSystemResources unit tests Review URL: http://codereview.chromium.org/3610015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62155 0039d316-1c4b-4281-b951-d872f2087c98 --- .../browser/sync/notifier/server_notifier_thread.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'chrome/browser/sync/notifier/server_notifier_thread.h') diff --git a/chrome/browser/sync/notifier/server_notifier_thread.h b/chrome/browser/sync/notifier/server_notifier_thread.h index 4d66f42..5e48379 100644 --- a/chrome/browser/sync/notifier/server_notifier_thread.h +++ b/chrome/browser/sync/notifier/server_notifier_thread.h @@ -18,6 +18,7 @@ #include "base/scoped_ptr.h" #include "chrome/browser/sync/notifier/chrome_invalidation_client.h" +#include "chrome/browser/sync/notifier/state_writer.h" #include "chrome/browser/sync/syncable/model_type.h" #include "jingle/notifier/listener/mediator_thread_impl.h" @@ -29,10 +30,14 @@ namespace sync_notifier { class ServerNotifierThread : public notifier::MediatorThreadImpl, - public ChromeInvalidationClient::Listener { + public ChromeInvalidationClient::Listener, + public StateWriter { public: + // Does not take ownership of |state_writer| (which may not + // be NULL). explicit ServerNotifierThread( - const notifier::NotifierOptions& notifier_options); + const notifier::NotifierOptions& notifier_options, + const std::string& state, StateWriter* state_writer); virtual ~ServerNotifierThread(); @@ -52,11 +57,12 @@ class ServerNotifierThread virtual void SendNotification(const OutgoingNotificationData& data); // ChromeInvalidationClient::Listener implementation. - virtual void OnInvalidate(syncable::ModelType model_type); - virtual void OnInvalidateAll(); + // StateWriter implementation. + virtual void WriteState(const std::string& state); + protected: virtual void OnDisconnect(); @@ -73,10 +79,16 @@ class ServerNotifierThread // Signal to the delegate that we have an incoming notification. void SignalIncomingNotification(); + // Signal to the delegate to write the state. + void SignalWriteState(const std::string& state); + // Called by StartInvalidationListener() and posted to the worker // thread by Stop(). void StopInvalidationListener(); + std::string state_; + // May be NULL. + StateWriter* state_writer_; scoped_ptr chrome_invalidation_client_; }; -- cgit v1.1