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

Unified Diff: mojo/system/message_in_transit.h

Issue 226203003: Mojo: Add the ability to attach PlatformHandles to MessageInTransits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/system/message_in_transit.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/message_in_transit.h
diff --git a/mojo/system/message_in_transit.h b/mojo/system/message_in_transit.h
index 966f84b0f9adde0ec04859f992a202d3cc7b5971..a4974cd3a13d43c3cbc28840a121a49034dd317a 100644
--- a/mojo/system/message_in_transit.h
+++ b/mojo/system/message_in_transit.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "mojo/embedder/platform_handle.h"
#include "mojo/system/dispatcher.h"
#include "mojo/system/system_impl_export.h"
@@ -211,7 +212,19 @@ class MOJO_SYSTEM_IMPL_EXPORT MessageInTransit {
// Returns true if this message has dispatchers attached.
bool has_dispatchers() const {
- return dispatchers_.get() && !dispatchers_->empty();
+ return dispatchers_ && !dispatchers_->empty();
+ }
+
+ // Gets the platform-specific handles attached to this message; this may
+ // return null if there are none. Note that the caller may mutate the set of
+ // platform-specific handles.
+ std::vector<embedder::PlatformHandle>* platform_handles() {
+ return platform_handles_.get();
+ }
+
+ // Returns true if this message has platform-specific handles attached.
+ bool has_platform_handles() const {
+ return platform_handles_ && !platform_handles_->empty();
}
// Rounds |n| up to a multiple of |kMessageAlignment|.
@@ -278,6 +291,12 @@ class MOJO_SYSTEM_IMPL_EXPORT MessageInTransit {
// some reason.)
scoped_ptr<std::vector<scoped_refptr<Dispatcher> > > dispatchers_;
+ // Any platform-specific handles attached to this message (for inter-process
+ // transport). The vector (if any) owns the handles that it contains (and is
+ // responsible for closing them).
+ // TODO(vtl): With C++11, change it to a vector of |ScopedPlatformHandles|.
+ scoped_ptr<std::vector<embedder::PlatformHandle> > platform_handles_;
+
DISALLOW_COPY_AND_ASSIGN(MessageInTransit);
};
« no previous file with comments | « no previous file | mojo/system/message_in_transit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698