| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 error_ = EINVAL; | 289 error_ = EINVAL; |
| 290 return -1; | 290 return -1; |
| 291 } | 291 } |
| 292 | 292 |
| 293 send_bytes_available_ -= data_size; | 293 send_bytes_available_ -= data_size; |
| 294 in_flight_packet_sizes_.push_back(data_size); | 294 in_flight_packet_sizes_.push_back(data_size); |
| 295 TraceSendThrottlingState(); | 295 TraceSendThrottlingState(); |
| 296 | 296 |
| 297 const char* data_char = reinterpret_cast<const char*>(data); | 297 const char* data_char = reinterpret_cast<const char*>(data); |
| 298 std::vector<char> data_vector(data_char, data_char + data_size); | 298 std::vector<char> data_vector(data_char, data_char + data_size); |
| 299 client_->SendWithOptions(address_chrome, data_vector, options); | 299 client_->SendWithDscp(address_chrome, data_vector, |
| 300 static_cast<net::DiffServCodePoint>(options.dscp)); |
| 300 | 301 |
| 301 // Fake successful send. The caller ignores result anyway. | 302 // Fake successful send. The caller ignores result anyway. |
| 302 return data_size; | 303 return data_size; |
| 303 } | 304 } |
| 304 | 305 |
| 305 int IpcPacketSocket::Close() { | 306 int IpcPacketSocket::Close() { |
| 306 DCHECK_EQ(base::MessageLoop::current(), message_loop_); | 307 DCHECK_EQ(base::MessageLoop::current(), message_loop_); |
| 307 | 308 |
| 308 client_->Close(); | 309 client_->Close(); |
| 309 state_ = IS_CLOSED; | 310 state_ = IS_CLOSED; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 return NULL; | 532 return NULL; |
| 532 return socket.release(); | 533 return socket.release(); |
| 533 } | 534 } |
| 534 | 535 |
| 535 talk_base::AsyncResolverInterface* | 536 talk_base::AsyncResolverInterface* |
| 536 IpcPacketSocketFactory::CreateAsyncResolver() { | 537 IpcPacketSocketFactory::CreateAsyncResolver() { |
| 537 return new P2PAsyncAddressResolver(socket_dispatcher_); | 538 return new P2PAsyncAddressResolver(socket_dispatcher_); |
| 538 } | 539 } |
| 539 | 540 |
| 540 } // namespace content | 541 } // namespace content |
| OLD | NEW |