OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/tools/flip_server/balsa_headers.h" | 5 #include "net/tools/flip_server/balsa_headers.h" |
6 | 6 |
7 #include <emmintrin.h> | 7 #include <emmintrin.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <ext/hash_set> | 10 #include <ext/hash_set> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 REGISTER_MODULE_INITIALIZER(multivalued_headers, InitMultivaluedHeaders()); | 64 REGISTER_MODULE_INITIALIZER(multivalued_headers, InitMultivaluedHeaders()); |
65 | 65 |
66 const int kFastToBufferSize = 32; // I think 22 is adequate, but anyway.. | 66 const int kFastToBufferSize = 32; // I think 22 is adequate, but anyway.. |
67 | 67 |
68 } // namespace | 68 } // namespace |
69 | 69 |
70 namespace net { | 70 namespace net { |
71 | 71 |
72 const size_t BalsaBuffer::kDefaultBlocksize; | 72 const size_t BalsaBuffer::kDefaultBlocksize; |
73 | 73 |
| 74 std::ostream& BalsaHeaders::iterator_base::operator<<(std::ostream& os, |
| 75 const iterator_base& it) { |
| 76 os << "[" << it.headers_ << ", " << it.idx_ << "]"; |
| 77 return os; |
| 78 } |
| 79 |
74 void BalsaHeaders::Clear() { | 80 void BalsaHeaders::Clear() { |
75 balsa_buffer_.Clear(); | 81 balsa_buffer_.Clear(); |
76 transfer_encoding_is_chunked_ = false; | 82 transfer_encoding_is_chunked_ = false; |
77 content_length_ = 0; | 83 content_length_ = 0; |
78 content_length_status_ = BalsaHeadersEnums::NO_CONTENT_LENGTH; | 84 content_length_status_ = BalsaHeadersEnums::NO_CONTENT_LENGTH; |
79 parsed_response_code_ = 0; | 85 parsed_response_code_ = 0; |
80 firstline_buffer_base_idx_ = 0; | 86 firstline_buffer_base_idx_ = 0; |
81 whitespace_1_idx_ = 0; | 87 whitespace_1_idx_ = 0; |
82 non_whitespace_1_idx_ = 0; | 88 non_whitespace_1_idx_ = 0; |
83 whitespace_2_idx_ = 0; | 89 whitespace_2_idx_ = 0; |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 | 755 |
750 void BalsaHeaders::SetResponseReasonPhrase(const base::StringPiece& reason) { | 756 void BalsaHeaders::SetResponseReasonPhrase(const base::StringPiece& reason) { |
751 // Note: There is no difference between request_version() and | 757 // Note: There is no difference between request_version() and |
752 // response_reason_phrase(). Thus, a function to set one is equivalent to a | 758 // response_reason_phrase(). Thus, a function to set one is equivalent to a |
753 // function to set the other. We maintain two functions for this as it is | 759 // function to set the other. We maintain two functions for this as it is |
754 // much more descriptive, and makes code more understandable. | 760 // much more descriptive, and makes code more understandable. |
755 SetRequestVersion(reason); | 761 SetRequestVersion(reason); |
756 } | 762 } |
757 | 763 |
758 } // namespace net | 764 } // namespace net |
OLD | NEW |