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

Side by Side Diff: mojo/edk/system/broker_messages.h

Issue 2710193003: Adding a new message type to the Mojo channel. (Closed)
Patch Set: Fixed Mac tests + sync Created 3 years, 9 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/BUILD.gn ('k') | mojo/edk/system/channel.h » ('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_BROKER_MESSAGES_H_ 5 #ifndef MOJO_EDK_SYSTEM_BROKER_MESSAGES_H_
6 #define MOJO_EDK_SYSTEM_BROKER_MESSAGES_H_ 6 #define MOJO_EDK_SYSTEM_BROKER_MESSAGES_H_
7 7
8 #include "mojo/edk/system/channel.h" 8 #include "mojo/edk/system/channel.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 namespace edk { 11 namespace edk {
12 12
13 #pragma pack(push, 1) 13 #pragma pack(push, 1)
14 14
15 enum BrokerMessageType : uint32_t { 15 enum BrokerMessageType : uint32_t {
16 INIT, 16 INIT,
17 BUFFER_REQUEST, 17 BUFFER_REQUEST,
18 BUFFER_RESPONSE, 18 BUFFER_RESPONSE,
19 }; 19 };
20 20
21 struct BrokerMessageHeader { 21 struct BrokerMessageHeader {
22 BrokerMessageType type; 22 BrokerMessageType type;
23 uint32_t padding; 23 uint32_t padding;
24 }; 24 };
25 25
26 static_assert(sizeof(BrokerMessageHeader) % kChannelMessageAlignment == 0, 26 static_assert(IsAlignedForChannelMessage(sizeof(BrokerMessageHeader)),
27 "Invalid header size."); 27 "Invalid header size.");
28 28
29 struct BufferRequestData { 29 struct BufferRequestData {
30 uint32_t size; 30 uint32_t size;
31 }; 31 };
32 32
33 #if defined(OS_WIN) 33 #if defined(OS_WIN)
34 struct InitData { 34 struct InitData {
35 // NOTE: InitData in the payload is followed by string16 data with exactly 35 // NOTE: InitData in the payload is followed by string16 data with exactly
36 // |pipe_name_length| wide characters (i.e., |pipe_name_length|*2 bytes.) 36 // |pipe_name_length| wide characters (i.e., |pipe_name_length|*2 bytes.)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 reinterpret_cast<BrokerMessageHeader*>(message->mutable_payload()); 71 reinterpret_cast<BrokerMessageHeader*>(message->mutable_payload());
72 header->type = type; 72 header->type = type;
73 header->padding = 0; 73 header->padding = 0;
74 return message; 74 return message;
75 } 75 }
76 76
77 } // namespace edk 77 } // namespace edk
78 } // namespace mojo 78 } // namespace mojo
79 79
80 #endif // MOJO_EDK_SYSTEM_BROKER_MESSAGES_H_ 80 #endif // MOJO_EDK_SYSTEM_BROKER_MESSAGES_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/BUILD.gn ('k') | mojo/edk/system/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698