| 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/chromium/spdy_test_util_common.h" | 5 #include "net/spdy/chromium/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 <utility> | 10 #include <utility> |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 return false; | 232 return false; |
| 233 } | 233 } |
| 234 | 234 |
| 235 private: | 235 private: |
| 236 SpdyPriority priority_; | 236 SpdyPriority priority_; |
| 237 }; | 237 }; |
| 238 | 238 |
| 239 } // namespace | 239 } // namespace |
| 240 | 240 |
| 241 bool GetSpdyPriority(const SpdySerializedFrame& frame, SpdyPriority* priority) { | 241 bool GetSpdyPriority(const SpdySerializedFrame& frame, SpdyPriority* priority) { |
| 242 BufferedSpdyFramer framer; | 242 NetLogWithSource net_log; |
| 243 BufferedSpdyFramer framer(net_log); |
| 243 PriorityGetter priority_getter; | 244 PriorityGetter priority_getter; |
| 244 framer.set_visitor(&priority_getter); | 245 framer.set_visitor(&priority_getter); |
| 245 size_t frame_size = frame.size(); | 246 size_t frame_size = frame.size(); |
| 246 if (framer.ProcessInput(frame.data(), frame_size) != frame_size) { | 247 if (framer.ProcessInput(frame.data(), frame_size) != frame_size) { |
| 247 return false; | 248 return false; |
| 248 } | 249 } |
| 249 *priority = priority_getter.priority(); | 250 *priority = priority_getter.priority(); |
| 250 return true; | 251 return true; |
| 251 } | 252 } |
| 252 | 253 |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 headers[GetSchemeKey()] = scheme.c_str(); | 1159 headers[GetSchemeKey()] = scheme.c_str(); |
| 1159 headers[GetPathKey()] = path.c_str(); | 1160 headers[GetPathKey()] = path.c_str(); |
| 1160 if (content_length) { | 1161 if (content_length) { |
| 1161 SpdyString length_str = base::Int64ToString(*content_length); | 1162 SpdyString length_str = base::Int64ToString(*content_length); |
| 1162 headers["content-length"] = length_str; | 1163 headers["content-length"] = length_str; |
| 1163 } | 1164 } |
| 1164 return headers; | 1165 return headers; |
| 1165 } | 1166 } |
| 1166 | 1167 |
| 1167 } // namespace net | 1168 } // namespace net |
| OLD | NEW |