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/spdy/spdy_header_block.h" | 5 #include "net/spdy/spdy_header_block.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 lookup_result_->second = | 211 lookup_result_->second = |
212 HeaderValue(storage_, key_, storage_->Write(value)); | 212 HeaderValue(storage_, key_, storage_->Write(value)); |
213 } | 213 } |
214 return *this; | 214 return *this; |
215 } | 215 } |
216 | 216 |
217 string SpdyHeaderBlock::ValueProxy::as_string() const { | 217 string SpdyHeaderBlock::ValueProxy::as_string() const { |
218 if (lookup_result_ == block_->end()) { | 218 if (lookup_result_ == block_->end()) { |
219 return ""; | 219 return ""; |
220 } else { | 220 } else { |
221 return lookup_result_->second.value().as_string(); | 221 return std::string(lookup_result_->second.value()); |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 SpdyHeaderBlock::SpdyHeaderBlock() : block_(kInitialMapBuckets) {} | 225 SpdyHeaderBlock::SpdyHeaderBlock() : block_(kInitialMapBuckets) {} |
226 | 226 |
227 SpdyHeaderBlock::SpdyHeaderBlock(SpdyHeaderBlock&& other) = default; | 227 SpdyHeaderBlock::SpdyHeaderBlock(SpdyHeaderBlock&& other) = default; |
228 | 228 |
229 SpdyHeaderBlock::~SpdyHeaderBlock() {} | 229 SpdyHeaderBlock::~SpdyHeaderBlock() {} |
230 | 230 |
231 SpdyHeaderBlock& SpdyHeaderBlock::operator=(SpdyHeaderBlock&& other) { | 231 SpdyHeaderBlock& SpdyHeaderBlock::operator=(SpdyHeaderBlock&& other) { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 for (++it; it != fragments.end(); ++it) { | 397 for (++it; it != fragments.end(); ++it) { |
398 memcpy(dst, separator.data(), separator.size()); | 398 memcpy(dst, separator.data(), separator.size()); |
399 dst += separator.size(); | 399 dst += separator.size(); |
400 memcpy(dst, it->data(), it->size()); | 400 memcpy(dst, it->data(), it->size()); |
401 dst += it->size(); | 401 dst += it->size(); |
402 } | 402 } |
403 return dst - original_dst; | 403 return dst - original_dst; |
404 } | 404 } |
405 | 405 |
406 } // namespace net | 406 } // namespace net |
OLD | NEW |