| Index: examples/recursive_content_handler/recursive_content_handler.cc
|
| diff --git a/examples/recursive_content_handler/recursive_content_handler.cc b/examples/recursive_content_handler/recursive_content_handler.cc
|
| index 77613d7d913402c0cddd08421132161b9369e706..303092972661f7b31a42b90d09debde6a570b967 100644
|
| --- a/examples/recursive_content_handler/recursive_content_handler.cc
|
| +++ b/examples/recursive_content_handler/recursive_content_handler.cc
|
| @@ -4,26 +4,25 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/scoped_ptr.h"
|
| -#include "mojo/application/application_runner_chromium.h"
|
| #include "mojo/application/content_handler_factory.h"
|
| +#include "mojo/environment/scoped_chromium_init.h"
|
| #include "mojo/public/c/system/main.h"
|
| -#include "mojo/public/cpp/application/application_delegate.h"
|
| -#include "mojo/public/cpp/application/application_impl.h"
|
| +#include "mojo/public/cpp/application/application_impl_base.h"
|
| +#include "mojo/public/cpp/application/run_application.h"
|
| #include "mojo/public/cpp/application/service_provider_impl.h"
|
| #include "mojo/services/content_handler/interfaces/content_handler.mojom.h"
|
|
|
| namespace mojo {
|
| namespace examples {
|
|
|
| -class RecursiveContentHandler : public ApplicationDelegate,
|
| +class RecursiveContentHandler : public ApplicationImplBase,
|
| public ContentHandlerFactory::ManagedDelegate {
|
| public:
|
| RecursiveContentHandler() {}
|
|
|
| private:
|
| - // Overridden from ApplicationDelegate:
|
| - bool ConfigureIncomingConnection(
|
| - ServiceProviderImpl* service_provider_impl) override {
|
| + // Overridden from ApplicationImplBase:
|
| + bool OnAcceptConnection(ServiceProviderImpl* service_provider_impl) override {
|
| service_provider_impl->AddService<ContentHandler>(
|
| ContentHandlerFactory::GetInterfaceRequestHandler(this));
|
| return true;
|
| @@ -34,8 +33,9 @@ class RecursiveContentHandler : public ApplicationDelegate,
|
| CreateApplication(InterfaceRequest<Application> application_request,
|
| URLResponsePtr response) override {
|
| LOG(INFO) << "RecursiveContentHandler called with url: " << response->url;
|
| - return make_handled_factory_holder(new mojo::ApplicationImpl(
|
| - new RecursiveContentHandler(), application_request.Pass()));
|
| + auto app = new RecursiveContentHandler();
|
| + app->Bind(application_request.Pass());
|
| + return make_handled_factory_holder(app);
|
| }
|
|
|
| DISALLOW_COPY_AND_ASSIGN(RecursiveContentHandler);
|
| @@ -45,7 +45,7 @@ class RecursiveContentHandler : public ApplicationDelegate,
|
| } // namespace mojo
|
|
|
| MojoResult MojoMain(MojoHandle application_request) {
|
| - mojo::ApplicationRunnerChromium runner(
|
| - new mojo::examples::RecursiveContentHandler());
|
| - return runner.Run(application_request);
|
| + mojo::ScopedChromiumInit init;
|
| + mojo::examples::RecursiveContentHandler recursive_content_handler;
|
| + return mojo::RunApplication(application_request, &recursive_content_handler);
|
| }
|
|
|