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

Unified Diff: third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h

Issue 1311613002: Revert of Update mojo sdk to rev c02a28868825edfa57ab77947b8cb15e741c5598 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h b/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h
index 00514ddb5427dffc973349ea95f376b62922617f..04f4902bd89223ab2a1a83c8574bdcc2bf3f7bc9 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr.h
@@ -8,6 +8,7 @@
#include <algorithm>
#include "mojo/public/cpp/bindings/callback.h"
+#include "mojo/public/cpp/bindings/error_handler.h"
#include "mojo/public/cpp/bindings/interface_ptr_info.h"
#include "mojo/public/cpp/bindings/lib/interface_ptr_internal.h"
#include "mojo/public/cpp/environment/environment.h"
@@ -73,9 +74,6 @@
internal_state_.Bind(info.Pass(), waiter);
}
- // Returns whether or not this InterfacePtr is bound to a message pipe.
- bool is_bound() const { return internal_state_.is_bound(); }
-
// Returns a raw pointer to the local proxy. Caller does not take ownership.
// Note that the local proxy is thread hostile, as stated above.
Interface* get() const { return internal_state_.instance(); }
@@ -136,6 +134,19 @@
internal_state_.set_connection_error_handler(error_handler);
}
+ // Similar to the method above but uses the ErrorHandler interface instead of
+ // a callback.
+ // NOTE: Deprecated. Please use the method above.
+ // TODO(yzshen): Remove this method once all callsites are converted.
+ void set_error_handler(ErrorHandler* error_handler) {
+ if (error_handler) {
+ set_connection_error_handler(
+ [error_handler]() { error_handler->OnConnectionError(); });
+ } else {
+ set_connection_error_handler(Closure());
+ }
+ }
+
// Unbinds the InterfacePtr and returns the information which could be used
// to setup an InterfacePtr again. This method may be used to move the proxy
// to a different thread (see class comments for details).

Powered by Google App Engine
This is Rietveld 408576698