summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authorghc@google.com <ghc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-06 22:02:38 +0000
committerghc@google.com <ghc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-06 22:02:38 +0000
commit5ce4437e6666e28d9789b884c3e5d72269713cbb (patch)
tree010e53e038a33818084f7d4a3d7392c3ef7c5eb7 /third_party
parentf928f5d0343bc18567db83be93353dd223e6719b (diff)
downloadchromium_src-5ce4437e6666e28d9789b884c3e5d72269713cbb.zip
chromium_src-5ce4437e6666e28d9789b884c3e5d72269713cbb.tar.gz
chromium_src-5ce4437e6666e28d9789b884c3e5d72269713cbb.tar.bz2
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
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_