summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'third_party')
-rw-r--r--third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/callback.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/callback.h b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/callback.h
index e1da19b3..375aacf 100644
--- a/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/callback.h
+++ b/third_party/cacheinvalidation/overrides/google/cacheinvalidation/deps/callback.h
@@ -121,6 +121,16 @@ Closure* NewPermanentCallback(
arg1, arg2, arg3, arg4));
}
+// Creates a Closure that runs |callback| on |arg|. The returned Closure owns
+// |callback|.
+template <typename ArgType>
+Closure* NewPermanentCallback(
+ INVALIDATION_CALLBACK1_TYPE(ArgType)* callback,
+ typename internal::Identity<ArgType>::type arg) {
+ return new ::base::Closure(::base::Bind(
+ &::base::Callback<void(ArgType)>::Run, base::Owned(callback), arg));
+}
+
} // namespace invalidation
#endif // GOOGLE_CACHEINVALIDATION_DEPS_CALLBACK_H_