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

Side by Side Diff: mojo/edk/system/ports/message.cc

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/ports/event.h ('k') | mojo/edk/system/ports/name.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 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/edk/system/ports/event.h" 10 #include "mojo/edk/system/ports/event.h"
(...skipping 19 matching lines...) Expand all
30 case EventType::kObserveProxy: 30 case EventType::kObserveProxy:
31 *num_header_bytes = sizeof(EventHeader) + sizeof(ObserveProxyEventData); 31 *num_header_bytes = sizeof(EventHeader) + sizeof(ObserveProxyEventData);
32 break; 32 break;
33 case EventType::kObserveProxyAck: 33 case EventType::kObserveProxyAck:
34 *num_header_bytes = 34 *num_header_bytes =
35 sizeof(EventHeader) + sizeof(ObserveProxyAckEventData); 35 sizeof(EventHeader) + sizeof(ObserveProxyAckEventData);
36 break; 36 break;
37 case EventType::kObserveClosure: 37 case EventType::kObserveClosure:
38 *num_header_bytes = sizeof(EventHeader) + sizeof(ObserveClosureEventData); 38 *num_header_bytes = sizeof(EventHeader) + sizeof(ObserveClosureEventData);
39 break; 39 break;
40 case EventType::kMergePort:
41 *num_header_bytes = sizeof(EventHeader) + sizeof(MergePortEventData);
42 break;
40 default: 43 default:
41 CHECK(false) << "Bad event type"; 44 CHECK(false) << "Bad event type";
42 return; 45 return;
43 } 46 }
44 47
45 if (header->type == EventType::kUser) { 48 if (header->type == EventType::kUser) {
46 const UserEventData* event_data = 49 const UserEventData* event_data =
47 reinterpret_cast<const UserEventData*>( 50 reinterpret_cast<const UserEventData*>(
48 reinterpret_cast<const char*>(header + 1)); 51 reinterpret_cast<const char*>(header + 1));
49 *num_header_bytes = sizeof(EventHeader) + 52 *num_header_bytes = sizeof(EventHeader) +
(...skipping 28 matching lines...) Expand all
78 start_ = static_cast<char*>(start); 81 start_ = static_cast<char*>(start);
79 memset(start_, 0, num_header_bytes_); 82 memset(start_, 0, num_header_bytes_);
80 GetMutableEventHeader(this)->type = EventType::kUser; 83 GetMutableEventHeader(this)->type = EventType::kUser;
81 GetMutableEventData<UserEventData>(this)->num_ports = 84 GetMutableEventData<UserEventData>(this)->num_ports =
82 static_cast<uint32_t>(num_ports_); 85 static_cast<uint32_t>(num_ports_);
83 } 86 }
84 87
85 } // namespace ports 88 } // namespace ports
86 } // namespace edk 89 } // namespace edk
87 } // namespace mojo 90 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/ports/event.h ('k') | mojo/edk/system/ports/name.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698