| OLD | NEW |
| 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 "mojo/services/network/network_service_impl.h" | 5 #include "mojo/services/network/network_service_impl.h" |
| 6 | 6 |
| 7 #include "mojo/services/network/cookie_store_impl.h" | 7 #include "mojo/services/network/cookie_store_impl.h" |
| 8 #include "mojo/services/network/http_server_impl.h" | 8 #include "mojo/services/network/http_server_impl.h" |
| 9 #include "mojo/services/network/net_adapters.h" | 9 #include "mojo/services/network/net_adapters.h" |
| 10 #include "mojo/services/network/tcp_bound_socket_impl.h" | 10 #include "mojo/services/network/tcp_bound_socket_impl.h" |
| 11 #include "mojo/services/network/udp_socket_impl.h" | 11 #include "mojo/services/network/udp_socket_impl.h" |
| 12 #include "mojo/services/network/url_loader_impl.h" | 12 #include "mojo/services/network/url_loader_impl.h" |
| 13 #include "mojo/services/network/web_socket_impl.h" | 13 #include "mojo/services/network/web_socket_impl.h" |
| 14 #include "third_party/mojo/src/mojo/public/cpp/application/application_connectio
n.h" | 14 #include "third_party/mojo/src/mojo/public/cpp/application/application_connectio
n.h" |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 | 17 |
| 18 NetworkServiceImpl::NetworkServiceImpl(ApplicationConnection* connection, | 18 NetworkServiceImpl::NetworkServiceImpl( |
| 19 NetworkContext* context) | 19 ApplicationConnection* connection, |
| 20 NetworkContext* context, |
| 21 scoped_ptr<mojo::ServiceRefcount> service_refcount) |
| 20 : context_(context), | 22 : context_(context), |
| 23 service_refcount_(service_refcount.Pass()), |
| 21 origin_(GURL(connection->GetRemoteApplicationURL()).GetOrigin()) { | 24 origin_(GURL(connection->GetRemoteApplicationURL()).GetOrigin()) { |
| 22 } | 25 } |
| 23 | 26 |
| 24 NetworkServiceImpl::~NetworkServiceImpl() { | 27 NetworkServiceImpl::~NetworkServiceImpl() { |
| 25 } | 28 } |
| 26 | 29 |
| 27 void NetworkServiceImpl::CreateURLLoader(InterfaceRequest<URLLoader> loader) { | 30 void NetworkServiceImpl::CreateURLLoader(InterfaceRequest<URLLoader> loader) { |
| 28 // TODO(darin): Plumb origin_. Use for CORS. | 31 // TODO(darin): Plumb origin_. Use for CORS. |
| 29 // The loader will delete itself when the pipe is closed, unless a request is | 32 // The loader will delete itself when the pipe is closed, unless a request is |
| 30 // in progress. In which case, the loader will delete itself when the request | 33 // in progress. In which case, the loader will delete itself when the request |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } | 76 } |
| 74 | 77 |
| 75 void NetworkServiceImpl::CreateHttpServer( | 78 void NetworkServiceImpl::CreateHttpServer( |
| 76 NetAddressPtr local_address, | 79 NetAddressPtr local_address, |
| 77 HttpServerDelegatePtr delegate, | 80 HttpServerDelegatePtr delegate, |
| 78 const CreateHttpServerCallback& callback) { | 81 const CreateHttpServerCallback& callback) { |
| 79 HttpServerImpl::Create(local_address.Pass(), delegate.Pass(), callback); | 82 HttpServerImpl::Create(local_address.Pass(), delegate.Pass(), callback); |
| 80 } | 83 } |
| 81 | 84 |
| 82 } // namespace mojo | 85 } // namespace mojo |
| OLD | NEW |