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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // |*platform_support| must outlive this object. | 46 // |*platform_support| must outlive this object. |
47 explicit Core(embedder::PlatformSupport* platform_support); | 47 explicit Core(embedder::PlatformSupport* platform_support); |
48 virtual ~Core(); | 48 virtual ~Core(); |
49 | 49 |
50 // Adds |handle| (which must have a dispatcher) to the handle table, returning | 50 // Adds |handle| (which must have a dispatcher) to the handle table, returning |
51 // the handle value for it. Returns |MOJO_HANDLE_INVALID| on failure, namely | 51 // the handle value for it. Returns |MOJO_HANDLE_INVALID| on failure, namely |
52 // if the handle table is full. | 52 // if the handle table is full. |
53 MojoHandle AddHandle(Handle&& handle); | 53 MojoHandle AddHandle(Handle&& handle); |
54 | 54 |
55 // DEPRECATED. TODO(vtl): Remove this. | |
56 // Adds |dispatcher| to the handle table, returning the handle value for it. | |
57 // Returns |MOJO_HANDLE_INVALID| on failure, namely if the handle table is | |
58 // full. | |
59 MojoHandle AddDispatcher(Dispatcher* dispatcher); | |
60 | |
61 // Looks up the dispatcher for the given handle. On success, gets the | 55 // Looks up the dispatcher for the given handle. On success, gets the |
62 // dispatcher for a given handle. On failure, returns an appropriate result | 56 // dispatcher for a given handle. On failure, returns an appropriate result |
63 // and leaves |dispatcher| alone), namely |MOJO_RESULT_INVALID_ARGUMENT| if | 57 // and leaves |dispatcher| alone), namely |MOJO_RESULT_INVALID_ARGUMENT| if |
64 // the handle is invalid or |MOJO_RESULT_BUSY| if the handle is marked as | 58 // the handle is invalid or |MOJO_RESULT_BUSY| if the handle is marked as |
65 // busy. | 59 // busy. |
66 MojoResult GetDispatcher(MojoHandle handle, | 60 MojoResult GetDispatcher(MojoHandle handle, |
67 util::RefPtr<Dispatcher>* dispatcher); | 61 util::RefPtr<Dispatcher>* dispatcher); |
68 | 62 |
69 // Like |GetDispatcher()|, but on success also removes the handle from the | 63 // Like |GetDispatcher()|, but on success also removes the handle from the |
70 // handle table. | 64 // handle table. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 util::Mutex mapping_table_mutex_; | 211 util::Mutex mapping_table_mutex_; |
218 MappingTable mapping_table_ MOJO_GUARDED_BY(mapping_table_mutex_); | 212 MappingTable mapping_table_ MOJO_GUARDED_BY(mapping_table_mutex_); |
219 | 213 |
220 MOJO_DISALLOW_COPY_AND_ASSIGN(Core); | 214 MOJO_DISALLOW_COPY_AND_ASSIGN(Core); |
221 }; | 215 }; |
222 | 216 |
223 } // namespace system | 217 } // namespace system |
224 } // namespace mojo | 218 } // namespace mojo |
225 | 219 |
226 #endif // MOJO_EDK_SYSTEM_CORE_H_ | 220 #endif // MOJO_EDK_SYSTEM_CORE_H_ |
OLD | NEW |