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

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

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/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;
43 default: 40 default:
44 CHECK(false) << "Bad event type"; 41 CHECK(false) << "Bad event type";
45 return; 42 return;
46 } 43 }
47 44
48 if (header->type == EventType::kUser) { 45 if (header->type == EventType::kUser) {
49 const UserEventData* event_data = 46 const UserEventData* event_data =
50 reinterpret_cast<const UserEventData*>( 47 reinterpret_cast<const UserEventData*>(
51 reinterpret_cast<const char*>(header + 1)); 48 reinterpret_cast<const char*>(header + 1));
52 *num_header_bytes = sizeof(EventHeader) + 49 *num_header_bytes = sizeof(EventHeader) +
(...skipping 28 matching lines...) Expand all
81 start_ = static_cast<char*>(start); 78 start_ = static_cast<char*>(start);
82 memset(start_, 0, num_header_bytes_); 79 memset(start_, 0, num_header_bytes_);
83 GetMutableEventHeader(this)->type = EventType::kUser; 80 GetMutableEventHeader(this)->type = EventType::kUser;
84 GetMutableEventData<UserEventData>(this)->num_ports = 81 GetMutableEventData<UserEventData>(this)->num_ports =
85 static_cast<uint32_t>(num_ports_); 82 static_cast<uint32_t>(num_ports_);
86 } 83 }
87 84
88 } // namespace ports 85 } // namespace ports
89 } // namespace edk 86 } // namespace edk
90 } // namespace mojo 87 } // 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