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

Side by Side Diff: mojo/public/cpp/bindings/lib/bindings_internal.h

Issue 431533003: Fix template bugs that prevent rolling gtest DEPS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enum Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « base/bind_helpers.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
7 7
8 #include "mojo/public/cpp/bindings/lib/template_util.h" 8 #include "mojo/public/cpp/bindings/lib/template_util.h"
9 #include "mojo/public/cpp/system/core.h" 9 #include "mojo/public/cpp/system/core.h"
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 template <typename T> 59 template <typename T>
60 T FetchAndReset(T* ptr) { 60 T FetchAndReset(T* ptr) {
61 T temp = *ptr; 61 T temp = *ptr;
62 *ptr = T(); 62 *ptr = T();
63 return temp; 63 return temp;
64 } 64 }
65 65
66 template <typename H> struct IsHandle { 66 template <typename H> struct IsHandle {
67 static const bool value = IsBaseOf<Handle, H>::value; 67 enum { value = IsBaseOf<Handle, H>::value };
68 }; 68 };
69 69
70 template <typename T, bool move_only = IsMoveOnlyType<T>::value> 70 template <typename T, bool move_only = IsMoveOnlyType<T>::value>
71 struct WrapperTraits; 71 struct WrapperTraits;
72 72
73 template <typename T> struct WrapperTraits<T, false> { 73 template <typename T> struct WrapperTraits<T, false> {
74 typedef T DataType; 74 typedef T DataType;
75 }; 75 };
76 template <typename H> struct WrapperTraits<ScopedHandleBase<H>, true> { 76 template <typename H> struct WrapperTraits<ScopedHandleBase<H>, true> {
77 typedef H DataType; 77 typedef H DataType;
78 }; 78 };
79 template <typename S> struct WrapperTraits<S, true> { 79 template <typename S> struct WrapperTraits<S, true> {
80 typedef typename S::Data_* DataType; 80 typedef typename S::Data_* DataType;
81 }; 81 };
82 82
83 } // namespace internal 83 } // namespace internal
84 } // namespace mojo 84 } // namespace mojo
85 85
86 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ 86 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
OLDNEW
« no previous file with comments | « base/bind_helpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698