| 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 "net/quic/quic_reliable_client_stream.h" | 5 #include "net/quic/quic_reliable_client_stream.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 void QuicReliableClientStream::OnCanWrite() { | 65 void QuicReliableClientStream::OnCanWrite() { |
| 66 ReliableQuicStream::OnCanWrite(); | 66 ReliableQuicStream::OnCanWrite(); |
| 67 | 67 |
| 68 if (!HasBufferedData() && !callback_.is_null()) { | 68 if (!HasBufferedData() && !callback_.is_null()) { |
| 69 base::ResetAndReturn(&callback_).Run(OK); | 69 base::ResetAndReturn(&callback_).Run(OK); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 QuicPriority QuicReliableClientStream::Priority() const { | 73 SpdyPriority QuicReliableClientStream::Priority() const { |
| 74 if (delegate_ && delegate_->HasSendHeadersComplete()) { | 74 if (delegate_ && delegate_->HasSendHeadersComplete()) { |
| 75 return QuicSpdyStream::Priority(); | 75 return QuicSpdyStream::Priority(); |
| 76 } | 76 } |
| 77 return QuicWriteBlockedList::kHighestPriority; | 77 return net::kHighestPriority; |
| 78 } | 78 } |
| 79 | 79 |
| 80 int QuicReliableClientStream::WriteStreamData( | 80 int QuicReliableClientStream::WriteStreamData( |
| 81 base::StringPiece data, | 81 base::StringPiece data, |
| 82 bool fin, | 82 bool fin, |
| 83 const CompletionCallback& callback) { | 83 const CompletionCallback& callback) { |
| 84 // We should not have data buffered. | 84 // We should not have data buffered. |
| 85 DCHECK(!HasBufferedData()); | 85 DCHECK(!HasBufferedData()); |
| 86 // Writes the data, or buffers it. | 86 // Writes the data, or buffers it. |
| 87 WriteOrBufferData(data, fin, nullptr); | 87 WriteOrBufferData(data, fin, nullptr); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 base::Bind(&QuicReliableClientStream::NotifyDelegateOfDataAvailable, | 169 base::Bind(&QuicReliableClientStream::NotifyDelegateOfDataAvailable, |
| 170 weak_factory_.GetWeakPtr())); | 170 weak_factory_.GetWeakPtr())); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void QuicReliableClientStream::NotifyDelegateOfDataAvailable() { | 173 void QuicReliableClientStream::NotifyDelegateOfDataAvailable() { |
| 174 if (delegate_) | 174 if (delegate_) |
| 175 delegate_->OnDataAvailable(); | 175 delegate_->OnDataAvailable(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace net | 178 } // namespace net |
| OLD | NEW |