OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_ | 5 #ifndef NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_ |
6 #define NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_ | 6 #define NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_ |
7 | 7 |
8 #include <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "base/port.h" | |
11 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
12 | 11 |
13 namespace net { | 12 namespace net { |
14 | 13 |
15 #if defined(COMPILER_MSVC) | 14 #if defined(COMPILER_MSVC) |
16 struct StringPieceCaseCompare { | 15 struct StringPieceCaseCompare { |
17 static const size_t bucket_size = 4; | 16 static const size_t bucket_size = 4; |
18 | 17 |
19 size_t operator()(const base::StringPiece& sp) const { | 18 size_t operator()(const base::StringPiece& sp) const { |
20 // based on __stl_string_hash in http://www.sgi.com/tech/stl/string | 19 // based on __stl_string_hash in http://www.sgi.com/tech/stl/string |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return StringPieceUtils::EqualIgnoreCase(piece1, piece2); | 102 return StringPieceUtils::EqualIgnoreCase(piece1, piece2); |
104 } | 103 } |
105 }; | 104 }; |
106 | 105 |
107 | 106 |
108 | 107 |
109 } // namespace net | 108 } // namespace net |
110 | 109 |
111 #endif // NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_ | 110 #endif // NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_ |
112 | 111 |
OLD | NEW |