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

Unified Diff: third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc

Issue 1019173002: Update mojo sdk to rev 7214b7ec7d27563b2666afad86cf1c5895c56c18 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep permission service alive if embedder drops requests Created 5 years, 9 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: third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc
index bb29e47c1c83a2d434f6b0976ed5c2d7aeecb1fe..da1e7e122024496d9e1f0433497d3712af591573 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc
@@ -14,11 +14,25 @@ namespace internal {
class ResponderThunk : public MessageReceiver {
public:
explicit ResponderThunk(const SharedData<Router*>& router)
- : router_(router) {}
- ~ResponderThunk() override {}
+ : router_(router), accept_was_invoked_(false) {}
+ ~ResponderThunk() override {
+ if (!accept_was_invoked_) {
+ // The Mojo application handled a message that was expecting a response
+ // but did not send a response.
+ Router* router = router_.value();
+ if (router) {
+ // We close the pipe here as a way of signaling to the calling
+ // application that an error condition occurred. Without this the
+ // calling application would have no way of knowing it should stop
+ // waiting for a response.
+ router->CloseMessagePipe();
+ }
+ }
+ }
// MessageReceiver implementation:
bool Accept(Message* message) override {
+ accept_was_invoked_ = true;
MOJO_DCHECK(message->has_flag(kMessageIsResponse));
bool result = false;
@@ -32,6 +46,7 @@ class ResponderThunk : public MessageReceiver {
private:
SharedData<Router*> router_;
+ bool accept_was_invoked_;
};
// ----------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698