Commit b5a8b7c8 authored by hidehiko@chromium.org's avatar hidehiko@chromium.org

Implement ComposedCallback with three arguments and the second one is scoped_ptr.

Just add new pattern. It will be used to implement DriveFileStreamReader.

BUG=127129
TEST=Ran unit_tests.

Review URL: https://codereview.chromium.org/14235017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194569 0039d316-1c4b-4281-b951-d872f2087c98
parent 72babe11
...@@ -66,6 +66,17 @@ struct ComposedCallback<void(T1, T2, T3)> { ...@@ -66,6 +66,17 @@ struct ComposedCallback<void(T1, T2, T3)> {
} }
}; };
// ComposedCallback with three arguments, and the second one is scoped_ptr.
template<typename T1, typename T2, typename D2, typename T3>
struct ComposedCallback<void(T1, scoped_ptr<T2, D2>, T3)> {
static void Run(
const base::Callback<void(const base::Closure&)>& runner,
const base::Callback<void(T1, scoped_ptr<T2, D2>, T3)>& callback,
T1 arg1, scoped_ptr<T2, D2> arg2, T3 arg3) {
runner.Run(base::Bind(callback, arg1, base::Passed(&arg2), arg3));
}
};
// ComposedCallback with three arguments, and the last one is scoped_ptr. // ComposedCallback with three arguments, and the last one is scoped_ptr.
template<typename T1, typename T2, typename T3, typename D3> template<typename T1, typename T2, typename T3, typename D3>
struct ComposedCallback<void(T1, T2, scoped_ptr<T3, D3>)> { struct ComposedCallback<void(T1, T2, scoped_ptr<T3, D3>)> {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment