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

Unified Diff: sync/notifier/fake_invalidator.cc

Issue 308413002: Revert of Move some sync/notifier to components/invalidation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « sync/notifier/fake_invalidator.h ('k') | sync/notifier/fake_invalidator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/fake_invalidator.cc
diff --git a/sync/notifier/fake_invalidator.cc b/sync/notifier/fake_invalidator.cc
new file mode 100644
index 0000000000000000000000000000000000000000..dc41518bdc2d93561fb8095dc7053089ac6bfe9b
--- /dev/null
+++ b/sync/notifier/fake_invalidator.cc
@@ -0,0 +1,69 @@
+// 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/fake_invalidator.h"
+
+#include "sync/notifier/object_id_invalidation_map.h"
+
+namespace syncer {
+
+FakeInvalidator::FakeInvalidator() {}
+
+FakeInvalidator::~FakeInvalidator() {}
+
+bool FakeInvalidator::IsHandlerRegistered(InvalidationHandler* handler) const {
+ return registrar_.IsHandlerRegisteredForTest(handler);
+}
+
+ObjectIdSet FakeInvalidator::GetRegisteredIds(
+ InvalidationHandler* handler) const {
+ return registrar_.GetRegisteredIds(handler);
+}
+
+const std::string& FakeInvalidator::GetCredentialsEmail() const {
+ return email_;
+}
+
+const std::string& FakeInvalidator::GetCredentialsToken() const {
+ return token_;
+}
+
+void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state) {
+ registrar_.UpdateInvalidatorState(state);
+}
+
+void FakeInvalidator::EmitOnIncomingInvalidation(
+ const ObjectIdInvalidationMap& invalidation_map) {
+ registrar_.DispatchInvalidationsToHandlers(invalidation_map);
+}
+
+void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) {
+ registrar_.RegisterHandler(handler);
+}
+
+void FakeInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
+ const ObjectIdSet& ids) {
+ registrar_.UpdateRegisteredIds(handler, ids);
+}
+
+void FakeInvalidator::UnregisterHandler(InvalidationHandler* handler) {
+ registrar_.UnregisterHandler(handler);
+}
+
+InvalidatorState FakeInvalidator::GetInvalidatorState() const {
+ return registrar_.GetInvalidatorState();
+}
+
+void FakeInvalidator::UpdateCredentials(
+ const std::string& email, const std::string& token) {
+ email_ = email;
+ token_ = token;
+}
+
+void FakeInvalidator::RequestDetailedStatus(
+ base::Callback<void(const base::DictionaryValue&)> callback) const {
+ base::DictionaryValue value;
+ callback.Run(value);
+}
+} // namespace syncer
« no previous file with comments | « sync/notifier/fake_invalidator.h ('k') | sync/notifier/fake_invalidator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698