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

Unified Diff: mojo/public/cpp/bindings/lib/connector.cc

Issue 1781573004: Mojo C++ bindings: error notification behavior related to sync calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/router.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/connector.cc
diff --git a/mojo/public/cpp/bindings/lib/connector.cc b/mojo/public/cpp/bindings/lib/connector.cc
index 812b4c1133f56db708729a82055cbb24e9671456..c7378f0b605b419e3e5d45a0e51a87d186a926f7 100644
--- a/mojo/public/cpp/bindings/lib/connector.cc
+++ b/mojo/public/cpp/bindings/lib/connector.cc
@@ -368,16 +368,18 @@ void Connector::HandleError(bool force_pipe_reset, bool force_async_handler) {
if (error_ || !message_pipe_.is_valid())
return;
- if (!force_pipe_reset && force_async_handler)
- force_pipe_reset = true;
-
- if (paused_) {
- // If the user has paused receiving messages, we shouldn't call the error
- // handler right away. We need to wait until the user starts receiving
- // messages again.
+ if (during_sync_handle_watcher_callback() || paused_) {
+ // Enforce calling the error handler asynchronously if:
+ // - currently we are in a sync handle watcher callback. We don't want the
+ // error handler to reenter an ongoing sync call.
+ // - the user has paused receiving messages. We need to wait until the user
+ // starts receiving messages again.
force_async_handler = true;
}
+ if (!force_pipe_reset && force_async_handler)
+ force_pipe_reset = true;
+
if (force_pipe_reset) {
CancelWait();
MayAutoLock locker(lock_.get());
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698