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

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

Issue 2202893002: Mojo C++ Bindings: Add helpers for bad message reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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.h ('k') | mojo/public/cpp/bindings/lib/message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core.cc
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
index b2abf0f2951e389d928d82295617dea5ee7857ce..4bb07eaf3886bb113df9dbbd3bbb4c0c681751b5 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -167,6 +167,11 @@ scoped_refptr<Dispatcher> Core::GetDispatcher(MojoHandle handle) {
return handles_.GetDispatcher(handle);
}
+void Core::SetDefaultProcessErrorCallback(
+ const ProcessErrorCallback& callback) {
+ default_process_error_callback_ = callback;
+}
+
void Core::AddChild(base::ProcessHandle process_handle,
ScopedPlatformHandle platform_handle,
const std::string& child_token,
@@ -772,6 +777,8 @@ MojoResult Core::NotifyBadMessage(MojoMessageHandle message,
reinterpret_cast<MessageForTransit*>(message)->ports_message();
if (ports_message.source_node() == ports::kInvalidNodeName) {
DVLOG(1) << "Received invalid message from unknown node.";
+ if (!default_process_error_callback_.is_null())
+ default_process_error_callback_.Run(std::string(error, error_num_bytes));
return MOJO_RESULT_OK;
}
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/public/cpp/bindings/lib/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698