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

Unified Diff: mojo/system/transport_data.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/system/raw_channel_win.cc ('k') | mojo/system/transport_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/transport_data.h
diff --git a/mojo/system/transport_data.h b/mojo/system/transport_data.h
index 0f03c810da1df7a46c5e9ed2904d73313116d39e..7f8aa218d9938ba5cc2f6995d0b7da3f23c31829 100644
--- a/mojo/system/transport_data.h
+++ b/mojo/system/transport_data.h
@@ -79,6 +79,12 @@ class MOJO_SYSTEM_IMPL_EXPORT TransportData {
// dispatcher.
static const size_t kMaxSerializedDispatcherPlatformHandles = 2;
+ // The maximum possible size of a valid transport data buffer.
+ static const size_t kMaxBufferSize;
+
+ // The maximum total number of platform handles that may be attached.
+ static const size_t kMaxPlatformHandles;
+
TransportData(scoped_ptr<DispatcherVector> dispatchers, Channel* channel);
~TransportData();
@@ -108,7 +114,15 @@ class MOJO_SYSTEM_IMPL_EXPORT TransportData {
// validity of the handle table entries (i.e., does range checking), but does
// not check that the validity of the actual serialized dispatcher
// information.
- static const char* ValidateBuffer(const void* buffer, size_t buffer_size);
+ static const char* ValidateBuffer(size_t serialized_platform_handle_size,
+ const void* buffer,
+ size_t buffer_size);
+
+ // Gets the platform handle table from a (valid) |TransportData| buffer (which
+ // should have been validated using |ValidateBuffer()| first).
+ static void GetPlatformHandleTable(const void* transport_data_buffer,
+ size_t* num_platform_handles,
+ const void** platform_handle_table);
// Deserializes dispatchers from the given (serialized) transport data buffer
// (typically from a |MessageInTransit::View|). |buffer| should be non-null
@@ -140,12 +154,6 @@ class MOJO_SYSTEM_IMPL_EXPORT TransportData {
uint32_t unused;
};
- // The maximum possible size of a valid transport data buffer.
- static const size_t kMaxBufferSize;
-
- // The maximum total number of platform handles that may be attached.
- static const size_t kMaxPlatformHandles;
-
const Header* header() const {
return reinterpret_cast<const Header*>(buffer_.get());
}
« no previous file with comments | « mojo/system/raw_channel_win.cc ('k') | mojo/system/transport_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698