diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 02:04:22 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-13 02:04:22 +0000 |
commit | 5bfa2566e4d2cfbf651df5bb7b76177d3429ae61 (patch) | |
tree | e6f6b0d08e2b7ce77ae01cad4ec5c0699cb15d7d | |
parent | 7a3a965742838666dbfb3665783d08f3976f1d6c (diff) | |
download | chromium_src-5bfa2566e4d2cfbf651df5bb7b76177d3429ae61.zip chromium_src-5bfa2566e4d2cfbf651df5bb7b76177d3429ae61.tar.gz chromium_src-5bfa2566e4d2cfbf651df5bb7b76177d3429ae61.tar.bz2 |
[Sync] Rolled cache invalidation API to @49.
Made changes to reflect API changes.
Added more partially-applied callback implementations.
Added more needed includes.
BUG=58556
TEST=Existing unit tests
Review URL: http://codereview.chromium.org/3665003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62369 0039d316-1c4b-4281-b951-d872f2087c98
13 files changed, 195 insertions, 182 deletions
@@ -52,7 +52,7 @@ deps = { "http://google-safe-browsing.googlecode.com/svn/trunk/testing@101", "src/third_party/cacheinvalidation/files": - (Var("googlecode_url") % "google-cache-invalidation-api") + "/trunk@39", + (Var("googlecode_url") % "google-cache-invalidation-api") + "/trunk@49", "src/tools/gyp": (Var("googlecode_url") % "gyp") + "/trunk@849", diff --git a/chrome/browser/sync/notifier/chrome_invalidation_client.cc b/chrome/browser/sync/notifier/chrome_invalidation_client.cc index 606eb4f..563b132 100644 --- a/chrome/browser/sync/notifier/chrome_invalidation_client.cc +++ b/chrome/browser/sync/notifier/chrome_invalidation_client.cc @@ -128,6 +128,28 @@ void ChromeInvalidationClient::InvalidateAll( RunAndDeleteClosure(callback); } +void ChromeInvalidationClient::RegistrationStateChanged( + const invalidation::ObjectId& object_id, + invalidation::RegistrationState new_state, + const invalidation::UnknownHint& unknown_hint) { + DCHECK(non_thread_safe_.CalledOnValidThread()); + VLOG(1) << "RegistrationStateChanged to " << new_state; + if (new_state == invalidation::RegistrationState_UNKNOWN) { + VLOG(1) << "is_transient=" << unknown_hint.is_transient() + << ", message=" << unknown_hint.message(); + } + // TODO(akalin): Figure out something else to do if the failure + // isn't transient. Even if it is transient, we may still want to + // add exponential back-off or limit the number of attempts. + syncable::ModelType model_type; + if (ObjectIdToRealModelType(object_id, &model_type) && + (new_state != invalidation::RegistrationState_REGISTERED)) { + registration_manager_->MarkRegistrationLost(model_type); + } else { + LOG(WARNING) << "Could not get object id model type; ignoring"; + } +} + void ChromeInvalidationClient::AllRegistrationsLost( invalidation::Closure* callback) { DCHECK(non_thread_safe_.CalledOnValidThread()); diff --git a/chrome/browser/sync/notifier/chrome_invalidation_client.h b/chrome/browser/sync/notifier/chrome_invalidation_client.h index 7cbc3f8..53e37f8 100644 --- a/chrome/browser/sync/notifier/chrome_invalidation_client.h +++ b/chrome/browser/sync/notifier/chrome_invalidation_client.h @@ -73,6 +73,11 @@ class ChromeInvalidationClient virtual void InvalidateAll(invalidation::Closure* callback); + virtual void RegistrationStateChanged( + const invalidation::ObjectId& object_id, + invalidation::RegistrationState new_state, + const invalidation::UnknownHint& unknown_hint); + virtual void AllRegistrationsLost(invalidation::Closure* callback); virtual void RegistrationLost(const invalidation::ObjectId& object_id, diff --git a/chrome/browser/sync/notifier/chrome_system_resources.cc b/chrome/browser/sync/notifier/chrome_system_resources.cc index d23f90b..2bc4897 100644 --- a/chrome/browser/sync/notifier/chrome_system_resources.cc +++ b/chrome/browser/sync/notifier/chrome_system_resources.cc @@ -93,7 +93,7 @@ void ChromeSystemResources::Log( case WARNING_LEVEL: log_severity = logging::LOG_WARNING; break; - case ERROR_LEVEL: + case SEVERE_LEVEL: log_severity = logging::LOG_ERROR; break; } diff --git a/chrome/browser/sync/notifier/registration_manager.cc b/chrome/browser/sync/notifier/registration_manager.cc index 5b98902..c03c07c 100644 --- a/chrome/browser/sync/notifier/registration_manager.cc +++ b/chrome/browser/sync/notifier/registration_manager.cc @@ -8,7 +8,6 @@ #include "chrome/browser/sync/notifier/invalidation_util.h" #include "chrome/browser/sync/syncable/model_type.h" -#include "google/cacheinvalidation/invalidation-client.h" namespace sync_notifier { @@ -22,20 +21,21 @@ RegistrationManager::~RegistrationManager() { DCHECK(non_thread_safe_.CalledOnValidThread()); } -bool RegistrationManager::RegisterType(syncable::ModelType model_type) { +void RegistrationManager::RegisterType(syncable::ModelType model_type) { DCHECK(non_thread_safe_.CalledOnValidThread()); invalidation::ObjectId object_id; if (!RealModelTypeToObjectId(model_type, &object_id)) { - LOG(ERROR) << "Invalid model type: " << model_type; - return false; + LOG(DFATAL) << "Invalid model type: " << model_type; + return; } RegistrationStatusMap::iterator it = registration_status_.insert( - std::make_pair(model_type, UNREGISTERED)).first; - if (it->second == UNREGISTERED) { + std::make_pair( + model_type, + invalidation::RegistrationState_UNREGISTERED)).first; + if (it->second == invalidation::RegistrationState_UNREGISTERED) { RegisterObject(object_id, it); } - return true; } bool RegistrationManager::IsRegistered( @@ -46,7 +46,7 @@ bool RegistrationManager::IsRegistered( if (it == registration_status_.end()) { return false; } - return it->second == REGISTERED; + return it->second == invalidation::RegistrationState_REGISTERED; } void RegistrationManager::MarkRegistrationLost( @@ -63,7 +63,7 @@ void RegistrationManager::MarkRegistrationLost( LOG(ERROR) << "Unknown model type: " << model_type; return; } - it->second = UNREGISTERED; + it->second = invalidation::RegistrationState_UNREGISTERED; RegisterObject(object_id, it); } @@ -77,7 +77,7 @@ void RegistrationManager::MarkAllRegistrationsLost() { LOG(DFATAL) << "Invalid model type: " << it->first; continue; } - it->second = UNREGISTERED; + it->second = invalidation::RegistrationState_UNREGISTERED; RegisterObject(object_id, it); } } @@ -85,49 +85,9 @@ void RegistrationManager::MarkAllRegistrationsLost() { void RegistrationManager::RegisterObject( const invalidation::ObjectId& object_id, RegistrationStatusMap::iterator it) { - DCHECK_EQ(it->second, UNREGISTERED); - invalidation_client_->Register( - object_id, - invalidation::NewPermanentCallback( - this, &RegistrationManager::OnRegister)); - it->second = PENDING; -} - -void RegistrationManager::OnRegister( - const invalidation::RegistrationUpdateResult& result) { - DCHECK(non_thread_safe_.CalledOnValidThread()); - LOG(INFO) << "OnRegister: " << RegistrationUpdateResultToString(result); - if (result.operation().type() != - invalidation::RegistrationUpdate::REGISTER) { - LOG(ERROR) << "Got non-register result"; - return; - } - syncable::ModelType model_type; - if (!ObjectIdToRealModelType(result.operation().object_id(), - &model_type)) { - LOG(ERROR) << "Could not get model type"; - return; - } - RegistrationStatusMap::iterator it = - registration_status_.find(model_type); - if (it == registration_status_.end()) { - LOG(ERROR) << "Unknown model type: " << model_type; - return; - } - invalidation::Status::Code code = result.status().code(); - switch (code) { - case invalidation::Status::SUCCESS: - it->second = REGISTERED; - break; - case invalidation::Status::TRANSIENT_FAILURE: - // TODO(akalin): Add retry logic. For now, just fall through. - default: - // Treat everything else as a permanent failure. - if (VLOG_IS_ON(1)) { - LOG(ERROR) << "Registration failed with code: " << code; - } - break; - } + DCHECK_EQ(it->second, invalidation::RegistrationState_UNREGISTERED); + invalidation_client_->Register(object_id); + it->second = invalidation::RegistrationState_REGISTERED; } } // namespace sync_notifier diff --git a/chrome/browser/sync/notifier/registration_manager.h b/chrome/browser/sync/notifier/registration_manager.h index 06acc89..1b1a534 100644 --- a/chrome/browser/sync/notifier/registration_manager.h +++ b/chrome/browser/sync/notifier/registration_manager.h @@ -14,12 +14,7 @@ #include "base/basictypes.h" #include "base/non_thread_safe.h" #include "chrome/browser/sync/syncable/model_type.h" - -namespace invalidation { -class InvalidationClient; -class ObjectId; -class RegistrationUpdateResult; -} // namespace +#include "google/cacheinvalidation/invalidation-client.h" namespace sync_notifier { @@ -31,13 +26,10 @@ class RegistrationManager { ~RegistrationManager(); - // If |model_type| is valid, starts the process to register it and - // returns true. Otherwise, returns false. - bool RegisterType(syncable::ModelType model_type); + // Registers the given |model_type|, which must be valid. + void RegisterType(syncable::ModelType model_type); - // Returns true iff |model_type| has been successfully registered. - // Note that IsRegistered(model_type) may not immediately (or ever) - // return true after calling RegisterType(model_type). + // Returns true iff |model_type| is currently registered. // // Currently only used by unit tests. bool IsRegistered(syncable::ModelType model_type) const; @@ -52,16 +44,7 @@ class RegistrationManager { void MarkAllRegistrationsLost(); private: - enum RegistrationStatus { - // Registration request has not yet been sent. - UNREGISTERED, - // Registration request has been sent; waiting on confirmation. - PENDING, - // Registration has been confirmed. - REGISTERED, - }; - - typedef std::map<syncable::ModelType, RegistrationStatus> + typedef std::map<syncable::ModelType, invalidation::RegistrationState> RegistrationStatusMap; // Calls invalidation_client_->Register() on |object_id|. sets diff --git a/chrome/browser/sync/notifier/registration_manager_unittest.cc b/chrome/browser/sync/notifier/registration_manager_unittest.cc index de773f6..5307d46 100644 --- a/chrome/browser/sync/notifier/registration_manager_unittest.cc +++ b/chrome/browser/sync/notifier/registration_manager_unittest.cc @@ -21,38 +21,15 @@ namespace { // Register(). class FakeInvalidationClient : public invalidation::InvalidationClient { public: - struct Args { - Args() : callback(NULL) {} - - Args(const invalidation::ObjectId& oid, - invalidation::RegistrationCallback* callback) - : oid(oid), callback(callback) {} - - invalidation::ObjectId oid; - invalidation::RegistrationCallback* callback; - }; - FakeInvalidationClient() {} - virtual ~FakeInvalidationClient() { - for (std::deque<Args>::iterator it = register_calls.begin(); - it != register_calls.end(); ++it) { - delete it->callback; - } - } - - virtual void Register(const invalidation::ObjectId& oid, - invalidation::RegistrationCallback* callback) { - register_calls.push_back(Args(oid, callback)); - } + virtual ~FakeInvalidationClient() {} - virtual void Unregister(const invalidation::ObjectId& oid, - invalidation::RegistrationCallback* callback) { - ADD_FAILURE(); - delete callback; + virtual void Register(const invalidation::ObjectId& oid) { + registered_oids.push_back(oid); } - virtual void PermanentShutdown() { + virtual void Unregister(const invalidation::ObjectId& oid) { ADD_FAILURE(); } @@ -61,7 +38,7 @@ class FakeInvalidationClient : public invalidation::InvalidationClient { return NULL; } - std::deque<Args> register_calls; + std::deque<invalidation::ObjectId> registered_oids; private: DISALLOW_COPY_AND_ASSIGN(FakeInvalidationClient); @@ -124,48 +101,18 @@ TEST_F(RegistrationManagerTest, RegisterType) { } ASSERT_EQ(kModelTypeCount, - fake_invalidation_client_.register_calls.size()); + fake_invalidation_client_.registered_oids.size()); - // Nothing should be registered yet. + // Everything should be registered. for (size_t i = 0; i < kModelTypeCount; ++i) { - EXPECT_FALSE(registration_manager_.IsRegistered(kModelTypes[i])); + EXPECT_TRUE(registration_manager_.IsRegistered(kModelTypes[i])); } // Check object IDs. for (size_t i = 0; i < kModelTypeCount; ++i) { EXPECT_EQ(kModelTypes[i], ObjectIdToModelType( - fake_invalidation_client_.register_calls[i].oid)); - } - - // Prepare results. - std::vector<invalidation::RegistrationUpdateResult> results( - kModelTypeCount); - for (size_t i = 0; i < kModelTypeCount; ++i) { - results[i] = MakeRegistrationUpdateResult(kModelTypes[i]); - } - - // Generate a variety of error conditions in all but the first - // result. - results[1].mutable_operation()->set_type( - invalidation::RegistrationUpdate::UNREGISTER); - results[2].mutable_operation()->mutable_object_id()-> - mutable_name()->set_string_value("garbage"); - results[3].mutable_status()-> - set_code(invalidation::Status::PERMANENT_FAILURE); - *results[4].mutable_operation()->mutable_object_id() = - ModelTypeToObjectId(syncable::TYPED_URLS); - - - // Send the registration results back. - for (size_t i = 0; i < kModelTypeCount; ++i) { - fake_invalidation_client_.register_calls[i].callback->Run(results[i]); - } - - // Only the first one should be registered. - EXPECT_TRUE(registration_manager_.IsRegistered(kModelTypes[0])); - for (size_t i = 1; i < kModelTypeCount; ++i) { - EXPECT_FALSE(registration_manager_.IsRegistered(kModelTypes[i])); + fake_invalidation_client_.registered_oids[i])); } } @@ -185,13 +132,7 @@ TEST_F(RegistrationManagerTest, MarkRegistrationLost) { } ASSERT_EQ(kModelTypeCount, - fake_invalidation_client_.register_calls.size()); - - // Send the registration results back. - for (size_t i = 0; i < kModelTypeCount; ++i) { - fake_invalidation_client_.register_calls[i].callback->Run( - MakeRegistrationUpdateResult(kModelTypes[i])); - } + fake_invalidation_client_.registered_oids.size()); // All should be registered. for (size_t i = 0; i < kModelTypeCount; ++i) { @@ -204,22 +145,9 @@ TEST_F(RegistrationManagerTest, MarkRegistrationLost) { } ASSERT_EQ(2 * kModelTypeCount - 1, - fake_invalidation_client_.register_calls.size()); - - // Only the first one should be registered. - EXPECT_TRUE(registration_manager_.IsRegistered(kModelTypes[0])); - for (size_t i = 1; i < kModelTypeCount; ++i) { - EXPECT_FALSE(registration_manager_.IsRegistered(kModelTypes[i])); - } + fake_invalidation_client_.registered_oids.size()); - // Send more registration results back. - for (size_t i = 1; i < kModelTypeCount; ++i) { - fake_invalidation_client_.register_calls[kModelTypeCount + i - 1]. - callback->Run( - MakeRegistrationUpdateResult(kModelTypes[i])); - } - - // All should be registered. + // All should still be registered. for (size_t i = 0; i < kModelTypeCount; ++i) { EXPECT_TRUE(registration_manager_.IsRegistered(kModelTypes[i])); } @@ -241,13 +169,7 @@ TEST_F(RegistrationManagerTest, MarkAllRegistrationsLost) { } ASSERT_EQ(kModelTypeCount, - fake_invalidation_client_.register_calls.size()); - - // Send the registration results back. - for (size_t i = 0; i < kModelTypeCount; ++i) { - fake_invalidation_client_.register_calls[i].callback->Run( - MakeRegistrationUpdateResult(kModelTypes[i])); - } + fake_invalidation_client_.registered_oids.size()); // All should be registered. for (size_t i = 0; i < kModelTypeCount; ++i) { @@ -262,21 +184,9 @@ TEST_F(RegistrationManagerTest, MarkAllRegistrationsLost) { registration_manager_.MarkAllRegistrationsLost(); ASSERT_EQ(3 * kModelTypeCount - 1, - fake_invalidation_client_.register_calls.size()); - - // None should be registered. - for (size_t i = 0; i < kModelTypeCount; ++i) { - EXPECT_FALSE(registration_manager_.IsRegistered(kModelTypes[i])); - } + fake_invalidation_client_.registered_oids.size()); - // Send more registration results back. - for (size_t i = 0; i < kModelTypeCount; ++i) { - fake_invalidation_client_.register_calls[2 * kModelTypeCount + i - 1]. - callback->Run( - MakeRegistrationUpdateResult(kModelTypes[i])); - } - - // All should be registered. + // All should still be registered. for (size_t i = 0; i < kModelTypeCount; ++i) { EXPECT_TRUE(registration_manager_.IsRegistered(kModelTypes[i])); } diff --git a/third_party/cacheinvalidation/cacheinvalidation.gyp b/third_party/cacheinvalidation/cacheinvalidation.gyp index 5cadd54..60d64cb 100644 --- a/third_party/cacheinvalidation/cacheinvalidation.gyp +++ b/third_party/cacheinvalidation/cacheinvalidation.gyp @@ -24,6 +24,7 @@ 'target_name': 'cacheinvalidation_proto', 'type': 'none', 'sources': [ + '<(proto_dir_root)/google/cacheinvalidation/ticl_persistence.proto', '<(proto_dir_root)/google/cacheinvalidation/types.proto', ], # TODO(akalin): This block was copied from the sync_proto target @@ -63,14 +64,20 @@ 'target_name': 'cacheinvalidation', 'type': '<(library)', 'sources': [ + '<(protoc_out_dir)/<(proto_dir_relpath)/ticl_persistence.pb.h', + '<(protoc_out_dir)/<(proto_dir_relpath)/ticl_persistence.pb.cc', '<(protoc_out_dir)/<(proto_dir_relpath)/types.pb.h', '<(protoc_out_dir)/<(proto_dir_relpath)/types.pb.cc', 'overrides/google/cacheinvalidation/callback.h', 'overrides/google/cacheinvalidation/compiler-specific.h', + 'overrides/google/cacheinvalidation/gmock.h', 'overrides/google/cacheinvalidation/googletest.h', + 'overrides/google/cacheinvalidation/hash_map.h', 'overrides/google/cacheinvalidation/logging.h', + 'overrides/google/cacheinvalidation/md5.h', 'overrides/google/cacheinvalidation/mutex.h', 'overrides/google/cacheinvalidation/random.h', + 'overrides/google/cacheinvalidation/scoped_ptr.h', 'overrides/google/cacheinvalidation/stl-namespace.h' 'overrides/google/cacheinvalidation/string_util.h' 'overrides/google/cacheinvalidation/time.h', @@ -81,6 +88,10 @@ 'files/src/google/cacheinvalidation/log-macro.h', 'files/src/google/cacheinvalidation/network-manager.cc', 'files/src/google/cacheinvalidation/network-manager.h', + 'files/src/google/cacheinvalidation/persistence-manager.cc', + 'files/src/google/cacheinvalidation/persistence-manager.h', + 'files/src/google/cacheinvalidation/persistence-utils.cc', + 'files/src/google/cacheinvalidation/persistence-utils.h', 'files/src/google/cacheinvalidation/registration-update-manager.cc', 'files/src/google/cacheinvalidation/registration-update-manager.h', 'files/src/google/cacheinvalidation/session-manager.cc', @@ -123,11 +134,13 @@ '../../base/test/run_all_unittests.cc', 'files/src/google/cacheinvalidation/system-resources-for-test.h', 'files/src/google/cacheinvalidation/invalidation-client-impl_test.cc', + 'files/src/google/cacheinvalidation/persistence-utils_test.cc', 'files/src/google/cacheinvalidation/throttle_test.cc', ], 'dependencies': [ '../../base/base.gyp:base', '../../base/base.gyp:test_support_base', + '../../testing/gmock.gyp:gmock', '../../testing/gtest.gyp:gtest', 'cacheinvalidation', ], diff --git a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/callback.h b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/callback.h index d0ec702..5f41f64 100644 --- a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/callback.h +++ b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/callback.h @@ -139,6 +139,46 @@ class TwoArgCallbackRunner : public CallbackRunner<Tuple0> { typename internal::remove_reference<Arg2>::type arg2_; }; +template <class T, typename Arg1, typename Arg2> +class TwoArgOnePartialCallbackRunner : public CallbackRunner<Tuple1<Arg2> > { + public: + TwoArgOnePartialCallbackRunner(T* obj, void (T::*meth)(Arg1, Arg2), + Arg1 arg1) + : obj_(obj), meth_(meth), arg1_(arg1) {} + + virtual ~TwoArgOnePartialCallbackRunner() {} + + virtual void RunWithParams(const Tuple1<Arg2>& params) { + (obj_->*meth_)(arg1_, params.a); + } + + private: + T* obj_; + void (T::*meth_)(Arg1, Arg2); + typename internal::remove_reference<Arg1>::type arg1_; +}; + +template <class T, typename Arg1, typename Arg2, typename Arg3> +class ThreeArgCallbackRunner : public CallbackRunner<Tuple0> { + public: + ThreeArgCallbackRunner(T* obj, void (T::*meth)(Arg1, Arg2, Arg3), + Arg1 arg1, Arg2 arg2, Arg3 arg3) + : obj_(obj), meth_(meth), arg1_(arg1), arg2_(arg2), arg3_(arg3) {} + + virtual ~ThreeArgCallbackRunner() {} + + virtual void RunWithParams(const Tuple0& params) { + (obj_->*meth_)(arg1_, arg2_, arg3_); + } + + private: + T* obj_; + void (T::*meth_)(Arg1, Arg2, Arg3); + typename internal::remove_reference<Arg1>::type arg1_; + typename internal::remove_reference<Arg2>::type arg2_; + typename internal::remove_reference<Arg3>::type arg3_; +}; + // Then route the appropriate overloads of NewPermanentCallback() to // use the above. @@ -177,6 +217,26 @@ typename Callback0::Type* NewPermanentCallback( return new TwoArgCallbackRunner<T1, Arg1, Arg2>(object, method, arg1, arg2); } +template <class T1, class T2, typename Arg1, typename Arg2> +typename Callback1<Arg2>::Type* NewPermanentCallback( + T1* object, + void (T2::*method)(Arg1, Arg2), + typename internal::Identity<Arg1>::type arg1) { + return new TwoArgOnePartialCallbackRunner<T1, Arg1, Arg2>( + object, method, arg1); +} + +template <class T1, class T2, typename Arg1, typename Arg2, typename Arg3> +typename Callback0::Type* NewPermanentCallback( + T1* object, + void (T2::*method)(Arg1, Arg2, Arg3), + typename internal::Identity<Arg1>::type arg1, + typename internal::Identity<Arg2>::type arg2, + typename internal::Identity<Arg3>::type arg3) { + return new ThreeArgCallbackRunner<T1, Arg1, Arg2, Arg3> + (object, method, arg1, arg2, arg3); +} + } // namespace invalidation #endif // GOOGLE_CACHEINVALIDATION_CALLBACK_H_ diff --git a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/gmock.h b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/gmock.h new file mode 100644 index 0000000..8afb9fb --- /dev/null +++ b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/gmock.h @@ -0,0 +1,10 @@ +// Copyright (c) 2010 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. + +#ifndef GOOGLE_CACHEINVALIDATION_GMOCK_H_ +#define GOOGLE_CACHEINVALIDATION_GMOCK_H_ + +#include "testing/gmock/include/gmock/gmock.h" + +#endif // GOOGLE_CACHEINVALIDATION_GMOCK_H_ diff --git a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/hash_map.h b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/hash_map.h new file mode 100644 index 0000000..3dbe724 --- /dev/null +++ b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/hash_map.h @@ -0,0 +1,16 @@ +// Copyright (c) 2010 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. + +#ifndef GOOGLE_CACHEINVALIDATION_HASH_MAP_H_ +#define GOOGLE_CACHEINVALIDATION_HASH_MAP_H_ + +#include "base/hash_tables.h" + +namespace invalidation { + +using base::hash_map; + +} // namespace invalidation + +#endif // GOOGLE_CACHEINVALIDATION_HASH_MAP_H_ diff --git a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/md5.h b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/md5.h new file mode 100644 index 0000000..5627db1 --- /dev/null +++ b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/md5.h @@ -0,0 +1,18 @@ +// Copyright (c) 2010 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. + +#ifndef GOOGLE_CACHEINVALIDATION_MD5_H_ +#define GOOGLE_CACHEINVALIDATION_MD5_H_ + +#include "base/md5.h" + +namespace invalidation { + +inline void ComputeMd5Digest(const string& data, string* digest) { + *digest = MD5String(data); +} + +} // namespace invalidation + +#endif // GOOGLE_CACHEINVALIDATION_MD5_H_ diff --git a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/scoped_ptr.h b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/scoped_ptr.h new file mode 100644 index 0000000..021d2dd --- /dev/null +++ b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/scoped_ptr.h @@ -0,0 +1,16 @@ +// Copyright (c) 2010 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. + +#ifndef GOOGLE_CACHEINVALIDATION_SCOPED_PTR_H_ +#define GOOGLE_CACHEINVALIDATION_SCOPED_PTR_H_ + +#include "base/scoped_ptr.h" + +namespace invalidation { + +using ::scoped_ptr; + +} // namespace invalidation + +#endif // GOOGLE_CACHEINVALIDATION_SCOPED_PTR_H_ |