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

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

Issue 1675603002: [mojo-edk] Simplify multiprocess pipe bootstrap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix some callers to work with sync APIs 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,
37 }; 38 };
38 39
39 struct EventHeader { 40 struct EventHeader {
40 EventType type; 41 EventType type;
41 uint32_t padding; 42 uint32_t padding;
42 PortName port_name; 43 PortName port_name;
43 }; 44 };
44 45
45 struct UserEventData { 46 struct UserEventData {
46 uint64_t sequence_num; 47 uint64_t sequence_num;
47 uint32_t num_ports; 48 uint32_t num_ports;
48 uint32_t padding; 49 uint32_t padding;
49 }; 50 };
50 51
51 struct ObserveProxyEventData { 52 struct ObserveProxyEventData {
52 NodeName proxy_node_name; 53 NodeName proxy_node_name;
53 PortName proxy_port_name; 54 PortName proxy_port_name;
54 NodeName proxy_to_node_name; 55 NodeName proxy_to_node_name;
55 PortName proxy_to_port_name; 56 PortName proxy_to_port_name;
56 }; 57 };
57 58
58 struct ObserveProxyAckEventData { 59 struct ObserveProxyAckEventData {
59 uint64_t last_sequence_num; 60 uint64_t last_sequence_num;
60 }; 61 };
61 62
62 struct ObserveClosureEventData { 63 struct ObserveClosureEventData {
63 uint64_t last_sequence_num; 64 uint64_t last_sequence_num;
64 }; 65 };
65 66
67 struct MergePortEventData {
68 PortName new_port_name;
69 PortDescriptor new_port_descriptor;
70 };
71
66 inline const EventHeader* GetEventHeader(const Message& message) { 72 inline const EventHeader* GetEventHeader(const Message& message) {
67 return static_cast<const EventHeader*>(message.header_bytes()); 73 return static_cast<const EventHeader*>(message.header_bytes());
68 } 74 }
69 75
70 inline EventHeader* GetMutableEventHeader(Message* message) { 76 inline EventHeader* GetMutableEventHeader(Message* message) {
71 return static_cast<EventHeader*>(message->mutable_header_bytes()); 77 return static_cast<EventHeader*>(message->mutable_header_bytes());
72 } 78 }
73 79
74 template <typename EventData> 80 template <typename EventData>
75 inline const EventData* GetEventData(const Message& message) { 81 inline const EventData* GetEventData(const Message& message) {
(...skipping 14 matching lines...) Expand all
90 96
91 inline PortDescriptor* GetMutablePortDescriptors(UserEventData* event) { 97 inline PortDescriptor* GetMutablePortDescriptors(UserEventData* event) {
92 return reinterpret_cast<PortDescriptor*>(reinterpret_cast<char*>(event + 1)); 98 return reinterpret_cast<PortDescriptor*>(reinterpret_cast<char*>(event + 1));
93 } 99 }
94 100
95 } // namespace ports 101 } // namespace ports
96 } // namespace edk 102 } // namespace edk
97 } // namespace mojo 103 } // namespace mojo
98 104
99 #endif // MOJO_EDK_SYSTEM_PORTS_EVENT_H_ 105 #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