| 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_TRANSPORT_DATA_H_ | 5 #ifndef MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ | 
| 6 #define MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ | 6 #define MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ | 
| 7 | 7 | 
| 8 #include <stdint.h> | 8 #include <stdint.h> | 
| 9 | 9 | 
| 10 #include <memory> | 10 #include <memory> | 
| 11 #include <vector> | 11 #include <vector> | 
| 12 | 12 | 
| 13 #include "mojo/edk/platform/aligned_alloc.h" | 13 #include "mojo/edk/platform/aligned_alloc.h" | 
| 14 #include "mojo/edk/platform/scoped_platform_handle.h" | 14 #include "mojo/edk/platform/scoped_platform_handle.h" | 
| 15 #include "mojo/edk/system/dispatcher.h" | 15 #include "mojo/edk/system/dispatcher.h" | 
| 16 #include "mojo/public/cpp/system/macros.h" | 16 #include "mojo/public/cpp/system/macros.h" | 
| 17 | 17 | 
| 18 namespace mojo { | 18 namespace mojo { | 
| 19 namespace system { | 19 namespace system { | 
| 20 | 20 | 
| 21 class Channel; | 21 class Channel; | 
| 22 | 22 | 
| 23 // This class is used by |MessageInTransit| to represent handles (|Dispatcher|s) | 23 // This class is used by |MessageInTransit| to represent handles (|Dispatcher|s) | 
| 24 // in various stages of serialization. | 24 // in various stages of serialization. | 
| 25 // | 25 // | 
| 26 // The stages are: | 26 // The stages are: | 
| 27 //   - Before reaching |TransportData|: Turn |DispatcherTransport|s into | 27 //   - Before reaching |TransportData|: Turn |HandleTransport|s into | 
| 28 //     |Dispatcher|s that are "owned" by (and attached to) a |MessageInTransit|. | 28 //     |Dispatcher|s that are "owned" by (and attached to) a |MessageInTransit|. | 
| 29 //     This invalidates the handles in the space of the sending application | 29 //     This invalidates the handles in the space of the sending application | 
| 30 //     (and, e.g., if another thread is waiting on such a handle, it'll be | 30 //     (and, e.g., if another thread is waiting on such a handle, it'll be | 
| 31 //     notified of this invalidation). | 31 //     notified of this invalidation). | 
| 32 //   - Serialize these dispatchers into the |TransportData|: First, for each | 32 //   - Serialize these dispatchers into the |TransportData|: First, for each | 
| 33 //     attached dispatcher, there's an entry in the |TransportData|'s "handle | 33 //     attached dispatcher, there's an entry in the |TransportData|'s "handle | 
| 34 //     table", which points to a segment of (dispatcher-type-dependent) data. | 34 //     table", which points to a segment of (dispatcher-type-dependent) data. | 
| 35 //   - During the serialization of the dispatchers, |PlatformHandle|s may be | 35 //   - During the serialization of the dispatchers, |PlatformHandle|s may be | 
| 36 //     detached from the dispatchers and attached to the |TransportData|. | 36 //     detached from the dispatchers and attached to the |TransportData|. | 
| 37 //   - Before sending the |MessageInTransit|, including its main buffer and the | 37 //   - Before sending the |MessageInTransit|, including its main buffer and the | 
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 183   std::unique_ptr<std::vector<platform::ScopedPlatformHandle>> | 183   std::unique_ptr<std::vector<platform::ScopedPlatformHandle>> | 
| 184       platform_handles_; | 184       platform_handles_; | 
| 185 | 185 | 
| 186   MOJO_DISALLOW_COPY_AND_ASSIGN(TransportData); | 186   MOJO_DISALLOW_COPY_AND_ASSIGN(TransportData); | 
| 187 }; | 187 }; | 
| 188 | 188 | 
| 189 }  // namespace system | 189 }  // namespace system | 
| 190 }  // namespace mojo | 190 }  // namespace mojo | 
| 191 | 191 | 
| 192 #endif  // MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ | 192 #endif  // MOJO_EDK_SYSTEM_TRANSPORT_DATA_H_ | 
| OLD | NEW | 
|---|