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

Side by Side Diff: mojo/edk/system/node_channel.cc

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/channel_unittest.cc ('k') | no next file » | 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 #include "mojo/edk/system/node_channel.h" 5 #include "mojo/edk/system/node_channel.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 #include <limits> 8 #include <limits>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 PORTS_MESSAGE_FROM_RELAY, 48 PORTS_MESSAGE_FROM_RELAY,
49 #endif 49 #endif
50 ACCEPT_PEER, 50 ACCEPT_PEER,
51 }; 51 };
52 52
53 struct Header { 53 struct Header {
54 MessageType type; 54 MessageType type;
55 uint32_t padding; 55 uint32_t padding;
56 }; 56 };
57 57
58 static_assert(sizeof(Header) % kChannelMessageAlignment == 0, 58 static_assert(IsAlignedForChannelMessage(sizeof(Header)),
59 "Invalid header size."); 59 "Invalid header size.");
60 60
61 struct AcceptChildData { 61 struct AcceptChildData {
62 ports::NodeName parent_name; 62 ports::NodeName parent_name;
63 ports::NodeName token; 63 ports::NodeName token;
64 }; 64 };
65 65
66 struct AcceptParentData { 66 struct AcceptParentData {
67 ports::NodeName token; 67 ports::NodeName token;
68 ports::NodeName child_name; 68 ports::NodeName child_name;
69 }; 69 };
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 895
896 base::AutoLock lock(channel_lock_); 896 base::AutoLock lock(channel_lock_);
897 if (!channel_) 897 if (!channel_)
898 DLOG(ERROR) << "Dropping message on closed channel."; 898 DLOG(ERROR) << "Dropping message on closed channel.";
899 else 899 else
900 channel_->Write(std::move(message)); 900 channel_->Write(std::move(message));
901 } 901 }
902 902
903 } // namespace edk 903 } // namespace edk
904 } // namespace mojo 904 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/channel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698