Index: examples/content_handler_demo/content_handler_demo.cc |
diff --git a/examples/content_handler_demo/content_handler_demo.cc b/examples/content_handler_demo/content_handler_demo.cc |
index 24fbd526488220cacb824e6a6a8c80badf351d32..d0b055246fdefe6b12399bddc3548e5b790fe2f3 100644 |
--- a/examples/content_handler_demo/content_handler_demo.cc |
+++ b/examples/content_handler_demo/content_handler_demo.cc |
@@ -92,8 +92,7 @@ class ContentHandlerImpl : public ContentHandler { |
MOJO_DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl); |
}; |
-class ContentHandlerApp : public ApplicationDelegate, |
- public InterfaceFactory<ContentHandler> { |
+class ContentHandlerApp : public ApplicationDelegate { |
public: |
ContentHandlerApp() {} |
~ContentHandlerApp() override {} |
@@ -101,15 +100,14 @@ class ContentHandlerApp : public ApplicationDelegate, |
void Initialize(ApplicationImpl* app) override {} |
bool ConfigureIncomingConnection(ApplicationConnection* connection) override { |
- connection->AddService(this); |
+ connection->GetServiceProviderImpl().AddService<ContentHandler>( |
+ [](const ConnectionContext& connection_context, |
+ InterfaceRequest<ContentHandler> content_handler_request) { |
+ new ContentHandlerImpl(content_handler_request.Pass()); |
+ }); |
return true; |
} |
- void Create(const ConnectionContext& connection_context, |
- InterfaceRequest<ContentHandler> request) override { |
- new ContentHandlerImpl(request.Pass()); |
- } |
- |
private: |
MOJO_DISALLOW_COPY_AND_ASSIGN(ContentHandlerApp); |
}; |