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

Side by Side Diff: examples/wget/wget.cc

Issue 1916233002: Mark ApplicationImpl::ConnectTo{Application,Service}() as deprecated. (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 unified diff | Download patch
« no previous file with comments | « examples/ui/tile/tile_view.cc ('k') | mojo/common/tracing_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_delegate.h" 10 #include "mojo/public/cpp/application/application_delegate.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 printf("\n>>> EOF <<<\n"); 71 printf("\n>>> EOF <<<\n");
72 } 72 }
73 }; 73 };
74 74
75 } // namespace 75 } // namespace
76 76
77 class WGetApp : public ApplicationDelegate { 77 class WGetApp : public ApplicationDelegate {
78 public: 78 public:
79 void Initialize(ApplicationImpl* app) override { 79 void Initialize(ApplicationImpl* app) override {
80 app->ConnectToService("mojo:network_service", &network_service_); 80 app->ConnectToServiceDeprecated("mojo:network_service", &network_service_);
81 Start(app->args()); 81 Start(app->args());
82 } 82 }
83 83
84 private: 84 private:
85 void Start(const std::vector<std::string>& args) { 85 void Start(const std::vector<std::string>& args) {
86 std::string url((args.size() > 1) ? args[1] : PromptForURL()); 86 std::string url((args.size() > 1) ? args[1] : PromptForURL());
87 printf("Loading: %s\n", url.c_str()); 87 printf("Loading: %s\n", url.c_str());
88 88
89 network_service_->CreateURLLoader(GetProxy(&url_loader_)); 89 network_service_->CreateURLLoader(GetProxy(&url_loader_));
90 90
(...skipping 18 matching lines...) Expand all
109 }; 109 };
110 110
111 } // namespace examples 111 } // namespace examples
112 } // namespace mojo 112 } // namespace mojo
113 113
114 MojoResult MojoMain(MojoHandle application_request) { 114 MojoResult MojoMain(MojoHandle application_request) {
115 mojo::ApplicationRunner runner( 115 mojo::ApplicationRunner runner(
116 std::unique_ptr<mojo::examples::WGetApp>(new mojo::examples::WGetApp())); 116 std::unique_ptr<mojo::examples::WGetApp>(new mojo::examples::WGetApp()));
117 return runner.Run(application_request); 117 return runner.Run(application_request);
118 } 118 }
OLDNEW
« no previous file with comments | « examples/ui/tile/tile_view.cc ('k') | mojo/common/tracing_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698