| 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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 ++it) { | 857 ++it) { |
| 858 settings_ir.AddSetting( | 858 settings_ir.AddSetting( |
| 859 it->first, | 859 it->first, |
| 860 (it->second.first & SETTINGS_FLAG_PLEASE_PERSIST) != 0, | 860 (it->second.first & SETTINGS_FLAG_PLEASE_PERSIST) != 0, |
| 861 (it->second.first & SETTINGS_FLAG_PERSISTED) != 0, | 861 (it->second.first & SETTINGS_FLAG_PERSISTED) != 0, |
| 862 it->second.second); | 862 it->second.second); |
| 863 } | 863 } |
| 864 return CreateFramer(false)->SerializeFrame(settings_ir); | 864 return CreateFramer(false)->SerializeFrame(settings_ir); |
| 865 } | 865 } |
| 866 | 866 |
| 867 SpdyFrame* SpdyTestUtil::ConstructSpdySettingsAck() const { |
| 868 char kEmptyWrite[] = ""; |
| 869 |
| 870 if (spdy_version() > SPDY3) { |
| 871 SpdySettingsIR settings_ir; |
| 872 settings_ir.set_is_ack(true); |
| 873 return CreateFramer(false)->SerializeFrame(settings_ir); |
| 874 } |
| 875 // No settings ACK write occurs. Create an empty placeholder write. |
| 876 return new SpdyFrame(kEmptyWrite, 0, false); |
| 877 } |
| 878 |
| 867 SpdyFrame* SpdyTestUtil::ConstructSpdyPing(uint32 ping_id, bool is_ack) const { | 879 SpdyFrame* SpdyTestUtil::ConstructSpdyPing(uint32 ping_id, bool is_ack) const { |
| 868 SpdyPingIR ping_ir(ping_id); | 880 SpdyPingIR ping_ir(ping_id); |
| 869 ping_ir.set_is_ack(is_ack); | 881 ping_ir.set_is_ack(is_ack); |
| 870 return CreateFramer(false)->SerializeFrame(ping_ir); | 882 return CreateFramer(false)->SerializeFrame(ping_ir); |
| 871 } | 883 } |
| 872 | 884 |
| 873 SpdyFrame* SpdyTestUtil::ConstructSpdyGoAway() const { | 885 SpdyFrame* SpdyTestUtil::ConstructSpdyGoAway() const { |
| 874 return ConstructSpdyGoAway(0); | 886 return ConstructSpdyGoAway(0); |
| 875 } | 887 } |
| 876 | 888 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1208 } | 1220 } |
| 1209 } | 1221 } |
| 1210 | 1222 |
| 1211 void SpdyTestUtil::SetPriority(RequestPriority priority, | 1223 void SpdyTestUtil::SetPriority(RequestPriority priority, |
| 1212 SpdySynStreamIR* ir) const { | 1224 SpdySynStreamIR* ir) const { |
| 1213 ir->set_priority(ConvertRequestPriorityToSpdyPriority( | 1225 ir->set_priority(ConvertRequestPriorityToSpdyPriority( |
| 1214 priority, spdy_version())); | 1226 priority, spdy_version())); |
| 1215 } | 1227 } |
| 1216 | 1228 |
| 1217 } // namespace net | 1229 } // namespace net |
| OLD | NEW |