| 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/renderer/p2p/ipc_socket_factory.h" | 5 #include "content/renderer/p2p/ipc_socket_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 : type_(P2P_SOCKET_UDP), | 214 : type_(P2P_SOCKET_UDP), |
| 215 message_loop_(base::MessageLoop::current()), | 215 message_loop_(base::MessageLoop::current()), |
| 216 state_(IS_UNINITIALIZED), | 216 state_(IS_UNINITIALIZED), |
| 217 send_bytes_available_(kMaximumInFlightBytes), | 217 send_bytes_available_(kMaximumInFlightBytes), |
| 218 writable_signal_expected_(false), | 218 writable_signal_expected_(false), |
| 219 error_(0), | 219 error_(0), |
| 220 max_discard_bytes_sequence_(0), | 220 max_discard_bytes_sequence_(0), |
| 221 current_discard_bytes_sequence_(0), | 221 current_discard_bytes_sequence_(0), |
| 222 packets_discarded_(0), | 222 packets_discarded_(0), |
| 223 total_packets_(0) { | 223 total_packets_(0) { |
| 224 COMPILE_ASSERT(kMaximumInFlightBytes > 0, would_send_at_zero_rate); | 224 static_assert(kMaximumInFlightBytes > 0, "would send at zero rate"); |
| 225 std::fill_n(options_, static_cast<int> (P2P_SOCKET_OPT_MAX), | 225 std::fill_n(options_, static_cast<int> (P2P_SOCKET_OPT_MAX), |
| 226 kDefaultNonSetOptionValue); | 226 kDefaultNonSetOptionValue); |
| 227 } | 227 } |
| 228 | 228 |
| 229 IpcPacketSocket::~IpcPacketSocket() { | 229 IpcPacketSocket::~IpcPacketSocket() { |
| 230 if (state_ == IS_OPENING || state_ == IS_OPEN || | 230 if (state_ == IS_OPENING || state_ == IS_OPEN || |
| 231 state_ == IS_ERROR) { | 231 state_ == IS_ERROR) { |
| 232 Close(); | 232 Close(); |
| 233 } | 233 } |
| 234 | 234 |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 } | 755 } |
| 756 | 756 |
| 757 rtc::AsyncResolverInterface* | 757 rtc::AsyncResolverInterface* |
| 758 IpcPacketSocketFactory::CreateAsyncResolver() { | 758 IpcPacketSocketFactory::CreateAsyncResolver() { |
| 759 scoped_ptr<AsyncAddressResolverImpl> resolver( | 759 scoped_ptr<AsyncAddressResolverImpl> resolver( |
| 760 new AsyncAddressResolverImpl(socket_dispatcher_)); | 760 new AsyncAddressResolverImpl(socket_dispatcher_)); |
| 761 return resolver.release(); | 761 return resolver.release(); |
| 762 } | 762 } |
| 763 | 763 |
| 764 } // namespace content | 764 } // namespace content |
| OLD | NEW |