| Index: mojo/services/network/main.cc
|
| diff --git a/mojo/services/network/main.cc b/mojo/services/network/main.cc
|
| index a3f397d8a5b2cf226e3676de854a74347f54fc1a..cd0ff1b388bd4271005f7ed7f437cfb7df53d706 100644
|
| --- a/mojo/services/network/main.cc
|
| +++ b/mojo/services/network/main.cc
|
| @@ -10,6 +10,7 @@
|
| #include "mojo/public/cpp/application/application_connection.h"
|
| #include "mojo/public/cpp/application/application_delegate.h"
|
| #include "mojo/public/cpp/application/application_impl.h"
|
| +#include "mojo/public/cpp/application/interface_factory_with_context.h"
|
| #include "mojo/public/cpp/bindings/interface_ptr.h"
|
| #include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
|
| #include "mojo/services/network/network_context.h"
|
| @@ -32,6 +33,10 @@ void OnPathReceived(base::FilePath* path, const mojo::String& path_as_string) {
|
| } // namespace
|
|
|
| class Delegate : public mojo::ApplicationDelegate {
|
| + typedef mojo::InterfaceFactoryWithContext<mojo::NetworkServiceImpl,
|
| + mojo::NetworkContext>
|
| + NetworkFactory;
|
| +
|
| public:
|
| Delegate() {}
|
|
|
| @@ -46,17 +51,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_factory_.reset(new NetworkFactory(context_.get()));
|
| }
|
|
|
| + // mojo::ApplicationDelegate implementation.
|
| virtual bool ConfigureIncomingConnection(
|
| mojo::ApplicationConnection* connection) MOJO_OVERRIDE {
|
| DCHECK(context_);
|
| - connection->AddService<mojo::NetworkServiceImpl>(context_.get());
|
| + connection->AddServiceFactory(network_service_factory_.get());
|
| return true;
|
| }
|
|
|
| private:
|
| scoped_ptr<mojo::NetworkContext> context_;
|
| + scoped_ptr<NetworkFactory> network_service_factory_;
|
| };
|
|
|
| extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain(
|
|
|