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

Unified Diff: mojo/public/cpp/bindings/binding.h

Issue 1531543003: Modify bindings to enforce that an error handler callback is only set after binding to a msg pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-error-handler
Patch Set: Created 5 years 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/public/cpp/bindings/binding.h
diff --git a/mojo/public/cpp/bindings/binding.h b/mojo/public/cpp/bindings/binding.h
index 09cdb88e77b4ebb4b6d3063b95df0a4b2d6ba7ff..55ea8b11c200cb771a1e05b3b1a496c895dcffd6 100644
--- a/mojo/public/cpp/bindings/binding.h
+++ b/mojo/public/cpp/bindings/binding.h
@@ -194,6 +194,7 @@ class Binding {
// Sets an error handler that will be called if a connection error occurs on
// the bound message pipe.
void set_connection_error_handler(const Closure& error_handler) {
+ DCHECK(is_bound());
internal_state_.set_connection_error_handler(error_handler);
}
« no previous file with comments | « no previous file | mojo/public/cpp/bindings/lib/binding_state.h » ('j') | mojo/public/cpp/bindings/lib/binding_state.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698