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

Side by Side Diff: mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h

Issue 2403533003: Mojo C++ Bindings: Support custom impl ref types (Closed)
Patch Set: nit, move Created 4 years, 2 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_RAW_PTR_IMPL_REF_TRAITS_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_RAW_PTR_IMPL_REF_TRAITS_H_
7
8 namespace mojo {
9
10 // Default traits for a binding's implementation reference type. This
11 // corresponds to a raw pointer.
12 template <typename Interface>
13 struct RawPtrImplRefTraits {
14 using PointerType = Interface*;
15
16 static bool IsNull(PointerType ptr) { return !ptr; }
17 static Interface* GetRawPointer(PointerType* ptr) { return *ptr; }
18 };
19
20 } // namespace mojo
21
22 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_RAW_PTR_IMPL_REF_TRAITS_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/binding_state.h ('k') | mojo/public/cpp/bindings/tests/binding_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698