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

Unified Diff: mojo/system/message_in_transit.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/system/message_in_transit.h ('k') | mojo/system/raw_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/message_in_transit.cc
diff --git a/mojo/system/message_in_transit.cc b/mojo/system/message_in_transit.cc
index 3235a758a4896d6552747d6f3e6ab633be2b4d9d..f7afa3b032593f729f2a8c35aa90ed5f4eed85fd 100644
--- a/mojo/system/message_in_transit.cc
+++ b/mojo/system/message_in_transit.cc
@@ -58,7 +58,8 @@ MessageInTransit::View::View(size_t message_size, const void* buffer)
DCHECK_EQ(message_size, total_size());
}
-bool MessageInTransit::View::IsValid(const char** error_message) const {
+bool MessageInTransit::View::IsValid(size_t serialized_platform_handle_size,
+ const char** error_message) const {
// Note: This also implies a check on the |main_buffer_size()|, which is just
// |RoundUpMessageAlignment(sizeof(Header) + num_bytes())|.
if (num_bytes() > kMaxMessageNumBytes) {
@@ -67,8 +68,10 @@ bool MessageInTransit::View::IsValid(const char** error_message) const {
}
if (transport_data_buffer_size() > 0) {
- const char* e = TransportData::ValidateBuffer(transport_data_buffer(),
- transport_data_buffer_size());
+ const char* e =
+ TransportData::ValidateBuffer(serialized_platform_handle_size,
+ transport_data_buffer(),
+ transport_data_buffer_size());
if (e) {
*error_message = e;
return false;
« no previous file with comments | « mojo/system/message_in_transit.h ('k') | mojo/system/raw_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698