summaryrefslogtreecommitdiffstats
path: root/sync/notifier/invalidator_test_template.cc
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-07 19:19:16 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-07 19:19:16 +0000
commit08a6f99997bad56869412e1da065acda3dc41538 (patch)
treecf28f8848aed5fa3f641e8f76380469500efa852 /sync/notifier/invalidator_test_template.cc
parentc12229d169345b5ea6fc69cfc4f23d57ac3a9fcc (diff)
downloadchromium_src-08a6f99997bad56869412e1da065acda3dc41538.zip
chromium_src-08a6f99997bad56869412e1da065acda3dc41538.tar.gz
chromium_src-08a6f99997bad56869412e1da065acda3dc41538.tar.bz2
[Invalidations] Add GetInvalidatorState() to Invalidator{,Frontend}
Combine OnNotifications{Enabled,Disabled}() into OnInvalidatorStateChange(). Replace NotificationsDisabledReason with InvalidatorState. Rename OnIncomingNotification to OnIncomingInvalidation. Also change some references of "notification" to "invalidation". Set the initial invalidator state in ChromeToMobileService. Also remove OnNotificationsEnabled() call from OnIncomingInvalidation(). Instantiate InvalidatorTest template for ProfileSyncService. Move comments for invalidation-related functions from ProfileSyncService to InvalidatorFrontend. Put DISALLOW_COPY_AND_ASSIGN on some classes. Fix comment in invalidator.h. BUG=142475 TBR=brettw@chromium.org Review URL: https://chromiumcodereview.appspot.com/10916131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155448 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/notifier/invalidator_test_template.cc')
-rw-r--r--sync/notifier/invalidator_test_template.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/sync/notifier/invalidator_test_template.cc b/sync/notifier/invalidator_test_template.cc
new file mode 100644
index 0000000..7fc8385
--- /dev/null
+++ b/sync/notifier/invalidator_test_template.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sync/notifier/invalidator_test_template.h"
+
+namespace syncer {
+namespace internal {
+
+BoundFakeInvalidationHandler::BoundFakeInvalidationHandler(
+ const Invalidator& invalidator)
+ : invalidator_(invalidator),
+ last_retrieved_state_(DEFAULT_INVALIDATION_ERROR) {}
+
+BoundFakeInvalidationHandler::~BoundFakeInvalidationHandler() {}
+
+InvalidatorState BoundFakeInvalidationHandler::GetLastRetrievedState() const {
+ return last_retrieved_state_;
+}
+
+void BoundFakeInvalidationHandler::OnInvalidatorStateChange(
+ InvalidatorState state) {
+ FakeInvalidationHandler::OnInvalidatorStateChange(state);
+ last_retrieved_state_ = invalidator_.GetInvalidatorState();
+}
+
+} // namespace internal
+} // namespace syncer