| Index: Source/platform/ThreadSafeFunctional.h
|
| diff --git a/Source/platform/ThreadSafeFunctional.h b/Source/platform/ThreadSafeFunctional.h
|
| index 1b5b5dac85d625b4947fbf5d911a19e06dd3e201..9b8efdbad5274fcc71b49d9880d2149455a7ede7 100644
|
| --- a/Source/platform/ThreadSafeFunctional.h
|
| +++ b/Source/platform/ThreadSafeFunctional.h
|
| @@ -10,6 +10,22 @@
|
|
|
| namespace blink {
|
|
|
| +// threadSafeBind() is bind() for cross-thread task posting.
|
| +// threadSafeBind() applies CrossThreadCopier to the arguments.
|
| +//
|
| +// Example:
|
| +// void func1(int, const String&);
|
| +// f = threadSafeBind(func1, 42, str);
|
| +// func1(42, str2) will be called when |f()| is executed,
|
| +// where |str2| is a deep copy of |str| (created by str.isolatedCopy()).
|
| +//
|
| +// threadSafeBind(str) is similar to bind(str.isolatedCopy()), but the latter
|
| +// is NOT thread-safe due to temporary objects (https://crbug.com/390851).
|
| +//
|
| +// Don't (if you pass the task across threads):
|
| +// bind(func1, 42, str);
|
| +// bind(func1, 42, str.isolatedCopy());
|
| +
|
| template<typename... FreeVariableTypes, typename FunctionType>
|
| PassOwnPtr<Function<typename WTF::FunctionWrapper<FunctionType>::ResultType(FreeVariableTypes...)>> threadSafeBind(
|
| FunctionType function)
|
|
|