| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/protocol/pseudotcp_adapter.h" | 5 #include "remoting/protocol/pseudotcp_adapter.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // data to be sent to the remote end. | 99 // data to be sent to the remote end. |
| 100 bool waiting_write_position_; | 100 bool waiting_write_position_; |
| 101 | 101 |
| 102 // Number of the bytes written by the last write stored while we wait | 102 // Number of the bytes written by the last write stored while we wait |
| 103 // for the data to be sent (i.e. when waiting_write_position_ = true). | 103 // for the data to be sent (i.e. when waiting_write_position_ = true). |
| 104 int last_write_result_; | 104 int last_write_result_; |
| 105 | 105 |
| 106 bool socket_write_pending_; | 106 bool socket_write_pending_; |
| 107 scoped_refptr<net::IOBuffer> socket_read_buffer_; | 107 scoped_refptr<net::IOBuffer> socket_read_buffer_; |
| 108 | 108 |
| 109 base::OneShotTimer<Core> timer_; | 109 base::OneShotTimer timer_; |
| 110 | 110 |
| 111 DISALLOW_COPY_AND_ASSIGN(Core); | 111 DISALLOW_COPY_AND_ASSIGN(Core); |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 | 114 |
| 115 PseudoTcpAdapter::Core::Core(scoped_ptr<P2PDatagramSocket> socket) | 115 PseudoTcpAdapter::Core::Core(scoped_ptr<P2PDatagramSocket> socket) |
| 116 : pseudo_tcp_(this, 0), | 116 : pseudo_tcp_(this, 0), |
| 117 socket_(socket.Pass()), | 117 socket_(socket.Pass()), |
| 118 write_waits_for_send_(false), | 118 write_waits_for_send_(false), |
| 119 waiting_write_position_(false), | 119 waiting_write_position_(false), |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 core_->SetNoDelay(no_delay); | 498 core_->SetNoDelay(no_delay); |
| 499 } | 499 } |
| 500 | 500 |
| 501 void PseudoTcpAdapter::SetWriteWaitsForSend(bool write_waits_for_send) { | 501 void PseudoTcpAdapter::SetWriteWaitsForSend(bool write_waits_for_send) { |
| 502 DCHECK(CalledOnValidThread()); | 502 DCHECK(CalledOnValidThread()); |
| 503 core_->SetWriteWaitsForSend(write_waits_for_send); | 503 core_->SetWriteWaitsForSend(write_waits_for_send); |
| 504 } | 504 } |
| 505 | 505 |
| 506 } // namespace protocol | 506 } // namespace protocol |
| 507 } // namespace remoting | 507 } // namespace remoting |
| OLD | NEW |