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

Unified Diff: trunk/src/mojo/public/cpp/bindings/lib/interface_impl_internal.h

Issue 287003004: Revert 270867 "Mojo: Internalize ServiceConnector<>" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
Index: trunk/src/mojo/public/cpp/bindings/lib/interface_impl_internal.h
===================================================================
--- trunk/src/mojo/public/cpp/bindings/lib/interface_impl_internal.h (revision 270872)
+++ trunk/src/mojo/public/cpp/bindings/lib/interface_impl_internal.h (working copy)
@@ -15,19 +15,11 @@
namespace internal {
template <typename Interface>
-class InterfaceImplBase : public Interface {
- public:
- virtual ~InterfaceImplBase() {}
- virtual void OnConnectionEstablished() = 0;
- virtual void OnConnectionError() = 0;
-};
-
-template <typename Interface>
class InterfaceImplState : public ErrorHandler {
public:
typedef typename Interface::Client Client;
- explicit InterfaceImplState(InterfaceImplBase<Interface>* instance)
+ explicit InterfaceImplState(WithErrorHandler<Interface>* instance)
: router_(NULL),
client_(NULL),
proxy_(NULL) {
@@ -66,8 +58,7 @@
proxy_ = new typename Client::Proxy_(router_);
- instance()->SetClient(proxy_);
- instance()->OnConnectionEstablished();
+ stub_.sink()->SetClient(proxy_);
}
Router* router() { return router_; }
@@ -76,12 +67,9 @@
Client* client() { return client_; }
private:
- InterfaceImplBase<Interface>* instance() {
- return static_cast<InterfaceImplBase<Interface>*>(stub_.sink());
- }
-
virtual void OnConnectionError() MOJO_OVERRIDE {
- instance()->OnConnectionError();
+ static_cast<WithErrorHandler<Interface>*>(stub_.sink())->
+ OnConnectionError();
}
Router* router_;

Powered by Google App Engine
This is Rietveld 408576698