| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/spdy_utils.h" | 5 #include "net/quic/spdy_utils.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "net/spdy/spdy_frame_builder.h" | 8 #include "net/spdy/spdy_frame_builder.h" |
| 9 #include "net/spdy/spdy_framer.h" | 9 #include "net/spdy/spdy_framer.h" |
| 10 #include "net/spdy/spdy_protocol.h" | 10 #include "net/spdy/spdy_protocol.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 response_headers[":status"].erase(end_of_code); | 32 response_headers[":status"].erase(end_of_code); |
| 33 } | 33 } |
| 34 return response_headers; | 34 return response_headers; |
| 35 } | 35 } |
| 36 | 36 |
| 37 // static | 37 // static |
| 38 string SpdyUtils::SerializeUncompressedHeaders(const SpdyHeaderBlock& headers, | 38 string SpdyUtils::SerializeUncompressedHeaders(const SpdyHeaderBlock& headers, |
| 39 QuicVersion quic_version) { | 39 QuicVersion quic_version) { |
| 40 SpdyMajorVersion spdy_version = GetSpdyVersionForQuicVersion(quic_version); | 40 SpdyMajorVersion spdy_version = GetSpdyVersionForQuicVersion(quic_version); |
| 41 | 41 |
| 42 int length = SpdyFramer::GetSerializedLength(spdy_version, &headers); | 42 size_t length = SpdyFramer::GetSerializedLength(spdy_version, &headers); |
| 43 SpdyFrameBuilder builder(length, spdy_version); | 43 SpdyFrameBuilder builder(length, spdy_version); |
| 44 SpdyFramer::WriteHeaderBlock(&builder, spdy_version, &headers); | 44 SpdyFramer::WriteHeaderBlock(&builder, spdy_version, &headers); |
| 45 scoped_ptr<SpdyFrame> block(builder.take()); | 45 scoped_ptr<SpdyFrame> block(builder.take()); |
| 46 return string(block->data(), length); | 46 return string(block->data(), length); |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace net | 49 } // namespace net |
| OLD | NEW |