OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/p2p/socket_host_udp.h" | 5 #include "content/browser/renderer_host/p2p/socket_host_udp.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 cb.Run(size); | 100 cb.Run(size); |
101 } else { | 101 } else { |
102 incoming_packets_.push_back(UDPPacket(address, data)); | 102 incoming_packets_.push_back(UDPPacket(address, data)); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 virtual const net::BoundNetLog& NetLog() const { | 106 virtual const net::BoundNetLog& NetLog() const { |
107 return net_log_; | 107 return net_log_; |
108 } | 108 } |
109 | 109 |
110 virtual void AllowAddressReuse() OVERRIDE { | |
111 } | |
Sergey Ulanov
2012/07/12 18:15:37
NOTIMPLEMENTED()
ygorshenin1
2012/07/16 10:29:44
Done.
| |
112 | |
113 virtual void AllowBroadcast() OVERRIDE { | |
114 } | |
Sergey Ulanov
2012/07/12 18:15:37
NOTIMPLEMENTED()
ygorshenin1
2012/07/16 10:29:44
Done.
| |
115 | |
110 private: | 116 private: |
111 net::IPEndPoint address_; | 117 net::IPEndPoint address_; |
112 std::deque<UDPPacket>* sent_packets_; | 118 std::deque<UDPPacket>* sent_packets_; |
113 std::deque<UDPPacket> incoming_packets_; | 119 std::deque<UDPPacket> incoming_packets_; |
114 net::BoundNetLog net_log_; | 120 net::BoundNetLog net_log_; |
115 | 121 |
116 scoped_refptr<net::IOBuffer> recv_buffer_; | 122 scoped_refptr<net::IOBuffer> recv_buffer_; |
117 net::IPEndPoint* recv_address_; | 123 net::IPEndPoint* recv_address_; |
118 int recv_size_; | 124 int recv_size_; |
119 net::CompletionCallback recv_callback_; | 125 net::CompletionCallback recv_callback_; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 // Should fail when trying to send the same packet to |dest2_|. | 247 // Should fail when trying to send the same packet to |dest2_|. |
242 std::vector<char> packet; | 248 std::vector<char> packet; |
243 CreateRandomPacket(&packet); | 249 CreateRandomPacket(&packet); |
244 EXPECT_CALL(sender_, Send( | 250 EXPECT_CALL(sender_, Send( |
245 MatchMessage(static_cast<uint32>(P2PMsg_OnError::ID)))) | 251 MatchMessage(static_cast<uint32>(P2PMsg_OnError::ID)))) |
246 .WillOnce(DoAll(DeleteArg<0>(), Return(true))); | 252 .WillOnce(DoAll(DeleteArg<0>(), Return(true))); |
247 socket_host_->Send(dest2_, packet); | 253 socket_host_->Send(dest2_, packet); |
248 } | 254 } |
249 | 255 |
250 } // namespace content | 256 } // namespace content |
OLD | NEW |