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

Unified Diff: mojo/edk/system/core_test_base.cc

Issue 1880823005: [mojo-edk] Add explicit message object APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/edk/system/core.cc ('k') | mojo/edk/system/core_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core_test_base.cc
diff --git a/mojo/edk/system/core_test_base.cc b/mojo/edk/system/core_test_base.cc
index 635501aa2c7638dce467e819d80b4f9b2e129a1f..e98a55d2ad154b512cb6799e4cec32af70b4a70c 100644
--- a/mojo/edk/system/core_test_base.cc
+++ b/mojo/edk/system/core_test_base.cc
@@ -16,6 +16,7 @@
#include "mojo/edk/system/configuration.h"
#include "mojo/edk/system/core.h"
#include "mojo/edk/system/dispatcher.h"
+#include "mojo/edk/system/message_for_transit.h"
namespace mojo {
namespace edk {
@@ -41,27 +42,25 @@ class MockDispatcher : public Dispatcher {
}
MojoResult WriteMessage(
- const void* bytes,
- uint32_t num_bytes,
- const DispatcherInTransit* dispatchers,
- uint32_t num_dispatchers,
+ std::unique_ptr<MessageForTransit> message,
MojoWriteMessageFlags /*flags*/) override {
info_->IncrementWriteMessageCallCount();
- if (num_bytes > GetConfiguration().max_message_num_bytes)
+ if (message->num_bytes() > GetConfiguration().max_message_num_bytes)
return MOJO_RESULT_RESOURCE_EXHAUSTED;
- if (dispatchers)
+ if (message->num_handles())
return MOJO_RESULT_UNIMPLEMENTED;
return MOJO_RESULT_OK;
}
- MojoResult ReadMessage(void* bytes,
+ MojoResult ReadMessage(std::unique_ptr<MessageForTransit>* message,
uint32_t* num_bytes,
MojoHandle* handle,
uint32_t* num_handles,
- MojoReadMessageFlags /*flags*/) override {
+ MojoReadMessageFlags /*flags*/,
+ bool ignore_num_bytes) override {
info_->IncrementReadMessageCallCount();
if (num_handles)
« no previous file with comments | « mojo/edk/system/core.cc ('k') | mojo/edk/system/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698