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

Unified Diff: examples/recursive_content_handler/recursive_content_handler.cc

Issue 2010283006: Almost done: ApplicationDelegate -> ApplicationImplBase conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@work798-x-work797-x-work796_no_run_main_app
Patch Set: rebased Created 4 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
« no previous file with comments | « examples/native_run_app/native_run_app.cc ('k') | mojo/application/content_handler_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « examples/native_run_app/native_run_app.cc ('k') | mojo/application/content_handler_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698