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

Unified Diff: mojo/system/dispatcher.cc

Issue 66963005: Mojo: Implement local passing of MessagePipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 1 month 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/dispatcher.h ('k') | mojo/system/dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/dispatcher.cc
diff --git a/mojo/system/dispatcher.cc b/mojo/system/dispatcher.cc
index a2c51265c2b66ec696eba6b1a08b4ccce65d8856..ccb75095452e472d7d9c39b384ab1718cdd37e0b 100644
--- a/mojo/system/dispatcher.cc
+++ b/mojo/system/dispatcher.cc
@@ -35,17 +35,18 @@ MojoResult Dispatcher::WriteMessage(const void* bytes, uint32_t num_bytes,
MojoResult Dispatcher::ReadMessage(
void* bytes, uint32_t* num_bytes,
- uint32_t max_num_dispatchers,
std::vector<scoped_refptr<Dispatcher> >* dispatchers,
+ uint32_t* num_dispatchers,
MojoReadMessageFlags flags) {
- DCHECK(max_num_dispatchers == 0 || (dispatchers && dispatchers->empty()));
+ DCHECK(!num_dispatchers || *num_dispatchers == 0 ||
+ (dispatchers && dispatchers->empty()));
base::AutoLock locker(lock_);
if (is_closed_)
return MOJO_RESULT_INVALID_ARGUMENT;
return ReadMessageImplNoLock(bytes, num_bytes,
- max_num_dispatchers, dispatchers,
+ dispatchers, num_dispatchers,
flags);
}
@@ -68,6 +69,16 @@ void Dispatcher::RemoveWaiter(Waiter* waiter) {
RemoveWaiterImplNoLock(waiter);
}
+scoped_refptr<Dispatcher>
+Dispatcher::CreateEquivalentDispatcherAndCloseNoLock() {
+ lock_.AssertAcquired();
+ DCHECK(!is_closed_);
+
+ is_closed_ = true;
+ CancelAllWaitersNoLock();
+ return CreateEquivalentDispatcherAndCloseImplNoLock();
+}
+
Dispatcher::Dispatcher()
: is_closed_(false) {
}
@@ -104,10 +115,10 @@ MojoResult Dispatcher::WriteMessageImplNoLock(
}
MojoResult Dispatcher::ReadMessageImplNoLock(
- void* bytes, uint32_t* num_bytes,
- uint32_t max_num_dispatchers,
- std::vector<scoped_refptr<Dispatcher> >* dispatchers,
- MojoReadMessageFlags flags) {
+ void* /*bytes*/, uint32_t* /*num_bytes*/,
+ std::vector<scoped_refptr<Dispatcher> >* /*dispatchers*/,
+ uint32_t* /*num_dispatchers*/,
+ MojoReadMessageFlags /*flags*/) {
lock_.AssertAcquired();
DCHECK(!is_closed_);
// By default, this isn't supported. Only dispatchers for message pipes (with
« no previous file with comments | « mojo/system/dispatcher.h ('k') | mojo/system/dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698