OLD | NEW |
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_EDK_SYSTEM_CORE_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CORE_H_ |
6 #define MOJO_EDK_SYSTEM_CORE_H_ | 6 #define MOJO_EDK_SYSTEM_CORE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <functional> | 10 #include <functional> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // the handle value for it. Returns |MOJO_HANDLE_INVALID| on failure, namely | 55 // the handle value for it. Returns |MOJO_HANDLE_INVALID| on failure, namely |
56 // if the handle table is full. | 56 // if the handle table is full. |
57 MojoHandle AddHandle(Handle&& h); | 57 MojoHandle AddHandle(Handle&& h); |
58 | 58 |
59 // Gets the handle for the given handle value. On success, returns | 59 // Gets the handle for the given handle value. On success, returns |
60 // |MOJO_RESULT_OK| (and sets |*h|). On failure, returns an appropriate result | 60 // |MOJO_RESULT_OK| (and sets |*h|). On failure, returns an appropriate result |
61 // (and leaves |*h| alone), namely |MOJO_RESULT_INVALID_ARGUMENT| if the | 61 // (and leaves |*h| alone), namely |MOJO_RESULT_INVALID_ARGUMENT| if the |
62 // handle value is invalid or |MOJO_RESULT_BUSY| if the handle is marked as | 62 // handle value is invalid or |MOJO_RESULT_BUSY| if the handle is marked as |
63 // busy. | 63 // busy. |
64 MojoResult GetHandle(MojoHandle handle, Handle* h); | 64 MojoResult GetHandle(MojoHandle handle, Handle* h); |
65 // TODO(vtl): Remove this. | |
66 MojoResult GetDispatcher(MojoHandle handle, | |
67 util::RefPtr<Dispatcher>* dispatcher); | |
68 | 65 |
69 // TODO(vtl): Convert this to |GetAndRemoveHandle()|. | 66 // TODO(vtl): Convert this to |GetAndRemoveHandle()|. |
70 // Like |GetDispatcher()|, but on success also removes the handle from the | 67 // Like |GetDispatcher()|, but on success also removes the handle from the |
71 // handle table. | 68 // handle table. |
72 MojoResult GetAndRemoveDispatcher(MojoHandle handle, | 69 MojoResult GetAndRemoveDispatcher(MojoHandle handle, |
73 util::RefPtr<Dispatcher>* dispatcher); | 70 util::RefPtr<Dispatcher>* dispatcher); |
74 | 71 |
75 // Gets the dispatcher for the given handle value, which must have (all of) | 72 // Gets the dispatcher for the given handle value, which must have (all of) |
76 // the rights in |required_handle_rights|. | 73 // the rights in |required_handle_rights|. |
77 // | 74 // |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 util::Mutex mapping_table_mutex_; | 236 util::Mutex mapping_table_mutex_; |
240 MappingTable mapping_table_ MOJO_GUARDED_BY(mapping_table_mutex_); | 237 MappingTable mapping_table_ MOJO_GUARDED_BY(mapping_table_mutex_); |
241 | 238 |
242 MOJO_DISALLOW_COPY_AND_ASSIGN(Core); | 239 MOJO_DISALLOW_COPY_AND_ASSIGN(Core); |
243 }; | 240 }; |
244 | 241 |
245 } // namespace system | 242 } // namespace system |
246 } // namespace mojo | 243 } // namespace mojo |
247 | 244 |
248 #endif // MOJO_EDK_SYSTEM_CORE_H_ | 245 #endif // MOJO_EDK_SYSTEM_CORE_H_ |
OLD | NEW |