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

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

Issue 1748503002: [mojo-edk] Add MojoWatch and MojoCancelWatch APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: there can be only one RequestContext! Created 4 years, 10 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
Index: mojo/edk/system/node_controller.cc
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
index e2b1b08f5f307c6846f1e84a8af7c92b6de355b5..337bcac8b132c59a197c6143a9084d21d2e2b57d 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -21,6 +21,7 @@
#include "mojo/edk/system/broker_host.h"
#include "mojo/edk/system/core.h"
#include "mojo/edk/system/ports_message.h"
+#include "mojo/edk/system/request_context.h"
namespace mojo {
namespace edk {
@@ -716,6 +717,12 @@ void NodeController::OnAcceptBrokerClient(const ports::NodeName& from_node,
void NodeController::OnPortsMessage(Channel::MessagePtr channel_message) {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
+ // This is a singular chokepoint through which dispatcher port statuses may
+ // be changed without an explicit call to some Mojo system API. We need to
+ // ensure that a RequestContext exists in case a dispatcher has any watchers
+ // to notify.
+ RequestContext request_context;
+
void* data;
size_t num_data_bytes;
NodeChannel::GetPortsMessageData(

Powered by Google App Engine
This is Rietveld 408576698