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

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

Issue 280003003: Add SetClient method implementation to InterfaceImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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 | « mojo/examples/launcher/launcher.cc ('k') | mojo/public/cpp/bindings/lib/interface_impl_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/interface_impl.h
diff --git a/mojo/public/cpp/bindings/interface_impl.h b/mojo/public/cpp/bindings/interface_impl.h
index ec6bc9160e7701dcf4f45ef73c3d992fcb2d1bf9..a9d0947757d728bb773efe0538952ec1556a7151 100644
--- a/mojo/public/cpp/bindings/interface_impl.h
+++ b/mojo/public/cpp/bindings/interface_impl.h
@@ -20,12 +20,20 @@ namespace mojo {
template <typename Interface>
class InterfaceImpl : public WithErrorHandler<Interface> {
public:
+ typedef typename Interface::Client Client;
+
InterfaceImpl() : internal_state_(this) {}
virtual ~InterfaceImpl() {}
// Subclasses must handle connection errors.
virtual void OnConnectionError() = 0;
+ // We override SetClient here so subclasses don't each have to.
+ virtual void SetClient(Client* client) MOJO_OVERRIDE {
+ internal_state_.set_client(client);
+ }
+ Client* client() { return internal_state_.client(); }
+
// DO NOT USE. Exposed only for internal use and for testing.
internal::InterfaceImplState<Interface>* internal_state() {
return &internal_state_;
« no previous file with comments | « mojo/examples/launcher/launcher.cc ('k') | mojo/public/cpp/bindings/lib/interface_impl_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698