| 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_chromium_client_stream.h" | 5 #include "net/quic/quic_chromium_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/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 WriteOrBufferData(data, fin, nullptr); | 133 WriteOrBufferData(data, fin, nullptr); |
| 134 if (!HasBufferedData()) { | 134 if (!HasBufferedData()) { |
| 135 return OK; | 135 return OK; |
| 136 } | 136 } |
| 137 | 137 |
| 138 callback_ = callback; | 138 callback_ = callback; |
| 139 return ERR_IO_PENDING; | 139 return ERR_IO_PENDING; |
| 140 } | 140 } |
| 141 | 141 |
| 142 int QuicChromiumClientStream::WritevStreamData( | 142 int QuicChromiumClientStream::WritevStreamData( |
| 143 const std::vector<IOBuffer*>& buffers, | 143 const std::vector<scoped_refptr<IOBuffer>>& buffers, |
| 144 const std::vector<int>& lengths, | 144 const std::vector<int>& lengths, |
| 145 bool fin, | 145 bool fin, |
| 146 const CompletionCallback& callback) { | 146 const CompletionCallback& callback) { |
| 147 // Must not be called when data is buffered. | 147 // Must not be called when data is buffered. |
| 148 DCHECK(!HasBufferedData()); | 148 DCHECK(!HasBufferedData()); |
| 149 // Writes the data, or buffers it. | 149 // Writes the data, or buffers it. |
| 150 for (size_t i = 0; i < buffers.size(); ++i) { | 150 for (size_t i = 0; i < buffers.size(); ++i) { |
| 151 bool is_fin = fin && (i == buffers.size() - 1); | 151 bool is_fin = fin && (i == buffers.size() - 1); |
| 152 base::StringPiece string_data(buffers[i]->data(), lengths[i]); | 152 base::StringPiece string_data(buffers[i]->data(), lengths[i]); |
| 153 WriteOrBufferData(string_data, is_fin, nullptr); | 153 WriteOrBufferData(string_data, is_fin, nullptr); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 } else { | 252 } else { |
| 253 delegate_tasks_.push_back(closure); | 253 delegate_tasks_.push_back(closure); |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 | 256 |
| 257 void QuicChromiumClientStream::DisableConnectionMigration() { | 257 void QuicChromiumClientStream::DisableConnectionMigration() { |
| 258 can_migrate_ = false; | 258 can_migrate_ = false; |
| 259 } | 259 } |
| 260 | 260 |
| 261 } // namespace net | 261 } // namespace net |
| OLD | NEW |