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 <list> | 8 #include <list> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 : type_(P2P_SOCKET_UDP), | 231 : type_(P2P_SOCKET_UDP), |
232 message_loop_(base::MessageLoop::current()), | 232 message_loop_(base::MessageLoop::current()), |
233 state_(IS_UNINITIALIZED), | 233 state_(IS_UNINITIALIZED), |
234 send_bytes_available_(kMaximumInFlightBytes), | 234 send_bytes_available_(kMaximumInFlightBytes), |
235 writable_signal_expected_(false), | 235 writable_signal_expected_(false), |
236 error_(0), | 236 error_(0), |
237 max_discard_bytes_sequence_(0), | 237 max_discard_bytes_sequence_(0), |
238 current_discard_bytes_sequence_(0), | 238 current_discard_bytes_sequence_(0), |
239 packets_discarded_(0), | 239 packets_discarded_(0), |
240 total_packets_(0) { | 240 total_packets_(0) { |
241 COMPILE_ASSERT(kMaximumInFlightBytes > 0, would_send_at_zero_rate); | 241 static_assert(kMaximumInFlightBytes > 0, "would send at zero rate"); |
242 std::fill_n(options_, static_cast<int> (P2P_SOCKET_OPT_MAX), | 242 std::fill_n(options_, static_cast<int> (P2P_SOCKET_OPT_MAX), |
243 kDefaultNonSetOptionValue); | 243 kDefaultNonSetOptionValue); |
244 } | 244 } |
245 | 245 |
246 IpcPacketSocket::~IpcPacketSocket() { | 246 IpcPacketSocket::~IpcPacketSocket() { |
247 if (state_ == IS_OPENING || state_ == IS_OPEN || | 247 if (state_ == IS_OPENING || state_ == IS_OPEN || |
248 state_ == IS_ERROR) { | 248 state_ == IS_ERROR) { |
249 Close(); | 249 Close(); |
250 } | 250 } |
251 | 251 |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 } | 784 } |
785 | 785 |
786 rtc::AsyncResolverInterface* | 786 rtc::AsyncResolverInterface* |
787 IpcPacketSocketFactory::CreateAsyncResolver() { | 787 IpcPacketSocketFactory::CreateAsyncResolver() { |
788 scoped_ptr<AsyncAddressResolverImpl> resolver( | 788 scoped_ptr<AsyncAddressResolverImpl> resolver( |
789 new AsyncAddressResolverImpl(socket_dispatcher_)); | 789 new AsyncAddressResolverImpl(socket_dispatcher_)); |
790 return resolver.release(); | 790 return resolver.release(); |
791 } | 791 } |
792 | 792 |
793 } // namespace content | 793 } // namespace content |
OLD | NEW |