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_websocket_test_util.h" | 5 #include "net/spdy/spdy_websocket_test_util.h" |
6 | 6 |
7 #include "net/spdy/buffered_spdy_framer.h" | 7 #include "net/spdy/buffered_spdy_framer.h" |
8 #include "net/spdy/spdy_http_utils.h" | 8 #include "net/spdy/spdy_http_utils.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
11 | 11 |
12 static const int kDefaultAssociatedStreamId = 0; | 12 const int kDefaultAssociatedStreamId = 0; |
13 static const bool kDefaultCompressed = false; | 13 const bool kDefaultCompressed = false; |
14 static const char* const kDefaultDataPointer = NULL; | 14 const char* const kDefaultDataPointer = NULL; |
15 static const uint32 kDefaultDataLength = 0; | 15 const uint32 kDefaultDataLength = 0; |
16 static const char** const kDefaultExtraHeaders = NULL; | |
17 static const int kDefaultExtraHeaderCount = 0; | |
18 | 16 |
19 SpdyWebSocketTestUtil::SpdyWebSocketTestUtil( | 17 SpdyWebSocketTestUtil::SpdyWebSocketTestUtil( |
20 NextProto protocol) : spdy_util_(protocol) {} | 18 NextProto protocol) : spdy_util_(protocol) {} |
21 | 19 |
22 std::string SpdyWebSocketTestUtil::GetHeader(const SpdyHeaderBlock& headers, | 20 std::string SpdyWebSocketTestUtil::GetHeader(const SpdyHeaderBlock& headers, |
23 const std::string& key) const { | 21 const std::string& key) const { |
24 SpdyHeaderBlock::const_iterator it = headers.find(GetHeaderKey(key)); | 22 SpdyHeaderBlock::const_iterator it = headers.find(GetHeaderKey(key)); |
25 return (it == headers.end()) ? "" : it->second; | 23 return (it == headers.end()) ? "" : it->second; |
26 } | 24 } |
27 | 25 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 SpdyMajorVersion SpdyWebSocketTestUtil::spdy_version() const { | 153 SpdyMajorVersion SpdyWebSocketTestUtil::spdy_version() const { |
156 return spdy_util_.spdy_version(); | 154 return spdy_util_.spdy_version(); |
157 } | 155 } |
158 | 156 |
159 std::string SpdyWebSocketTestUtil::GetHeaderKey( | 157 std::string SpdyWebSocketTestUtil::GetHeaderKey( |
160 const std::string& key) const { | 158 const std::string& key) const { |
161 return (spdy_util_.is_spdy2() ? "" : ":") + key; | 159 return (spdy_util_.is_spdy2() ? "" : ":") + key; |
162 } | 160 } |
163 | 161 |
164 } // namespace net | 162 } // namespace net |
OLD | NEW |