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

Unified Diff: examples/wget/wget.cc

Issue 2015643002: Add (optional) options to Run[Main]Application(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh 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
Index: examples/wget/wget.cc
diff --git a/examples/wget/wget.cc b/examples/wget/wget.cc
index 156eeb9e06c20ff8bccd6152a9c633522588fd5a..d333093bc13f652627cd3af69fbd81cf57374e5a 100644
--- a/examples/wget/wget.cc
+++ b/examples/wget/wget.cc
@@ -4,13 +4,10 @@
#include <stdio.h>
-#include <memory>
-
#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/connect.h"
+#include "mojo/public/cpp/application/run_application.h"
#include "mojo/public/cpp/system/wait.h"
#include "mojo/public/cpp/utility/run_loop.h"
#include "mojo/services/network/interfaces/network_service.mojom.h"
@@ -75,12 +72,12 @@ class ResponsePrinter {
} // namespace
-class WGetApp : public ApplicationDelegate {
+class WGetApp : public ApplicationImplBase {
public:
- void Initialize(ApplicationImpl* app) override {
- ConnectToService(app->shell(), "mojo:network_service",
+ void OnInitialize() override {
+ ConnectToService(shell(), "mojo:network_service",
GetProxy(&network_service_));
- Start(app->args());
+ Start(args());
}
private:
@@ -114,7 +111,6 @@ class WGetApp : public ApplicationDelegate {
} // namespace mojo
MojoResult MojoMain(MojoHandle application_request) {
- mojo::ApplicationRunner runner(
- std::unique_ptr<mojo::examples::WGetApp>(new mojo::examples::WGetApp()));
- return runner.Run(application_request);
+ mojo::examples::WGetApp wget_app;
+ return mojo::RunMainApplication(application_request, &wget_app);
}

Powered by Google App Engine
This is Rietveld 408576698