Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: third_party/WebKit/Source/wtf/Functional.h

Issue 2125003002: Move CrossThreadCopier from platform/ to wtf/ Base URL: https://chromium.googlesource.com/chromium/src.git@TRV_RemoveTupleInBind
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/wtf/Functional.h
diff --git a/third_party/WebKit/Source/wtf/Functional.h b/third_party/WebKit/Source/wtf/Functional.h
index c23fdc7ef54b4f9943bafff3c162db667f9cc85e..34f721557c687bf5fb58009f24ec7e367afb56dc 100644
--- a/third_party/WebKit/Source/wtf/Functional.h
+++ b/third_party/WebKit/Source/wtf/Functional.h
@@ -30,6 +30,7 @@
#include "base/threading/thread_checker.h"
#include "wtf/Allocator.h"
#include "wtf/Assertions.h"
+#include "wtf/CrossThreadCopier.h"
#include "wtf/PassRefPtr.h"
#include "wtf/PtrUtil.h"
#include "wtf/RefPtr.h"
@@ -130,6 +131,13 @@ PassedWrapper<T> passed(T&& value)
return PassedWrapper<T>(std::move(value));
}
+template <typename T>
+struct CrossThreadCopier<PassedWrapper<T>> {
+ STATIC_ONLY(CrossThreadCopier);
+ using Type = PassedWrapper<typename CrossThreadCopier<T>::Type>;
+ static Type copy(PassedWrapper<T>&& value) { return passed(CrossThreadCopier<T>::copy(value.moveOut())); }
+};
+
template <typename T, FunctionThreadAffinity threadAffinity>
class UnretainedWrapper final {
public:
@@ -154,6 +162,11 @@ UnretainedWrapper<T, CrossThreadAffinity> crossThreadUnretained(T* value)
return UnretainedWrapper<T, CrossThreadAffinity>(value);
}
+template<typename T>
+struct CrossThreadCopier<UnretainedWrapper<T, CrossThreadAffinity>> : public CrossThreadCopierPassThrough<UnretainedWrapper<T, CrossThreadAffinity>> {
+ STATIC_ONLY(CrossThreadCopier);
+};
+
template <typename T>
struct ParamStorageTraits {
typedef T StorageType;

Powered by Google App Engine
This is Rietveld 408576698