Index: mojo/services/network/main.cc |
diff --git a/mojo/services/network/main.cc b/mojo/services/network/main.cc |
index 3cfc74f43f06c5008da70af9870b89ebd2c8ee9d..216fc8cdb73f326ceafea42be4f2c9977a303a78 100644 |
--- a/mojo/services/network/main.cc |
+++ b/mojo/services/network/main.cc |
@@ -32,6 +32,10 @@ void OnPathReceived(base::FilePath* path, const mojo::String& path_as_string) { |
} // namespace |
class Delegate : public mojo::ApplicationDelegate { |
+ typedef mojo::ContextInterfaceProvider<mojo::NetworkServiceImpl, |
+ mojo::NetworkContext, |
+ mojo::NetworkService> NetworkProvider; |
+ |
public: |
Delegate() {} |
@@ -46,17 +50,20 @@ class Delegate : public mojo::ApplicationDelegate { |
DCHECK(!base_path.value().empty()); |
base_path = base_path.Append(FILE_PATH_LITERAL("network_service")); |
context_.reset(new mojo::NetworkContext(base_path)); |
+ network_service_provider_.reset(new NetworkProvider(context_.get())); |
} |
+ // mojo::ApplicationDelegate implementation. |
virtual bool ConfigureIncomingConnection( |
mojo::ApplicationConnection* connection) MOJO_OVERRIDE { |
DCHECK(context_); |
- connection->AddService<mojo::NetworkServiceImpl>(context_.get()); |
+ connection->AddServiceProvider(network_service_provider_.get()); |
jamesr
2014/07/11 20:07:10
here, instead of implementing InterfaceProvider<>:
|
return true; |
} |
private: |
scoped_ptr<mojo::NetworkContext> context_; |
+ scoped_ptr<NetworkProvider> network_service_provider_; |
}; |
extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain( |