| 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_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ | 5 #ifndef MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
| 6 #define MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ | 6 #define MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "mojo/edk/system/memory.h" | 10 #include "mojo/edk/system/memory.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class PlatformSharedBufferMapping; | 25 class PlatformSharedBufferMapping; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace system { | 28 namespace system { |
| 29 | 29 |
| 30 // TODO(vtl): We derive from SimpleDispatcher, even though we don't currently | 30 // TODO(vtl): We derive from SimpleDispatcher, even though we don't currently |
| 31 // have anything that's waitable. I want to add a "transferrable" wait flag | 31 // have anything that's waitable. I want to add a "transferrable" wait flag |
| 32 // (which would entail overriding |GetHandleSignalsStateImplNoLock()|, etc.). | 32 // (which would entail overriding |GetHandleSignalsStateImplNoLock()|, etc.). |
| 33 class SharedBufferDispatcher final : public SimpleDispatcher { | 33 class SharedBufferDispatcher final : public SimpleDispatcher { |
| 34 public: | 34 public: |
| 35 // The default/standard rights for a shared buffer handle. Note that they're | 35 // The default/standard rights for a shared buffer handle. Note that shared |
| 36 // duplicatable by default. | 36 // buffer handles are duplicatable by default. |
| 37 static constexpr MojoHandleRights kDefaultHandleRights = | 37 static constexpr MojoHandleRights kDefaultHandleRights = |
| 38 MOJO_HANDLE_RIGHT_DUPLICATE | MOJO_HANDLE_RIGHT_TRANSFER | | 38 MOJO_HANDLE_RIGHT_DUPLICATE | MOJO_HANDLE_RIGHT_TRANSFER | |
| 39 MOJO_HANDLE_RIGHT_GET_OPTIONS | MOJO_HANDLE_RIGHT_SET_OPTIONS | | 39 MOJO_HANDLE_RIGHT_GET_OPTIONS | MOJO_HANDLE_RIGHT_SET_OPTIONS | |
| 40 MOJO_HANDLE_RIGHT_MAP_READABLE | MOJO_HANDLE_RIGHT_MAP_WRITABLE | | 40 MOJO_HANDLE_RIGHT_MAP_READABLE | MOJO_HANDLE_RIGHT_MAP_WRITABLE | |
| 41 MOJO_HANDLE_RIGHT_MAP_EXECUTABLE; | 41 MOJO_HANDLE_RIGHT_MAP_EXECUTABLE; |
| 42 | 42 |
| 43 // The default options to use for |MojoCreateSharedBuffer()|. (Real uses | 43 // The default options to use for |MojoCreateSharedBuffer()|. (Real uses |
| 44 // should obtain this via |ValidateCreateOptions()| with a null |in_options|; | 44 // should obtain this via |ValidateCreateOptions()| with a null |in_options|; |
| 45 // this is exposed directly for testing convenience.) | 45 // this is exposed directly for testing convenience.) |
| 46 static const MojoCreateSharedBufferOptions kDefaultCreateOptions; | 46 static const MojoCreateSharedBufferOptions kDefaultCreateOptions; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 util::RefPtr<platform::PlatformSharedBuffer> shared_buffer_ | 125 util::RefPtr<platform::PlatformSharedBuffer> shared_buffer_ |
| 126 MOJO_GUARDED_BY(mutex()); | 126 MOJO_GUARDED_BY(mutex()); |
| 127 | 127 |
| 128 MOJO_DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcher); | 128 MOJO_DISALLOW_COPY_AND_ASSIGN(SharedBufferDispatcher); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 } // namespace system | 131 } // namespace system |
| 132 } // namespace mojo | 132 } // namespace mojo |
| 133 | 133 |
| 134 #endif // MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ | 134 #endif // MOJO_EDK_SYSTEM_SHARED_BUFFER_DISPATCHER_H_ |
| OLD | NEW |