| 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/public/cpp/application/application_connection.h" | 7 #include "mojo/public/cpp/application/application_connection.h" |
| 8 #include "mojo/services/network/cookie_store_impl.h" | 8 #include "mojo/services/network/cookie_store_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/url_loader_impl.h" | 12 #include "mojo/services/network/url_loader_impl.h" |
| 12 #include "mojo/services/network/web_socket_impl.h" | 13 #include "mojo/services/network/web_socket_impl.h" |
| 13 | 14 |
| 14 namespace mojo { | 15 namespace mojo { |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 // Allows a Callback<NetworkErrorPtr, NetAddressPtr> to be called by a | 19 // Allows a Callback<NetworkErrorPtr, NetAddressPtr> to be called by a |
| 19 // Callback<NetworkErrorPtr> when the address is already known. | 20 // Callback<NetworkErrorPtr> when the address is already known. |
| 20 void BoundAddressCallbackAdapter( | 21 void BoundAddressCallbackAdapter( |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 78 } |
| 78 | 79 |
| 79 bound_socket.Connect( | 80 bound_socket.Connect( |
| 80 remote_address.Pass(), send_stream.Pass(), receive_stream.Pass(), | 81 remote_address.Pass(), send_stream.Pass(), receive_stream.Pass(), |
| 81 client_socket.Pass(), | 82 client_socket.Pass(), |
| 82 base::Bind(&BoundAddressCallbackAdapter, | 83 base::Bind(&BoundAddressCallbackAdapter, |
| 83 callback, | 84 callback, |
| 84 base::Passed(bound_socket.GetLocalAddress().Pass()))); | 85 base::Passed(bound_socket.GetLocalAddress().Pass()))); |
| 85 } | 86 } |
| 86 | 87 |
| 88 void NetworkServiceImpl::CreateUDPSocket(InterfaceRequest<UDPSocket> socket) { |
| 89 BindToRequest(new UDPSocketImpl(), &socket); |
| 90 } |
| 91 |
| 87 } // namespace mojo | 92 } // namespace mojo |
| OLD | NEW |