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

Unified Diff: examples/forwarding_content_handler/forwarding_content_handler.cc

Issue 2015363003: Yet more ApplicationDelegate -> ApplicationImplBase conversion. (Closed) Base URL: https://github.com/domokit/mojo.git@work797-x-work796_no_run_main_app
Patch Set: rebased again 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/echo/echo_benchmark.cc ('k') | examples/trace_me/trace_me_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/forwarding_content_handler/forwarding_content_handler.cc
diff --git a/examples/forwarding_content_handler/forwarding_content_handler.cc b/examples/forwarding_content_handler/forwarding_content_handler.cc
index cfc284a02ab05ebf4d6bc1a0db15e187a19704cd..e6d35315bcd7ac3f9622106523c7f67e913c0bdc 100644
--- a/examples/forwarding_content_handler/forwarding_content_handler.cc
+++ b/examples/forwarding_content_handler/forwarding_content_handler.cc
@@ -6,11 +6,12 @@
#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/data_pipe_utils/data_pipe_utils.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_base.h"
+#include "mojo/public/cpp/application/run_application.h"
#include "mojo/public/cpp/application/service_provider_impl.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/utility/run_loop.h"
@@ -51,15 +52,14 @@ class ForwardingApplicationImpl : public Application {
ShellPtr shell_;
};
-class ForwardingContentHandler : public ApplicationDelegate,
+class ForwardingContentHandler : public ApplicationImplBase,
public ContentHandlerFactory::ManagedDelegate {
public:
ForwardingContentHandler() {}
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;
@@ -87,7 +87,7 @@ class ForwardingContentHandler : public ApplicationDelegate,
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunnerChromium runner(
- new mojo::examples::ForwardingContentHandler());
- return runner.Run(application_request);
+ mojo::ScopedChromiumInit init;
+ mojo::examples::ForwardingContentHandler forwarding_content_handler;
+ return mojo::RunApplication(application_request, &forwarding_content_handler);
}
« no previous file with comments | « examples/echo/echo_benchmark.cc ('k') | examples/trace_me/trace_me_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698