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/udp_socket_impl.h" | 5 #include "mojo/services/network/udp_socket_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 19 matching lines...) Expand all Loading... |
30 const size_t kMaxPendingSendRequestsUpperbound = 128; | 30 const size_t kMaxPendingSendRequestsUpperbound = 128; |
31 const size_t kDefaultMaxPendingSendRequests = 32; | 31 const size_t kDefaultMaxPendingSendRequests = 32; |
32 | 32 |
33 } // namespace | 33 } // namespace |
34 | 34 |
35 UDPSocketImpl::PendingSendRequest::PendingSendRequest() {} | 35 UDPSocketImpl::PendingSendRequest::PendingSendRequest() {} |
36 | 36 |
37 UDPSocketImpl::PendingSendRequest::~PendingSendRequest() {} | 37 UDPSocketImpl::PendingSendRequest::~PendingSendRequest() {} |
38 | 38 |
39 UDPSocketImpl::UDPSocketImpl(InterfaceRequest<UDPSocket> request, | 39 UDPSocketImpl::UDPSocketImpl(InterfaceRequest<UDPSocket> request, |
40 scoped_ptr<mojo::AppRefCount> app_refcount) | 40 scoped_ptr<mojo::MessageLoopRef> app_refcount) |
41 : binding_(this, std::move(request)), | 41 : binding_(this, std::move(request)), |
42 socket_(net::DatagramSocket::DEFAULT_BIND, | 42 socket_(net::DatagramSocket::DEFAULT_BIND, |
43 net::RandIntCallback(), | 43 net::RandIntCallback(), |
44 nullptr, | 44 nullptr, |
45 net::NetLog::Source()), | 45 net::NetLog::Source()), |
46 state_(NOT_BOUND_OR_CONNECTED), | 46 state_(NOT_BOUND_OR_CONNECTED), |
47 allow_address_reuse_(false), | 47 allow_address_reuse_(false), |
48 remaining_recv_slots_(0), | 48 remaining_recv_slots_(0), |
49 max_pending_send_requests_(kDefaultMaxPendingSendRequests), | 49 max_pending_send_requests_(kDefaultMaxPendingSendRequests), |
50 app_refcount_(std::move(app_refcount)) {} | 50 app_refcount_(std::move(app_refcount)) {} |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 return; | 371 return; |
372 | 372 |
373 scoped_ptr<PendingSendRequest> request(pending_send_requests_.front()); | 373 scoped_ptr<PendingSendRequest> request(pending_send_requests_.front()); |
374 pending_send_requests_.pop_front(); | 374 pending_send_requests_.pop_front(); |
375 | 375 |
376 DoSendTo(std::move(request->addr), std::move(request->data), | 376 DoSendTo(std::move(request->addr), std::move(request->data), |
377 request->callback); | 377 request->callback); |
378 } | 378 } |
379 | 379 |
380 } // namespace mojo | 380 } // namespace mojo |
OLD | NEW |