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

Unified Diff: mojo/system/core_test_base.cc

Issue 67413003: Mojo: Implement plumbing to support passing handles over MessagePipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased & review comments 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/core_impl_unittest.cc ('k') | mojo/system/dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/core_test_base.cc
diff --git a/mojo/system/core_test_base.cc b/mojo/system/core_test_base.cc
index 93b11dea4fcdaa518f25320d2e707cccdc05643f..15b9f02849b35e1eaece6f34e2f1e52118edbc1c 100644
--- a/mojo/system/core_test_base.cc
+++ b/mojo/system/core_test_base.cc
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "mojo/system/core_impl.h"
#include "mojo/system/dispatcher.h"
+#include "mojo/system/limits.h"
#include "mojo/system/memory.h"
namespace mojo {
@@ -45,34 +46,32 @@ class MockDispatcher : public Dispatcher {
virtual MojoResult WriteMessageImplNoLock(
const void* bytes,
uint32_t num_bytes,
- const MojoHandle* handles,
- uint32_t num_handles,
+ const std::vector<Dispatcher*>* dispatchers,
MojoWriteMessageFlags /*flags*/) OVERRIDE {
info_->IncrementWriteMessageCallCount();
lock().AssertAcquired();
if (!VerifyUserPointer<void>(bytes, num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
- if (!VerifyUserPointer<MojoHandle>(handles, num_handles))
- return MOJO_RESULT_INVALID_ARGUMENT;
+ if (num_bytes > kMaxMessageNumBytes)
+ return MOJO_RESULT_RESOURCE_EXHAUSTED;
+
+ if (dispatchers)
+ return MOJO_RESULT_UNIMPLEMENTED;
return MOJO_RESULT_OK;
}
virtual MojoResult ReadMessageImplNoLock(
- void* bytes,
- uint32_t* num_bytes,
- MojoHandle* handles,
- uint32_t* num_handles,
+ void* bytes, uint32_t* num_bytes,
+ uint32_t /*max_num_dispatchers*/,
+ std::vector<scoped_refptr<Dispatcher> >* /*dispatchers*/,
MojoReadMessageFlags /*flags*/) OVERRIDE {
info_->IncrementReadMessageCallCount();
lock().AssertAcquired();
if (num_bytes && !VerifyUserPointer<void>(bytes, *num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
- if (num_handles &&
- !VerifyUserPointer<MojoHandle>(handles, *num_handles))
- return MOJO_RESULT_INVALID_ARGUMENT;
return MOJO_RESULT_OK;
}
« no previous file with comments | « mojo/system/core_impl_unittest.cc ('k') | mojo/system/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698