summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/notifier/server_notifier_thread.h
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-11 17:27:46 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-11 17:27:46 +0000
commit618a4ac762817cdd51bf0d30b36cfeffd41b0507 (patch)
tree676279d48256acd515e9f5deba0d9ae6479cf9da /chrome/browser/sync/notifier/server_notifier_thread.h
parenta446a53c3d50b49e23bcd93814de95b2ed981aa9 (diff)
downloadchromium_src-618a4ac762817cdd51bf0d30b36cfeffd41b0507.zip
chromium_src-618a4ac762817cdd51bf0d30b36cfeffd41b0507.tar.gz
chromium_src-618a4ac762817cdd51bf0d30b36cfeffd41b0507.tar.bz2
[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
Diffstat (limited to 'chrome/browser/sync/notifier/server_notifier_thread.h')
-rw-r--r--chrome/browser/sync/notifier/server_notifier_thread.h20
1 files changed, 16 insertions, 4 deletions
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<ChromeInvalidationClient> chrome_invalidation_client_;
};