From b62f3e2d6dd96598cb1c46fa8a204ab76aad1a48 Mon Sep 17 00:00:00 2001 From: "fischman@chromium.org" Date: Thu, 17 May 2012 18:15:53 +0000 Subject: Revert 137685 (broke check_deps on linux builder) - Rename InvalidationVersionTracker to InvalidationStateTracker in preparation to add more methods to that class. BUG=124140 Review URL: https://chromiumcodereview.appspot.com/10407014 TBR=munjal@chromium.org Review URL: https://chromiumcodereview.appspot.com/10391186 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137689 0039d316-1c4b-4281-b951-d872f2087c98 --- sync/notifier/chrome_invalidation_client.cc | 14 ++++---- sync/notifier/chrome_invalidation_client.h | 12 +++---- .../chrome_invalidation_client_unittest.cc | 36 ++++++++++---------- sync/notifier/invalidation_notifier.cc | 8 ++--- sync/notifier/invalidation_notifier.h | 12 +++---- sync/notifier/invalidation_notifier_unittest.cc | 4 +-- sync/notifier/invalidation_state_tracker.h | 37 --------------------- sync/notifier/invalidation_version_tracker.h | 38 ++++++++++++++++++++++ .../notifier/non_blocking_invalidation_notifier.cc | 16 ++++----- sync/notifier/non_blocking_invalidation_notifier.h | 8 ++--- .../non_blocking_invalidation_notifier_unittest.cc | 4 +-- sync/notifier/sync_notifier_factory.cc | 18 +++++----- sync/notifier/sync_notifier_factory.h | 12 +++---- sync/notifier/sync_notifier_factory_unittest.cc | 6 ++-- sync/sync.gyp | 2 +- sync/tools/sync_listen_notifications.cc | 16 ++++----- 16 files changed, 122 insertions(+), 121 deletions(-) delete mode 100644 sync/notifier/invalidation_state_tracker.h create mode 100644 sync/notifier/invalidation_version_tracker.h (limited to 'sync') diff --git a/sync/notifier/chrome_invalidation_client.cc b/sync/notifier/chrome_invalidation_client.cc index efa45e1..d74cf0a 100644 --- a/sync/notifier/chrome_invalidation_client.cc +++ b/sync/notifier/chrome_invalidation_client.cc @@ -48,8 +48,8 @@ void ChromeInvalidationClient::Start( const std::string& client_id, const std::string& client_info, const std::string& state, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle& - invalidation_state_tracker, + const browser_sync::WeakHandle& + invalidation_version_tracker, Listener* listener, StateWriter* state_writer, base::WeakPtr base_task) { @@ -76,8 +76,8 @@ void ChromeInvalidationClient::Start( << it->second; } } - invalidation_state_tracker_ = invalidation_state_tracker; - DCHECK(invalidation_state_tracker_.IsInitialized()); + invalidation_version_tracker_ = invalidation_version_tracker; + DCHECK(invalidation_version_tracker_.IsInitialized()); DCHECK(!listener_); DCHECK(listener); @@ -124,7 +124,7 @@ void ChromeInvalidationClient::Stop() { state_writer_ = NULL; listener_ = NULL; - invalidation_state_tracker_.Reset(); + invalidation_version_tracker_.Reset(); max_invalidation_versions_.clear(); } @@ -178,9 +178,9 @@ void ChromeInvalidationClient::Invalidate( << syncable::ModelTypeToString(model_type) << " to " << invalidation.version(); max_invalidation_versions_[model_type] = invalidation.version(); - invalidation_state_tracker_.Call( + invalidation_version_tracker_.Call( FROM_HERE, - &InvalidationStateTracker::SetMaxVersion, + &InvalidationVersionTracker::SetMaxVersion, model_type, invalidation.version()); std::string payload; diff --git a/sync/notifier/chrome_invalidation_client.h b/sync/notifier/chrome_invalidation_client.h index 45f5037..b1c8438 100644 --- a/sync/notifier/chrome_invalidation_client.h +++ b/sync/notifier/chrome_invalidation_client.h @@ -18,7 +18,7 @@ #include "base/threading/non_thread_safe.h" #include "google/cacheinvalidation/include/invalidation-listener.h" #include "sync/notifier/chrome_system_resources.h" -#include "sync/notifier/invalidation_state_tracker.h" +#include "sync/notifier/invalidation_version_tracker.h" #include "sync/notifier/state_writer.h" #include "sync/syncable/model_type.h" #include "sync/syncable/model_type_payload_map.h" @@ -57,14 +57,14 @@ class ChromeInvalidationClient virtual ~ChromeInvalidationClient(); // Does not take ownership of |listener| or |state_writer|. - // |invalidation_state_tracker| must be initialized. + // |invalidation_version_tracker| must be initialized. // |base_task| must still be non-NULL. void Start( const std::string& client_id, const std::string& client_info, const std::string& state, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle& - invalidation_state_tracker, + const browser_sync::WeakHandle& + invalidation_version_tracker, Listener* listener, StateWriter* state_writer, base::WeakPtr base_task); @@ -122,8 +122,8 @@ class ChromeInvalidationClient base::NonThreadSafe non_thread_safe_; ChromeSystemResources chrome_system_resources_; InvalidationVersionMap max_invalidation_versions_; - browser_sync::WeakHandle - invalidation_state_tracker_; + browser_sync::WeakHandle + invalidation_version_tracker_; Listener* listener_; StateWriter* state_writer_; scoped_ptr invalidation_client_; diff --git a/sync/notifier/chrome_invalidation_client_unittest.cc b/sync/notifier/chrome_invalidation_client_unittest.cc index 225eab6..72d71da 100644 --- a/sync/notifier/chrome_invalidation_client_unittest.cc +++ b/sync/notifier/chrome_invalidation_client_unittest.cc @@ -46,9 +46,9 @@ class MockListener : public ChromeInvalidationClient::Listener { MOCK_METHOD1(OnSessionStatusChanged, void(bool)); }; -class MockInvalidationStateTracker - : public InvalidationStateTracker, - public base::SupportsWeakPtr { +class MockInvalidationVersionTracker + : public InvalidationVersionTracker, + public base::SupportsWeakPtr { public: MOCK_CONST_METHOD0(GetAllMaxVersions, InvalidationVersionMap()); MOCK_METHOD2(SetMaxVersion, void(syncable::ModelType, int64)); @@ -67,7 +67,7 @@ class ChromeInvalidationClientTest : public testing::Test { client_.Start(kClientId, kClientInfo, kState, InvalidationVersionMap(), browser_sync::MakeWeakHandle( - mock_invalidation_state_tracker_.AsWeakPtr()), + mock_invalidation_version_tracker_.AsWeakPtr()), &mock_listener_, &mock_state_writer_, fake_base_task_.AsWeakPtr()); } @@ -98,7 +98,7 @@ class ChromeInvalidationClientTest : public testing::Test { EXPECT_CALL(mock_invalidation_client_, Acknowledge(ack_handle)); client_.Invalidate(&mock_invalidation_client_, inv, ack_handle); // Pump message loop to trigger - // InvalidationStateTracker::SetMaxVersion(). + // InvalidationVersionTracker::SetMaxVersion(). message_loop_.RunAllPending(); } @@ -121,8 +121,8 @@ class ChromeInvalidationClientTest : public testing::Test { MessageLoop message_loop_; StrictMock mock_listener_; - StrictMock - mock_invalidation_state_tracker_; + StrictMock + mock_invalidation_version_tracker_; StrictMock mock_state_writer_; StrictMock mock_invalidation_client_; notifier::FakeBaseTask fake_base_task_; @@ -156,7 +156,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateBadObjectId) { TEST_F(ChromeInvalidationClientTest, InvalidateNoPayload) { EXPECT_CALL(mock_listener_, OnInvalidate(MakeMap(syncable::BOOKMARKS, ""))); - EXPECT_CALL(mock_invalidation_state_tracker_, + EXPECT_CALL(mock_invalidation_version_tracker_, SetMaxVersion(syncable::BOOKMARKS, 1)); FireInvalidate("BOOKMARK", 1, NULL); } @@ -164,7 +164,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateNoPayload) { TEST_F(ChromeInvalidationClientTest, InvalidateWithPayload) { EXPECT_CALL(mock_listener_, OnInvalidate(MakeMap(syncable::PREFERENCES, "payload"))); - EXPECT_CALL(mock_invalidation_state_tracker_, + EXPECT_CALL(mock_invalidation_version_tracker_, SetMaxVersion(syncable::PREFERENCES, 1)); FireInvalidate("PREFERENCE", 1, "payload"); } @@ -174,7 +174,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateVersion) { EXPECT_CALL(mock_listener_, OnInvalidate(MakeMap(syncable::APPS, ""))); - EXPECT_CALL(mock_invalidation_state_tracker_, + EXPECT_CALL(mock_invalidation_version_tracker_, SetMaxVersion(syncable::APPS, 1)); // Should trigger. @@ -207,9 +207,9 @@ TEST_F(ChromeInvalidationClientTest, InvalidateVersionMultipleTypes) { EXPECT_CALL(mock_listener_, OnInvalidate(MakeMap(syncable::EXTENSIONS, ""))); - EXPECT_CALL(mock_invalidation_state_tracker_, + EXPECT_CALL(mock_invalidation_version_tracker_, SetMaxVersion(syncable::APPS, 3)); - EXPECT_CALL(mock_invalidation_state_tracker_, + EXPECT_CALL(mock_invalidation_version_tracker_, SetMaxVersion(syncable::EXTENSIONS, 2)); // Should trigger both. @@ -217,21 +217,21 @@ TEST_F(ChromeInvalidationClientTest, InvalidateVersionMultipleTypes) { FireInvalidate("EXTENSION", 2, NULL); Mock::VerifyAndClearExpectations(&mock_listener_); - Mock::VerifyAndClearExpectations(&mock_invalidation_state_tracker_); + Mock::VerifyAndClearExpectations(&mock_invalidation_version_tracker_); // Should both be dropped. FireInvalidate("APP", 1, NULL); FireInvalidate("EXTENSION", 1, NULL); Mock::VerifyAndClearExpectations(&mock_listener_); - Mock::VerifyAndClearExpectations(&mock_invalidation_state_tracker_); + Mock::VerifyAndClearExpectations(&mock_invalidation_version_tracker_); // InvalidateAll shouldn't change any version state. EXPECT_CALL(mock_listener_, OnInvalidate(MakeMapFromSet(types, ""))); FireInvalidateAll(); Mock::VerifyAndClearExpectations(&mock_listener_); - Mock::VerifyAndClearExpectations(&mock_invalidation_state_tracker_); + Mock::VerifyAndClearExpectations(&mock_invalidation_version_tracker_); EXPECT_CALL(mock_listener_, OnInvalidate(MakeMap(syncable::PREFERENCES, ""))); @@ -240,11 +240,11 @@ TEST_F(ChromeInvalidationClientTest, InvalidateVersionMultipleTypes) { EXPECT_CALL(mock_listener_, OnInvalidate(MakeMap(syncable::APPS, ""))); - EXPECT_CALL(mock_invalidation_state_tracker_, + EXPECT_CALL(mock_invalidation_version_tracker_, SetMaxVersion(syncable::PREFERENCES, 5)); - EXPECT_CALL(mock_invalidation_state_tracker_, + EXPECT_CALL(mock_invalidation_version_tracker_, SetMaxVersion(syncable::EXTENSIONS, 3)); - EXPECT_CALL(mock_invalidation_state_tracker_, + EXPECT_CALL(mock_invalidation_version_tracker_, SetMaxVersion(syncable::APPS, 4)); // Should trigger all three. diff --git a/sync/notifier/invalidation_notifier.cc b/sync/notifier/invalidation_notifier.cc index 60f81cc..56ee668e 100644 --- a/sync/notifier/invalidation_notifier.cc +++ b/sync/notifier/invalidation_notifier.cc @@ -19,13 +19,13 @@ namespace sync_notifier { InvalidationNotifier::InvalidationNotifier( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle& - invalidation_state_tracker, + const browser_sync::WeakHandle& + invalidation_version_tracker, const std::string& client_info) : state_(STOPPED), notifier_options_(notifier_options), initial_max_invalidation_versions_(initial_max_invalidation_versions), - invalidation_state_tracker_(invalidation_state_tracker), + invalidation_version_tracker_(invalidation_version_tracker), client_info_(client_info) { DCHECK_EQ(notifier::NOTIFICATION_SERVER, notifier_options.notification_method); @@ -111,7 +111,7 @@ void InvalidationNotifier::OnConnect( invalidation_client_.Start( invalidation_client_id_, client_info_, invalidation_state_, initial_max_invalidation_versions_, - invalidation_state_tracker_, + invalidation_version_tracker_, this, this, base_task); invalidation_state_.clear(); state_ = STARTED; diff --git a/sync/notifier/invalidation_notifier.h b/sync/notifier/invalidation_notifier.h index a287a6f..bd30eed5 100644 --- a/sync/notifier/invalidation_notifier.h +++ b/sync/notifier/invalidation_notifier.h @@ -23,7 +23,7 @@ #include "jingle/notifier/base/notifier_options.h" #include "jingle/notifier/communicator/login.h" #include "sync/notifier/chrome_invalidation_client.h" -#include "sync/notifier/invalidation_state_tracker.h" +#include "sync/notifier/invalidation_version_tracker.h" #include "sync/notifier/state_writer.h" #include "sync/notifier/sync_notifier.h" #include "sync/syncable/model_type.h" @@ -38,12 +38,12 @@ class InvalidationNotifier public ChromeInvalidationClient::Listener, public StateWriter { public: - // |invalidation_state_tracker| must be initialized. + // |invalidation_version_tracker| must be initialized. InvalidationNotifier( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle& - invalidation_state_tracker, + const browser_sync::WeakHandle& + invalidation_version_tracker, const std::string& client_info); virtual ~InvalidationNotifier(); @@ -94,8 +94,8 @@ class InvalidationNotifier const InvalidationVersionMap initial_max_invalidation_versions_; // Passed to |invalidation_client_|. - const browser_sync::WeakHandle - invalidation_state_tracker_; + const browser_sync::WeakHandle + invalidation_version_tracker_; // Passed to |invalidation_client_|. const std::string client_info_; diff --git a/sync/notifier/invalidation_notifier_unittest.cc b/sync/notifier/invalidation_notifier_unittest.cc index 00db644..0788f04c 100644 --- a/sync/notifier/invalidation_notifier_unittest.cc +++ b/sync/notifier/invalidation_notifier_unittest.cc @@ -9,7 +9,7 @@ #include "jingle/notifier/base/fake_base_task.h" #include "jingle/notifier/base/notifier_options.h" #include "net/url_request/url_request_test_util.h" -#include "sync/notifier/invalidation_state_tracker.h" +#include "sync/notifier/invalidation_version_tracker.h" #include "sync/notifier/mock_sync_notifier_observer.h" #include "sync/syncable/model_type.h" #include "sync/syncable/model_type_payload_map.h" @@ -36,7 +36,7 @@ class InvalidationNotifierTest : public testing::Test { notifier_options, InvalidationVersionMap(), browser_sync::MakeWeakHandle( - base::WeakPtr()), + base::WeakPtr()), "fake_client_info")); invalidation_notifier_->AddObserver(&mock_observer_); } diff --git a/sync/notifier/invalidation_state_tracker.h b/sync/notifier/invalidation_state_tracker.h deleted file mode 100644 index dc8ef26..0000000 --- a/sync/notifier/invalidation_state_tracker.h +++ /dev/null @@ -1,37 +0,0 @@ -// 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. -// -// An InvalidationVersionTracker is an interface that handles getting -// and setting (persisting) max invalidation versions. - -#ifndef SYNC_NOTIFIER_INVALIDATION_STATE_TRACKER_H_ -#define SYNC_NOTIFIER_INVALIDATION_STATE_TRACKER_H_ - -#include - -#include "base/basictypes.h" -#include "sync/syncable/model_type.h" - -namespace sync_notifier { - -typedef std::map InvalidationVersionMap; - -class InvalidationStateTracker { - public: - InvalidationStateTracker() {} - - virtual InvalidationVersionMap GetAllMaxVersions() const = 0; - - // |max_version| should be strictly greater than any existing max - // version for |model_type|. - virtual void SetMaxVersion(syncable::ModelType model_type, - int64 max_version) = 0; - - protected: - virtual ~InvalidationStateTracker() {} -}; - -} // namespace sync_notifier - -#endif // SYNC_NOTIFIER_INVALIDATION_STATE_TRACKER_H_ diff --git a/sync/notifier/invalidation_version_tracker.h b/sync/notifier/invalidation_version_tracker.h new file mode 100644 index 0000000..70eda6b --- /dev/null +++ b/sync/notifier/invalidation_version_tracker.h @@ -0,0 +1,38 @@ +// 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. +// +// An InvalidationVersionTracker is an interface that handles getting +// and setting (persisting) max invalidation versions. + +#ifndef SYNC_NOTIFIER_INVALIDATION_VERSION_TRACKER_H_ +#define SYNC_NOTIFIER_INVALIDATION_VERSION_TRACKER_H_ + +#include + +#include "base/basictypes.h" +#include "sync/syncable/model_type.h" + +namespace sync_notifier { + +typedef std::map InvalidationVersionMap; + +class InvalidationVersionTracker { + public: + InvalidationVersionTracker() {} + + virtual InvalidationVersionMap GetAllMaxVersions() const = 0; + + // |max_version| should be strictly greater than any existing max + // version for |model_type|. + virtual void SetMaxVersion(syncable::ModelType model_type, + int64 max_version) = 0; + + protected: + virtual ~InvalidationVersionTracker() {} +}; + +} // namespace sync_notifier + +#endif // SYNC_NOTIFIER_INVALIDATION_VERSION_TRACKER_H_ + diff --git a/sync/notifier/non_blocking_invalidation_notifier.cc b/sync/notifier/non_blocking_invalidation_notifier.cc index b6436a1..01af7d9 100644 --- a/sync/notifier/non_blocking_invalidation_notifier.cc +++ b/sync/notifier/non_blocking_invalidation_notifier.cc @@ -26,8 +26,8 @@ class NonBlockingInvalidationNotifier::Core void Initialize( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle& - invalidation_state_tracker, + const browser_sync::WeakHandle& + invalidation_version_tracker, const std::string& client_info); void Teardown(); void SetUniqueId(const std::string& unique_id); @@ -69,8 +69,8 @@ NonBlockingInvalidationNotifier::Core::~Core() { void NonBlockingInvalidationNotifier::Core::Initialize( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle& - invalidation_state_tracker, + const browser_sync::WeakHandle& + invalidation_version_tracker, const std::string& client_info) { DCHECK(notifier_options.request_context_getter); DCHECK_EQ(notifier::NOTIFICATION_SERVER, @@ -82,7 +82,7 @@ void NonBlockingInvalidationNotifier::Core::Initialize( new InvalidationNotifier( notifier_options, initial_max_invalidation_versions, - invalidation_state_tracker, + invalidation_version_tracker, client_info)); invalidation_notifier_->AddObserver(this); } @@ -147,8 +147,8 @@ void NonBlockingInvalidationNotifier::Core::StoreState( NonBlockingInvalidationNotifier::NonBlockingInvalidationNotifier( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle& - invalidation_state_tracker, + const browser_sync::WeakHandle& + invalidation_version_tracker, const std::string& client_info) : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), core_( @@ -165,7 +165,7 @@ NonBlockingInvalidationNotifier::NonBlockingInvalidationNotifier( core_.get(), notifier_options, initial_max_invalidation_versions, - invalidation_state_tracker, + invalidation_version_tracker, client_info))) { NOTREACHED(); } diff --git a/sync/notifier/non_blocking_invalidation_notifier.h b/sync/notifier/non_blocking_invalidation_notifier.h index 1189403..9432936 100644 --- a/sync/notifier/non_blocking_invalidation_notifier.h +++ b/sync/notifier/non_blocking_invalidation_notifier.h @@ -17,7 +17,7 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "jingle/notifier/base/notifier_options.h" -#include "sync/notifier/invalidation_state_tracker.h" +#include "sync/notifier/invalidation_version_tracker.h" #include "sync/notifier/sync_notifier.h" #include "sync/notifier/sync_notifier_observer.h" #include "sync/util/weak_handle.h" @@ -32,12 +32,12 @@ class NonBlockingInvalidationNotifier : public SyncNotifier, public SyncNotifierObserver { public: - // |invalidation_state_tracker| must be initialized. + // |invalidation_version_tracker| must be initialized. NonBlockingInvalidationNotifier( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle& - invalidation_state_tracker, + const browser_sync::WeakHandle& + invalidation_version_tracker, const std::string& client_info); virtual ~NonBlockingInvalidationNotifier(); diff --git a/sync/notifier/non_blocking_invalidation_notifier_unittest.cc b/sync/notifier/non_blocking_invalidation_notifier_unittest.cc index 9d96586..fea7742 100644 --- a/sync/notifier/non_blocking_invalidation_notifier_unittest.cc +++ b/sync/notifier/non_blocking_invalidation_notifier_unittest.cc @@ -10,7 +10,7 @@ #include "base/threading/thread.h" #include "jingle/notifier/base/fake_base_task.h" #include "net/url_request/url_request_test_util.h" -#include "sync/notifier/invalidation_state_tracker.h" +#include "sync/notifier/invalidation_version_tracker.h" #include "sync/notifier/mock_sync_notifier_observer.h" #include "sync/syncable/model_type.h" #include "sync/syncable/model_type_payload_map.h" @@ -43,7 +43,7 @@ class NonBlockingInvalidationNotifierTest : public testing::Test { notifier_options, InvalidationVersionMap(), browser_sync::MakeWeakHandle( - base::WeakPtr()), + base::WeakPtr()), "fake_client_info")); invalidation_notifier_->AddObserver(&mock_observer_); } diff --git a/sync/notifier/sync_notifier_factory.cc b/sync/notifier/sync_notifier_factory.cc index 5c864f7..1062106 100644 --- a/sync/notifier/sync_notifier_factory.cc +++ b/sync/notifier/sync_notifier_factory.cc @@ -17,8 +17,8 @@ namespace { SyncNotifier* CreateDefaultSyncNotifier( const notifier::NotifierOptions& notifier_options, const InvalidationVersionMap& initial_max_invalidation_versions, - const browser_sync::WeakHandle& - invalidation_state_tracker, + const browser_sync::WeakHandle& + invalidation_version_tracker, const std::string& client_info) { if (notifier_options.notification_method == notifier::NOTIFICATION_P2P) { // TODO(rlarocque): Ideally, the notification target would be @@ -30,7 +30,7 @@ SyncNotifier* CreateDefaultSyncNotifier( return new NonBlockingInvalidationNotifier( notifier_options, initial_max_invalidation_versions, - invalidation_state_tracker, client_info); + invalidation_version_tracker, client_info); } } // namespace @@ -39,15 +39,15 @@ SyncNotifier* CreateDefaultSyncNotifier( SyncNotifierFactory::SyncNotifierFactory( const notifier::NotifierOptions& notifier_options, const std::string& client_info, - const base::WeakPtr& - invalidation_state_tracker) + const base::WeakPtr& + invalidation_version_tracker) : notifier_options_(notifier_options), client_info_(client_info), initial_max_invalidation_versions_( - invalidation_state_tracker.get() ? - invalidation_state_tracker->GetAllMaxVersions() : + invalidation_version_tracker.get() ? + invalidation_version_tracker->GetAllMaxVersions() : InvalidationVersionMap()), - invalidation_state_tracker_(invalidation_state_tracker) { + invalidation_version_tracker_(invalidation_version_tracker) { } SyncNotifierFactory::~SyncNotifierFactory() { @@ -60,7 +60,7 @@ SyncNotifier* SyncNotifierFactory::CreateSyncNotifier() { #else return CreateDefaultSyncNotifier(notifier_options_, initial_max_invalidation_versions_, - invalidation_state_tracker_, + invalidation_version_tracker_, client_info_); #endif } diff --git a/sync/notifier/sync_notifier_factory.h b/sync/notifier/sync_notifier_factory.h index ab3268f..4aab659 100644 --- a/sync/notifier/sync_notifier_factory.h +++ b/sync/notifier/sync_notifier_factory.h @@ -9,7 +9,7 @@ #include "base/memory/weak_ptr.h" #include "jingle/notifier/base/notifier_options.h" -#include "sync/notifier/invalidation_state_tracker.h" +#include "sync/notifier/invalidation_version_tracker.h" #include "sync/util/weak_handle.h" namespace sync_notifier { @@ -21,13 +21,13 @@ class SyncNotifier; class SyncNotifierFactory { public: // |client_info| is a string identifying the client, e.g. a user - // agent string. |invalidation_state_tracker| may be NULL (for + // agent string. |invalidation_version_tracker| may be NULL (for // tests). SyncNotifierFactory( const notifier::NotifierOptions& notifier_options, const std::string& client_info, - const base::WeakPtr& - invalidation_state_tracker); + const base::WeakPtr& + invalidation_version_tracker); ~SyncNotifierFactory(); // Creates a sync notifier. Caller takes ownership of the returned @@ -39,8 +39,8 @@ class SyncNotifierFactory { const notifier::NotifierOptions notifier_options_; const std::string client_info_; const InvalidationVersionMap initial_max_invalidation_versions_; - const browser_sync::WeakHandle - invalidation_state_tracker_; + const browser_sync::WeakHandle + invalidation_version_tracker_; }; } // namespace sync_notifier diff --git a/sync/notifier/sync_notifier_factory_unittest.cc b/sync/notifier/sync_notifier_factory_unittest.cc index f7e16f4..13738ce 100644 --- a/sync/notifier/sync_notifier_factory_unittest.cc +++ b/sync/notifier/sync_notifier_factory_unittest.cc @@ -14,7 +14,7 @@ #include "jingle/notifier/base/notification_method.h" #include "jingle/notifier/base/notifier_options.h" #include "net/url_request/url_request_test_util.h" -#include "sync/notifier/invalidation_state_tracker.h" +#include "sync/notifier/invalidation_version_tracker.h" #include "sync/notifier/mock_sync_notifier_observer.h" #include "sync/notifier/sync_notifier.h" #include "sync/syncable/model_type.h" @@ -54,7 +54,7 @@ TEST_F(SyncNotifierFactoryTest, Basic) { SyncNotifierFactory factory( notifier_options_, "test client info", - base::WeakPtr()); + base::WeakPtr()); scoped_ptr notifier(factory.CreateSyncNotifier()); #if defined(OS_ANDROID) ASSERT_FALSE(notifier.get()); @@ -71,7 +71,7 @@ TEST_F(SyncNotifierFactoryTest, Basic_P2P) { SyncNotifierFactory factory( notifier_options_, "test client info", - base::WeakPtr()); + base::WeakPtr()); scoped_ptr notifier(factory.CreateSyncNotifier()); #if defined(OS_ANDROID) ASSERT_FALSE(notifier.get()); diff --git a/sync/sync.gyp b/sync/sync.gyp index f10d249..f4a8790 100644 --- a/sync/sync.gyp +++ b/sync/sync.gyp @@ -223,7 +223,7 @@ 'notifier/invalidation_notifier.cc', 'notifier/invalidation_util.cc', 'notifier/invalidation_util.h', - 'notifier/invalidation_state_tracker.h', + 'notifier/invalidation_version_tracker.h', 'notifier/non_blocking_invalidation_notifier.h', 'notifier/non_blocking_invalidation_notifier.cc', 'notifier/p2p_notifier.h', diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc index 0b8f345..3b33de7 100644 --- a/sync/tools/sync_listen_notifications.cc +++ b/sync/tools/sync_listen_notifications.cc @@ -19,7 +19,7 @@ #include "jingle/notifier/base/notifier_options.h" #include "net/base/host_port_pair.h" #include "net/url_request/url_request_test_util.h" -#include "sync/notifier/invalidation_state_tracker.h" +#include "sync/notifier/invalidation_version_tracker.h" #include "sync/notifier/sync_notifier.h" #include "sync/notifier/sync_notifier_factory.h" #include "sync/notifier/sync_notifier_observer.h" @@ -65,12 +65,12 @@ class NotificationPrinter : public sync_notifier::SyncNotifierObserver { DISALLOW_COPY_AND_ASSIGN(NotificationPrinter); }; -class NullInvalidationStateTracker - : public base::SupportsWeakPtr, - public sync_notifier::InvalidationStateTracker { +class NullInvalidationVersionTracker + : public base::SupportsWeakPtr, + public sync_notifier::InvalidationVersionTracker { public: - NullInvalidationStateTracker() {} - virtual ~NullInvalidationStateTracker() {} + NullInvalidationVersionTracker() {} + virtual ~NullInvalidationVersionTracker() {} virtual sync_notifier::InvalidationVersionMap GetAllMaxVersions() const OVERRIDE { @@ -171,10 +171,10 @@ int main(int argc, char* argv[]) { command_line, new TestURLRequestContextGetter(io_thread.message_loop_proxy())); const char kClientInfo[] = "sync_listen_notifications"; - NullInvalidationStateTracker null_invalidation_state_tracker; + NullInvalidationVersionTracker null_invalidation_version_tracker; sync_notifier::SyncNotifierFactory sync_notifier_factory( notifier_options, kClientInfo, - null_invalidation_state_tracker.AsWeakPtr()); + null_invalidation_version_tracker.AsWeakPtr()); scoped_ptr sync_notifier( sync_notifier_factory.CreateSyncNotifier()); NotificationPrinter notification_printer; -- cgit v1.1