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

Unified Diff: mojo/edk/system/channel.h

Issue 1985523002: [mojo-edk] Better validation of untrusted message data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | mojo/edk/system/channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/channel.h
diff --git a/mojo/edk/system/channel.h b/mojo/edk/system/channel.h
index 80d53fc11e47603e42a3fcbaf21ee43878f89212..ab93431a4439dff624a842242010a593e792d812 100644
--- a/mojo/edk/system/channel.h
+++ b/mojo/edk/system/channel.h
@@ -247,17 +247,25 @@ class Channel : public base::RefCountedThreadSafe<Channel> {
// |extra_header| and |extra_header_size| correspond to the extra header data.
// Depending on the Channel implementation, this body may encode platform
// handles, or handles may be stored and managed elsewhere by the
- // implementation. If |num_handles| handles cannot be returned, this must
- // return null.
- virtual ScopedPlatformHandleVectorPtr GetReadPlatformHandles(
+ // implementation.
+ //
+ // Returns |false| on unrecoverable error (i.e. the Channel should be closed).
+ // Returns |true| otherwise. Note that it is possible on some platforms for an
+ // insufficient number of handles to be available when this call is made, but
+ // this is not necessarily an error condition. In such cases this returns
+ // |true| but |*handles| will also be reset to null.
+ virtual bool GetReadPlatformHandles(
size_t num_handles,
const void* extra_header,
- size_t extra_header_size) = 0;
+ size_t extra_header_size,
+ ScopedPlatformHandleVectorPtr* handles) = 0;
- virtual void OnControlMessage(Message::Header::MessageType message_type,
+ // Handles a received control message. Returns |true| if the message is
+ // accepted, or |false| otherwise.
+ virtual bool OnControlMessage(Message::Header::MessageType message_type,
const void* payload,
size_t payload_size,
- ScopedPlatformHandleVectorPtr handles) {}
+ ScopedPlatformHandleVectorPtr handles);
private:
friend class base::RefCountedThreadSafe<Channel>;
« no previous file with comments | « no previous file | mojo/edk/system/channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698