| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "content/common/p2p_messages.h" | 9 #include "content/common/p2p_messages.h" |
| 10 #include "ipc/ipc_sender.h" | 10 #include "ipc/ipc_sender.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 P2PSocketHostUdp::PendingPacket::~PendingPacket() { | 61 P2PSocketHostUdp::PendingPacket::~PendingPacket() { |
| 62 } | 62 } |
| 63 | 63 |
| 64 P2PSocketHostUdp::P2PSocketHostUdp(IPC::Sender* message_sender, int id) | 64 P2PSocketHostUdp::P2PSocketHostUdp(IPC::Sender* message_sender, int id) |
| 65 : P2PSocketHost(message_sender, id), | 65 : P2PSocketHost(message_sender, id), |
| 66 socket_(new net::UDPServerSocket(NULL, net::NetLog::Source())), | 66 socket_(new net::UDPServerSocket(NULL, net::NetLog::Source())), |
| 67 send_pending_(false), | 67 send_pending_(false), |
| 68 send_packet_count_(0) { | 68 send_packet_count_(0) { |
| 69 // 34 is the code "AF4", which is recommended for interactive multimedia. |
| 70 socket_->SetToS(34); |
| 69 } | 71 } |
| 70 | 72 |
| 71 P2PSocketHostUdp::~P2PSocketHostUdp() { | 73 P2PSocketHostUdp::~P2PSocketHostUdp() { |
| 72 if (state_ == STATE_OPEN) { | 74 if (state_ == STATE_OPEN) { |
| 73 DCHECK(socket_.get()); | 75 DCHECK(socket_.get()); |
| 74 socket_.reset(); | 76 socket_.reset(); |
| 75 } | 77 } |
| 76 } | 78 } |
| 77 | 79 |
| 78 bool P2PSocketHostUdp::Init(const net::IPEndPoint& local_address, | 80 bool P2PSocketHostUdp::Init(const net::IPEndPoint& local_address, |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } | 253 } |
| 252 | 254 |
| 253 P2PSocketHost* P2PSocketHostUdp::AcceptIncomingTcpConnection( | 255 P2PSocketHost* P2PSocketHostUdp::AcceptIncomingTcpConnection( |
| 254 const net::IPEndPoint& remote_address, int id) { | 256 const net::IPEndPoint& remote_address, int id) { |
| 255 NOTREACHED(); | 257 NOTREACHED(); |
| 256 OnError(); | 258 OnError(); |
| 257 return NULL; | 259 return NULL; |
| 258 } | 260 } |
| 259 | 261 |
| 260 } // namespace content | 262 } // namespace content |
| OLD | NEW |