| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "mojo/services/network/http_server_impl.h" | 9 #include "mojo/services/network/http_server_impl.h" |
| 10 #include "mojo/services/network/net_adapters.h" | 10 #include "mojo/services/network/net_adapters.h" |
| 11 #include "mojo/services/network/tcp_bound_socket_impl.h" | 11 #include "mojo/services/network/tcp_bound_socket_impl.h" |
| 12 #include "mojo/services/network/udp_socket_impl.h" | 12 #include "mojo/services/network/udp_socket_impl.h" |
| 13 #include "mojo/services/network/url_loader_impl.h" | 13 #include "mojo/services/network/url_loader_impl.h" |
| 14 #include "net/base/mime_util.h" | 14 #include "net/base/mime_util.h" |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 | 17 |
| 18 NetworkServiceImpl::NetworkServiceImpl( | 18 NetworkServiceImpl::NetworkServiceImpl( |
| 19 scoped_ptr<mojo::AppRefCount> app_refcount, | 19 scoped_ptr<mojo::MessageLoopRef> app_refcount, |
| 20 InterfaceRequest<NetworkService> request) | 20 InterfaceRequest<NetworkService> request) |
| 21 : app_refcount_(std::move(app_refcount)), | 21 : app_refcount_(std::move(app_refcount)), |
| 22 binding_(this, std::move(request)) {} | 22 binding_(this, std::move(request)) {} |
| 23 | 23 |
| 24 NetworkServiceImpl::~NetworkServiceImpl() { | 24 NetworkServiceImpl::~NetworkServiceImpl() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 void NetworkServiceImpl::CreateTCPBoundSocket( | 27 void NetworkServiceImpl::CreateTCPBoundSocket( |
| 28 NetAddressPtr local_address, | 28 NetAddressPtr local_address, |
| 29 InterfaceRequest<TCPBoundSocket> bound_socket, | 29 InterfaceRequest<TCPBoundSocket> bound_socket, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 void NetworkServiceImpl::GetMimeTypeFromFile( | 68 void NetworkServiceImpl::GetMimeTypeFromFile( |
| 69 const mojo::String& file_path, | 69 const mojo::String& file_path, |
| 70 const GetMimeTypeFromFileCallback& callback) { | 70 const GetMimeTypeFromFileCallback& callback) { |
| 71 std::string mime; | 71 std::string mime; |
| 72 net::GetMimeTypeFromFile( | 72 net::GetMimeTypeFromFile( |
| 73 base::FilePath::FromUTF8Unsafe(file_path.To<std::string>()), &mime); | 73 base::FilePath::FromUTF8Unsafe(file_path.To<std::string>()), &mime); |
| 74 callback.Run(mime); | 74 callback.Run(mime); |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace mojo | 77 } // namespace mojo |
| OLD | NEW |