OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_INTERFACE_PTR_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_H_ |
7 | 7 |
8 #include <assert.h> | |
9 | |
10 #include <algorithm> | 8 #include <algorithm> |
11 | 9 |
12 #include "mojo/public/cpp/bindings/error_handler.h" | 10 #include "mojo/public/cpp/bindings/error_handler.h" |
13 #include "mojo/public/cpp/bindings/lib/interface_ptr_internal.h" | 11 #include "mojo/public/cpp/bindings/lib/interface_ptr_internal.h" |
14 #include "mojo/public/cpp/environment/environment.h" | 12 #include "mojo/public/cpp/environment/environment.h" |
15 #include "mojo/public/cpp/system/macros.h" | 13 #include "mojo/public/cpp/system/macros.h" |
16 | 14 |
17 namespace mojo { | 15 namespace mojo { |
18 class ErrorHandler; | 16 class ErrorHandler; |
19 | 17 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { | 118 const MojoAsyncWaiter* waiter = Environment::GetDefaultAsyncWaiter()) { |
121 InterfacePtr<Interface> ptr; | 119 InterfacePtr<Interface> ptr; |
122 if (handle.is_valid()) | 120 if (handle.is_valid()) |
123 ptr.Bind(handle.Pass(), waiter); | 121 ptr.Bind(handle.Pass(), waiter); |
124 return ptr.Pass(); | 122 return ptr.Pass(); |
125 } | 123 } |
126 | 124 |
127 } // namespace mojo | 125 } // namespace mojo |
128 | 126 |
129 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_H_ | 127 #endif // MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_H_ |
OLD | NEW |