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

Side by Side Diff: mojo/system/message_in_transit.h

Issue 277083003: Mojo: (Theoretically) implement the read side of platform handle passing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asdf Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « mojo/system/channel_unittest.cc ('k') | mojo/system/message_in_transit.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_SYSTEM_MESSAGE_IN_TRANSIT_H_ 5 #ifndef MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_
6 #define MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ 6 #define MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 View(size_t message_size, const void* buffer); 81 View(size_t message_size, const void* buffer);
82 82
83 // Checks that the given |View| appears to be for a valid message, within 83 // Checks that the given |View| appears to be for a valid message, within
84 // predetermined limits (e.g., |num_bytes()| and |main_buffer_size()|, that 84 // predetermined limits (e.g., |num_bytes()| and |main_buffer_size()|, that
85 // |transport_data_buffer()|/|transport_data_buffer_size()| is for valid 85 // |transport_data_buffer()|/|transport_data_buffer_size()| is for valid
86 // transport data -- see |TransportData::ValidateBuffer()|). 86 // transport data -- see |TransportData::ValidateBuffer()|).
87 // 87 //
88 // It returns true (and leaves |error_message| alone) if this object appears 88 // It returns true (and leaves |error_message| alone) if this object appears
89 // to be a valid message (according to the above) and false, pointing 89 // to be a valid message (according to the above) and false, pointing
90 // |*error_message| to a suitable error message, if not. 90 // |*error_message| to a suitable error message, if not.
91 bool IsValid(const char** error_message) const; 91 bool IsValid(size_t serialized_platform_handle_size,
92 const char** error_message) const;
92 93
93 // API parallel to that for |MessageInTransit| itself (mostly getters for 94 // API parallel to that for |MessageInTransit| itself (mostly getters for
94 // header data). 95 // header data).
95 const void* main_buffer() const { return buffer_; } 96 const void* main_buffer() const { return buffer_; }
96 size_t main_buffer_size() const { 97 size_t main_buffer_size() const {
97 return RoundUpMessageAlignment(sizeof(Header) + header()->num_bytes); 98 return RoundUpMessageAlignment(sizeof(Header) + header()->num_bytes);
98 } 99 }
99 const void* transport_data_buffer() const { 100 const void* transport_data_buffer() const {
100 return (total_size() > main_buffer_size()) ? 101 return (total_size() > main_buffer_size()) ?
101 static_cast<const char*>(buffer_) + main_buffer_size() : NULL; 102 static_cast<const char*>(buffer_) + main_buffer_size() : NULL;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // some reason.) 241 // some reason.)
241 scoped_ptr<DispatcherVector> dispatchers_; 242 scoped_ptr<DispatcherVector> dispatchers_;
242 243
243 DISALLOW_COPY_AND_ASSIGN(MessageInTransit); 244 DISALLOW_COPY_AND_ASSIGN(MessageInTransit);
244 }; 245 };
245 246
246 } // namespace system 247 } // namespace system
247 } // namespace mojo 248 } // namespace mojo
248 249
249 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_ 250 #endif // MOJO_SYSTEM_MESSAGE_IN_TRANSIT_H_
OLDNEW
« no previous file with comments | « mojo/system/channel_unittest.cc ('k') | mojo/system/message_in_transit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698