Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: mojo/edk/system/ports/event.h

Issue 1678333003: Revert of [mojo-edk] Simplify multiprocess pipe bootstrap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/edk/system/node_controller.cc ('k') | mojo/edk/system/ports/message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PORTS_EVENT_H_ 5 #ifndef MOJO_EDK_SYSTEM_PORTS_EVENT_H_
6 #define MOJO_EDK_SYSTEM_PORTS_EVENT_H_ 6 #define MOJO_EDK_SYSTEM_PORTS_EVENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "mojo/edk/system/ports/message.h" 10 #include "mojo/edk/system/ports/message.h"
(...skipping 16 matching lines...) Expand all
27 uint64_t last_sequence_num_to_receive; 27 uint64_t last_sequence_num_to_receive;
28 bool peer_closed; 28 bool peer_closed;
29 }; 29 };
30 30
31 enum struct EventType : uint32_t { 31 enum struct EventType : uint32_t {
32 kUser, 32 kUser,
33 kPortAccepted, 33 kPortAccepted,
34 kObserveProxy, 34 kObserveProxy,
35 kObserveProxyAck, 35 kObserveProxyAck,
36 kObserveClosure, 36 kObserveClosure,
37 kMergePort,
38 }; 37 };
39 38
40 struct EventHeader { 39 struct EventHeader {
41 EventType type; 40 EventType type;
42 uint32_t padding; 41 uint32_t padding;
43 PortName port_name; 42 PortName port_name;
44 }; 43 };
45 44
46 struct UserEventData { 45 struct UserEventData {
47 uint64_t sequence_num; 46 uint64_t sequence_num;
48 uint32_t num_ports; 47 uint32_t num_ports;
49 uint32_t padding; 48 uint32_t padding;
50 }; 49 };
51 50
52 struct ObserveProxyEventData { 51 struct ObserveProxyEventData {
53 NodeName proxy_node_name; 52 NodeName proxy_node_name;
54 PortName proxy_port_name; 53 PortName proxy_port_name;
55 NodeName proxy_to_node_name; 54 NodeName proxy_to_node_name;
56 PortName proxy_to_port_name; 55 PortName proxy_to_port_name;
57 }; 56 };
58 57
59 struct ObserveProxyAckEventData { 58 struct ObserveProxyAckEventData {
60 uint64_t last_sequence_num; 59 uint64_t last_sequence_num;
61 }; 60 };
62 61
63 struct ObserveClosureEventData { 62 struct ObserveClosureEventData {
64 uint64_t last_sequence_num; 63 uint64_t last_sequence_num;
65 }; 64 };
66 65
67 struct MergePortEventData {
68 PortName new_port_name;
69 PortDescriptor new_port_descriptor;
70 };
71
72 inline const EventHeader* GetEventHeader(const Message& message) { 66 inline const EventHeader* GetEventHeader(const Message& message) {
73 return static_cast<const EventHeader*>(message.header_bytes()); 67 return static_cast<const EventHeader*>(message.header_bytes());
74 } 68 }
75 69
76 inline EventHeader* GetMutableEventHeader(Message* message) { 70 inline EventHeader* GetMutableEventHeader(Message* message) {
77 return static_cast<EventHeader*>(message->mutable_header_bytes()); 71 return static_cast<EventHeader*>(message->mutable_header_bytes());
78 } 72 }
79 73
80 template <typename EventData> 74 template <typename EventData>
81 inline const EventData* GetEventData(const Message& message) { 75 inline const EventData* GetEventData(const Message& message) {
(...skipping 14 matching lines...) Expand all
96 90
97 inline PortDescriptor* GetMutablePortDescriptors(UserEventData* event) { 91 inline PortDescriptor* GetMutablePortDescriptors(UserEventData* event) {
98 return reinterpret_cast<PortDescriptor*>(reinterpret_cast<char*>(event + 1)); 92 return reinterpret_cast<PortDescriptor*>(reinterpret_cast<char*>(event + 1));
99 } 93 }
100 94
101 } // namespace ports 95 } // namespace ports
102 } // namespace edk 96 } // namespace edk
103 } // namespace mojo 97 } // namespace mojo
104 98
105 #endif // MOJO_EDK_SYSTEM_PORTS_EVENT_H_ 99 #endif // MOJO_EDK_SYSTEM_PORTS_EVENT_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/node_controller.cc ('k') | mojo/edk/system/ports/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698