From 5ce4437e6666e28d9789b884c3e5d72269713cbb Mon Sep 17 00:00:00 2001 From: "ghc@google.com" Date: Wed, 6 Jun 2012 22:02:38 +0000 Subject: roll cacheinvalidation forward to @218: fixes a potential memory leak that could occur if a callback that closed over another callback didn't get run Review URL: https://chromiumcodereview.appspot.com/10535020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140852 0039d316-1c4b-4281-b951-d872f2087c98 --- DEPS | 2 +- .../overrides/google/cacheinvalidation/deps/callback.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 6ebe815..a22d944 100644 --- a/DEPS +++ b/DEPS @@ -109,7 +109,7 @@ deps = { "src/third_party/cacheinvalidation/files/src/google": (Var("googlecode_url") % "google-cache-invalidation-api") + - "/trunk/src/google@213", + "/trunk/src/google@218", "src/third_party/leveldatabase/src": (Var("googlecode_url") % "leveldb") + "/trunk@64", 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 +Closure* NewPermanentCallback( + INVALIDATION_CALLBACK1_TYPE(ArgType)* callback, + typename internal::Identity::type arg) { + return new ::base::Closure(::base::Bind( + &::base::Callback::Run, base::Owned(callback), arg)); +} + } // namespace invalidation #endif // GOOGLE_CACHEINVALIDATION_DEPS_CALLBACK_H_ -- cgit v1.1