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

Unified Diff: mojo/public/cpp/bindings/lib/callback_internal.h

Issue 294833002: Mojo: more idiomatic C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more Created 6 years, 7 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: mojo/public/cpp/bindings/lib/callback_internal.h
diff --git a/mojo/public/cpp/bindings/lib/callback_internal.h b/mojo/public/cpp/bindings/lib/callback_internal.h
index 4802e437f2b6be2a4bec41ca7a27398175b1dcf2..4c1b26216e8b8653dee7a2273d27d5c354d69dc1 100644
--- a/mojo/public/cpp/bindings/lib/callback_internal.h
+++ b/mojo/public/cpp/bindings/lib/callback_internal.h
@@ -15,20 +15,20 @@ struct Callback_ParamTraits {};
template <typename T>
struct Callback_ParamTraits<T, true> {
- typedef const T& ForwardType;
- static const bool kIsScopedHandle = false;
+ typedef T ForwardType;
+ static const bool kIsMoveOnlyType = true;
};
template <typename T>
struct Callback_ParamTraits<T, false> {
typedef T ForwardType;
- static const bool kIsScopedHandle = false;
+ static const bool kIsMoveOnlyType = false;
};
template <typename H>
struct Callback_ParamTraits<ScopedHandleBase<H>, true> {
typedef ScopedHandleBase<H> ForwardType;
- static const bool kIsScopedHandle = true;
+ static const bool kIsMoveOnlyType = true;
};
template<bool B, typename T = void>
@@ -38,13 +38,13 @@ template<typename T>
struct EnableIf<true, T> { typedef T type; };
template <typename T>
-typename EnableIf<!Callback_ParamTraits<T>::kIsScopedHandle, T>::type&
+typename EnableIf<!Callback_ParamTraits<T>::kIsMoveOnlyType, T>::type&
Callback_Forward(T& t) {
return t;
}
template <typename T>
-typename EnableIf<Callback_ParamTraits<T>::kIsScopedHandle, T>::type
+typename EnableIf<Callback_ParamTraits<T>::kIsMoveOnlyType, T>::type
Callback_Forward(T& t) {
return t.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698