| Index: mojo/edk/system/core.cc
|
| diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
|
| index ef10e9c29d1465d18985ca84fc9210002cbf51fe..d8d861aee90a390bbe738b2a0b01fc599f6d7ac2 100644
|
| --- a/mojo/edk/system/core.cc
|
| +++ b/mojo/edk/system/core.cc
|
| @@ -30,6 +30,7 @@
|
| #include "mojo/edk/system/message_for_transit.h"
|
| #include "mojo/edk/system/message_pipe_dispatcher.h"
|
| #include "mojo/edk/system/platform_handle_dispatcher.h"
|
| +#include "mojo/edk/system/ports/name.h"
|
| #include "mojo/edk/system/ports/node.h"
|
| #include "mojo/edk/system/remote_message_pipe_bootstrap.h"
|
| #include "mojo/edk/system/request_context.h"
|
| @@ -169,10 +170,12 @@ scoped_refptr<Dispatcher> Core::GetDispatcher(MojoHandle handle) {
|
|
|
| void Core::AddChild(base::ProcessHandle process_handle,
|
| ScopedPlatformHandle platform_handle,
|
| - const std::string& child_token) {
|
| + const std::string& child_token,
|
| + const ProcessErrorCallback& process_error_callback) {
|
| GetNodeController()->ConnectToChild(process_handle,
|
| std::move(platform_handle),
|
| - child_token);
|
| + child_token,
|
| + process_error_callback);
|
| }
|
|
|
| void Core::ChildLaunchFailed(const std::string& child_token) {
|
| @@ -752,6 +755,24 @@ MojoResult Core::FuseMessagePipes(MojoHandle handle0, MojoHandle handle1) {
|
| return MOJO_RESULT_OK;
|
| }
|
|
|
| +MojoResult Core::NotifyBadMessage(MojoMessageHandle message,
|
| + const char* error,
|
| + size_t error_num_bytes) {
|
| + if (!message)
|
| + return MOJO_RESULT_INVALID_ARGUMENT;
|
| +
|
| + const PortsMessage& ports_message =
|
| + reinterpret_cast<MessageForTransit*>(message)->ports_message();
|
| + if (ports_message.source_node() == ports::kInvalidNodeName) {
|
| + DVLOG(1) << "Received invalid message from unknown node.";
|
| + return MOJO_RESULT_OK;
|
| + }
|
| +
|
| + GetNodeController()->NotifyBadMessageFrom(
|
| + ports_message.source_node(), std::string(error, error_num_bytes));
|
| + return MOJO_RESULT_OK;
|
| +}
|
| +
|
| MojoResult Core::CreateDataPipe(
|
| const MojoCreateDataPipeOptions* options,
|
| MojoHandle* data_pipe_producer_handle,
|
|
|