| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
| 18 #include "net/base/host_port_pair.h" | 18 #include "net/base/host_port_pair.h" |
| 19 #include "net/cert/mock_cert_verifier.h" | 19 #include "net/cert/mock_cert_verifier.h" |
| 20 #include "net/http/http_cache.h" | 20 #include "net/http/http_cache.h" |
| 21 #include "net/http/http_network_session.h" | 21 #include "net/http/http_network_session.h" |
| 22 #include "net/http/http_network_transaction.h" | 22 #include "net/http/http_network_transaction.h" |
| 23 #include "net/http/http_server_properties_impl.h" | 23 #include "net/http/http_server_properties_impl.h" |
| 24 #include "net/socket/socket_test_util.h" | 24 #include "net/socket/socket_test_util.h" |
| 25 #include "net/socket/ssl_client_socket.h" | 25 #include "net/socket/ssl_client_socket.h" |
| 26 #include "net/socket/transport_client_socket_pool.h" | 26 #include "net/socket/transport_client_socket_pool.h" |
| 27 #include "net/spdy/buffered_spdy_framer.h" | 27 #include "net/spdy/buffered_spdy_framer.h" |
| 28 #include "net/spdy/spdy_alt_svc_wire_format.h" |
| 28 #include "net/spdy/spdy_framer.h" | 29 #include "net/spdy/spdy_framer.h" |
| 29 #include "net/spdy/spdy_http_utils.h" | 30 #include "net/spdy/spdy_http_utils.h" |
| 30 #include "net/spdy/spdy_session.h" | 31 #include "net/spdy/spdy_session.h" |
| 31 #include "net/spdy/spdy_session_pool.h" | 32 #include "net/spdy/spdy_session_pool.h" |
| 32 #include "net/spdy/spdy_stream.h" | 33 #include "net/spdy/spdy_stream.h" |
| 33 #include "net/url_request/url_request_job_factory_impl.h" | 34 #include "net/url_request/url_request_job_factory_impl.h" |
| 34 | 35 |
| 35 namespace net { | 36 namespace net { |
| 36 | 37 |
| 37 namespace { | 38 namespace { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 void OnPing(SpdyPingId unique_id, bool is_ack) override {} | 222 void OnPing(SpdyPingId unique_id, bool is_ack) override {} |
| 222 void OnRstStream(SpdyStreamId stream_id, | 223 void OnRstStream(SpdyStreamId stream_id, |
| 223 SpdyRstStreamStatus status) override {} | 224 SpdyRstStreamStatus status) override {} |
| 224 void OnGoAway(SpdyStreamId last_accepted_stream_id, | 225 void OnGoAway(SpdyStreamId last_accepted_stream_id, |
| 225 SpdyGoAwayStatus status, | 226 SpdyGoAwayStatus status, |
| 226 base::StringPiece debug_data) override {} | 227 base::StringPiece debug_data) override {} |
| 227 void OnWindowUpdate(SpdyStreamId stream_id, int delta_window_size) override {} | 228 void OnWindowUpdate(SpdyStreamId stream_id, int delta_window_size) override {} |
| 228 void OnPushPromise(SpdyStreamId stream_id, | 229 void OnPushPromise(SpdyStreamId stream_id, |
| 229 SpdyStreamId promised_stream_id, | 230 SpdyStreamId promised_stream_id, |
| 230 const SpdyHeaderBlock& headers) override {} | 231 const SpdyHeaderBlock& headers) override {} |
| 232 void OnAltSvc(SpdyStreamId stream_id, |
| 233 base::StringPiece origin, |
| 234 const SpdyAltSvcWireFormat::AlternativeServiceVector& |
| 235 altsvc_vector) override {} |
| 231 bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override { | 236 bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override { |
| 232 return false; | 237 return false; |
| 233 } | 238 } |
| 234 | 239 |
| 235 private: | 240 private: |
| 236 SpdyPriority priority_; | 241 SpdyPriority priority_; |
| 237 }; | 242 }; |
| 238 | 243 |
| 239 } // namespace | 244 } // namespace |
| 240 | 245 |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 return new SpdySerializedFrame(framer.SerializeData(data_ir)); | 1233 return new SpdySerializedFrame(framer.SerializeData(data_ir)); |
| 1229 } | 1234 } |
| 1230 | 1235 |
| 1231 SpdySerializedFrame* SpdyTestUtil::ConstructWrappedSpdyFrame( | 1236 SpdySerializedFrame* SpdyTestUtil::ConstructWrappedSpdyFrame( |
| 1232 const std::unique_ptr<SpdySerializedFrame>& frame, | 1237 const std::unique_ptr<SpdySerializedFrame>& frame, |
| 1233 int stream_id) { | 1238 int stream_id) { |
| 1234 return ConstructSpdyBodyFrame(stream_id, frame->data(), | 1239 return ConstructSpdyBodyFrame(stream_id, frame->data(), |
| 1235 frame->size(), false); | 1240 frame->size(), false); |
| 1236 } | 1241 } |
| 1237 | 1242 |
| 1243 SpdySerializedFrame SpdyTestUtil::SerializeFrame(const SpdyFrameIR& frame_ir) { |
| 1244 return headerless_spdy_framer_.SerializeFrame(frame_ir); |
| 1245 } |
| 1246 |
| 1238 void SpdyTestUtil::UpdateWithStreamDestruction(int stream_id) { | 1247 void SpdyTestUtil::UpdateWithStreamDestruction(int stream_id) { |
| 1239 for (auto priority_it = priority_to_stream_id_list_.begin(); | 1248 for (auto priority_it = priority_to_stream_id_list_.begin(); |
| 1240 priority_it != priority_to_stream_id_list_.end(); ++priority_it) { | 1249 priority_it != priority_to_stream_id_list_.end(); ++priority_it) { |
| 1241 for (auto stream_it = priority_it->second.begin(); | 1250 for (auto stream_it = priority_it->second.begin(); |
| 1242 stream_it != priority_it->second.end(); ++stream_it) { | 1251 stream_it != priority_it->second.end(); ++stream_it) { |
| 1243 if (*stream_it == stream_id) { | 1252 if (*stream_it == stream_id) { |
| 1244 priority_it->second.erase(stream_it); | 1253 priority_it->second.erase(stream_it); |
| 1245 return; | 1254 return; |
| 1246 } | 1255 } |
| 1247 } | 1256 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 } | 1319 } |
| 1311 } | 1320 } |
| 1312 | 1321 |
| 1313 void SpdyTestUtil::SetPriority(RequestPriority priority, | 1322 void SpdyTestUtil::SetPriority(RequestPriority priority, |
| 1314 SpdySynStreamIR* ir) const { | 1323 SpdySynStreamIR* ir) const { |
| 1315 ir->set_priority(ConvertRequestPriorityToSpdyPriority( | 1324 ir->set_priority(ConvertRequestPriorityToSpdyPriority( |
| 1316 priority, spdy_version())); | 1325 priority, spdy_version())); |
| 1317 } | 1326 } |
| 1318 | 1327 |
| 1319 } // namespace net | 1328 } // namespace net |
| OLD | NEW |