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

Unified Diff: examples/content_handler_demo/content_handler_demo.cc

Issue 2019743002: Yet more ApplicationDelegate/ApplicationRunner conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 | « no previous file | examples/echo/echo_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fc128914c08296c6e182d8848d7c67f4cffd8ca8..fb322ebf696fc51e71f31910a3cecd14b9f1b41b 100644
--- a/examples/content_handler_demo/content_handler_demo.cc
+++ b/examples/content_handler_demo/content_handler_demo.cc
@@ -4,13 +4,12 @@
#include <stdio.h>
-#include <memory>
#include <utility>
#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_runner.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/public/cpp/bindings/strong_binding.h"
#include "mojo/public/cpp/system/wait.h"
#include "mojo/services/content_handler/interfaces/content_handler.mojom.h"
@@ -92,15 +91,12 @@ class ContentHandlerImpl : public ContentHandler {
MOJO_DISALLOW_COPY_AND_ASSIGN(ContentHandlerImpl);
};
-class ContentHandlerApp : public ApplicationDelegate {
+class ContentHandlerApp : public ApplicationImplBase {
public:
ContentHandlerApp() {}
~ContentHandlerApp() override {}
- void Initialize(ApplicationImpl* app) override {}
-
- bool ConfigureIncomingConnection(
- ServiceProviderImpl* service_provider_impl) override {
+ bool OnAcceptConnection(ServiceProviderImpl* service_provider_impl) override {
service_provider_impl->AddService<ContentHandler>(
[](const ConnectionContext& connection_context,
InterfaceRequest<ContentHandler> content_handler_request) {
@@ -117,8 +113,6 @@ class ContentHandlerApp : public ApplicationDelegate {
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunner runner(
- std::unique_ptr<mojo::examples::ContentHandlerApp>(
- new mojo::examples::ContentHandlerApp()));
- return runner.Run(application_request);
+ mojo::examples::ContentHandlerApp content_handler_app;
+ return mojo::RunMainApplication(application_request, &content_handler_app);
}
« no previous file with comments | « no previous file | examples/echo/echo_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698