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

Side by Side Diff: services/http_server/http_server_impl.cc

Issue 1915403002: ApplicationImpl::ConnectToServiceDeprecated() -> mojo::ConnectToService() conversion, part 2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh Created 4 years, 8 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 | « services/http_server/http_server_apptest.cc ('k') | services/java_handler/java_handler.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 "services/http_server/http_server_impl.h" 5 #include "services/http_server/http_server_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "mojo/public/cpp/application/application_impl.h" 11 #include "mojo/public/cpp/application/application_impl.h"
12 #include "mojo/public/cpp/application/connect.h"
12 #include "mojo/public/cpp/system/data_pipe.h" 13 #include "mojo/public/cpp/system/data_pipe.h"
13 #include "mojo/services/http_server/cpp/http_server_util.h" 14 #include "mojo/services/http_server/cpp/http_server_util.h"
14 #include "services/http_server/connection.h" 15 #include "services/http_server/connection.h"
15 #include "services/http_server/http_server_factory_impl.h" 16 #include "services/http_server/http_server_factory_impl.h"
16 17
17 namespace http_server { 18 namespace http_server {
18 19
19 HttpServerImpl::HttpServerImpl(mojo::ApplicationImpl* app, 20 HttpServerImpl::HttpServerImpl(mojo::ApplicationImpl* app,
20 HttpServerFactoryImpl* factory, 21 HttpServerFactoryImpl* factory,
21 mojo::NetAddressPtr requested_local_address) 22 mojo::NetAddressPtr requested_local_address)
22 : factory_(factory), 23 : factory_(factory),
23 requested_local_address_(requested_local_address.Pass()), 24 requested_local_address_(requested_local_address.Pass()),
24 assigned_port_(0), 25 assigned_port_(0),
25 weak_ptr_factory_(this) { 26 weak_ptr_factory_(this) {
26 app->ConnectToServiceDeprecated("mojo:network_service", &network_service_); 27 mojo::ConnectToService(app->shell(), "mojo:network_service",
28 GetProxy(&network_service_));
27 Start(); 29 Start();
28 } 30 }
29 31
30 HttpServerImpl::~HttpServerImpl() { 32 HttpServerImpl::~HttpServerImpl() {
31 } 33 }
32 34
33 void HttpServerImpl::AddBinding(mojo::InterfaceRequest<HttpServer> request) { 35 void HttpServerImpl::AddBinding(mojo::InterfaceRequest<HttpServer> request) {
34 bindings_.AddBinding(this, request.Pass()); 36 bindings_.AddBinding(this, request.Pass());
35 } 37 }
36 38
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 165
164 HttpServerImpl::Handler::Handler(const std::string& pattern, 166 HttpServerImpl::Handler::Handler(const std::string& pattern,
165 HttpHandlerPtr http_handler) 167 HttpHandlerPtr http_handler)
166 : pattern(new RE2(pattern.c_str())), http_handler(http_handler.Pass()) { 168 : pattern(new RE2(pattern.c_str())), http_handler(http_handler.Pass()) {
167 } 169 }
168 170
169 HttpServerImpl::Handler::~Handler() { 171 HttpServerImpl::Handler::~Handler() {
170 } 172 }
171 173
172 } // namespace http_server 174 } // namespace http_server
OLDNEW
« no previous file with comments | « services/http_server/http_server_apptest.cc ('k') | services/java_handler/java_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698