diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-03 22:34:17 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-03 22:34:17 +0000 |
commit | d53e6a6c73062427e7408cf4cb156938ac509311 (patch) | |
tree | e98959728b1d1ab9717753b3b6189f7bd375c034 /base/callback_internal.h | |
parent | 3f24ae2243c95d0907a4447b799b37e8569650a0 (diff) | |
download | chromium_src-d53e6a6c73062427e7408cf4cb156938ac509311.zip chromium_src-d53e6a6c73062427e7408cf4cb156938ac509311.tar.gz chromium_src-d53e6a6c73062427e7408cf4cb156938ac509311.tar.bz2 |
When using PostTaskAndReplyWithResults, if the ResultType is a passed type (eg: scoped_ptr and friends), .Pass() the result to the reply.
Because the temporary storage of the result is an implementation detail of PostTaskAndReplyWithResults, its safe to always assume that passed types should be passed.
BUG=126008
TEST=TaskRunnerHelpersTest.PostTaskAndReplyWithResultPassed
Review URL: http://codereview.chromium.org/10344012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/callback_internal.h')
-rw-r--r-- | base/callback_internal.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/base/callback_internal.h b/base/callback_internal.h index 244504b..92ea80a 100644 --- a/base/callback_internal.h +++ b/base/callback_internal.h @@ -166,6 +166,11 @@ struct CallbackParamTraits<ScopedVector<T> > { // In C++11, std::forward would replace all uses of this function. However, it // is impossible to implement a general std::forward with C++11 due to a lack // of rvalue references. +// +// In addition to Callback/Bind, this is used by PostTaskAndReplyWithResult to +// simulate std::forward() and forward the result of one Callback as a +// parameter to another callback. This is to support Callbacks that return +// the movable-but-not-copyable types whitelisted above. template <typename T> T& CallbackForward(T& t) { return t; } |