| 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/spdy/spdy_test_util_common.h" | 5 #include "net/spdy/spdy_test_util_common.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 SpdyPriority priority() const { | 209 SpdyPriority priority() const { |
| 210 return priority_; | 210 return priority_; |
| 211 } | 211 } |
| 212 | 212 |
| 213 virtual void OnError(SpdyFramer::SpdyError error_code) OVERRIDE {} | 213 virtual void OnError(SpdyFramer::SpdyError error_code) OVERRIDE {} |
| 214 virtual void OnStreamError(SpdyStreamId stream_id, | 214 virtual void OnStreamError(SpdyStreamId stream_id, |
| 215 const std::string& description) OVERRIDE {} | 215 const std::string& description) OVERRIDE {} |
| 216 virtual void OnSynStream(SpdyStreamId stream_id, | 216 virtual void OnSynStream(SpdyStreamId stream_id, |
| 217 SpdyStreamId associated_stream_id, | 217 SpdyStreamId associated_stream_id, |
| 218 SpdyPriority priority, | 218 SpdyPriority priority, |
| 219 uint8 credential_slot, | |
| 220 bool fin, | 219 bool fin, |
| 221 bool unidirectional, | 220 bool unidirectional, |
| 222 const SpdyHeaderBlock& headers) OVERRIDE { | 221 const SpdyHeaderBlock& headers) OVERRIDE { |
| 223 priority_ = priority; | 222 priority_ = priority; |
| 224 } | 223 } |
| 225 virtual void OnSynReply(SpdyStreamId stream_id, | 224 virtual void OnSynReply(SpdyStreamId stream_id, |
| 226 bool fin, | 225 bool fin, |
| 227 const SpdyHeaderBlock& headers) OVERRIDE {} | 226 const SpdyHeaderBlock& headers) OVERRIDE {} |
| 228 virtual void OnHeaders(SpdyStreamId stream_id, | 227 virtual void OnHeaders(SpdyStreamId stream_id, |
| 229 bool fin, | 228 bool fin, |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 BufferedSpdyFramer framer(spdy_version_, header_info.compressed); | 742 BufferedSpdyFramer framer(spdy_version_, header_info.compressed); |
| 744 SpdyFrame* frame = NULL; | 743 SpdyFrame* frame = NULL; |
| 745 switch (header_info.kind) { | 744 switch (header_info.kind) { |
| 746 case DATA: | 745 case DATA: |
| 747 frame = framer.CreateDataFrame(header_info.id, header_info.data, | 746 frame = framer.CreateDataFrame(header_info.id, header_info.data, |
| 748 header_info.data_length, | 747 header_info.data_length, |
| 749 header_info.data_flags); | 748 header_info.data_flags); |
| 750 break; | 749 break; |
| 751 case SYN_STREAM: | 750 case SYN_STREAM: |
| 752 { | 751 { |
| 753 size_t credential_slot = is_spdy2() ? 0 : header_info.credential_slot; | |
| 754 frame = framer.CreateSynStream(header_info.id, header_info.assoc_id, | 752 frame = framer.CreateSynStream(header_info.id, header_info.assoc_id, |
| 755 header_info.priority, | 753 header_info.priority, |
| 756 credential_slot, | |
| 757 header_info.control_flags, | 754 header_info.control_flags, |
| 758 headers.get()); | 755 headers.get()); |
| 759 } | 756 } |
| 760 break; | 757 break; |
| 761 case SYN_REPLY: | 758 case SYN_REPLY: |
| 762 frame = framer.CreateSynReply(header_info.id, header_info.control_flags, | 759 frame = framer.CreateSynReply(header_info.id, header_info.control_flags, |
| 763 headers.get()); | 760 headers.get()); |
| 764 break; | 761 break; |
| 765 case RST_STREAM: | 762 case RST_STREAM: |
| 766 frame = framer.CreateRstStream(header_info.id, header_info.status); | 763 frame = framer.CreateRstStream(header_info.id, header_info.status); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 (*headers)[GetSchemeKey()] = scheme.c_str(); | 1236 (*headers)[GetSchemeKey()] = scheme.c_str(); |
| 1240 (*headers)[GetVersionKey()] = "HTTP/1.1"; | 1237 (*headers)[GetVersionKey()] = "HTTP/1.1"; |
| 1241 if (content_length) { | 1238 if (content_length) { |
| 1242 std::string length_str = base::Int64ToString(*content_length); | 1239 std::string length_str = base::Int64ToString(*content_length); |
| 1243 (*headers)["content-length"] = length_str; | 1240 (*headers)["content-length"] = length_str; |
| 1244 } | 1241 } |
| 1245 return headers.Pass(); | 1242 return headers.Pass(); |
| 1246 } | 1243 } |
| 1247 | 1244 |
| 1248 } // namespace net | 1245 } // namespace net |
| OLD | NEW |