Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2095)

Side by Side Diff: net/tools/balsa/string_piece_utils.h

Issue 2477703002: Remove now unused Balsa code. (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/tools/balsa/simple_buffer.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_
6 #define NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_
7
8 #include <stddef.h>
9
10 #include "base/strings/string_piece.h"
11 #include "base/strings/string_util.h"
12
13 namespace net {
14
15 struct StringPieceCaseHash {
16 size_t operator()(const base::StringPiece& sp) const {
17 // based on __stl_string_hash in http://www.sgi.com/tech/stl/string
18 size_t hash_val = 0;
19 for (base::StringPiece::const_iterator it = sp.begin();
20 it != sp.end(); ++it) {
21 hash_val = 5 * hash_val + base::ToLowerASCII(*it);
22 }
23 return hash_val;
24 }
25 };
26
27 struct StringPieceCaseEqual {
28 bool operator()(const base::StringPiece& piece1,
29 const base::StringPiece& piece2) const {
30 return base::EqualsCaseInsensitiveASCII(piece1, piece2);
31 }
32 };
33
34 } // namespace net
35
36 #endif // NET_TOOLS_BALSA_STRING_PIECE_UTILS_H_
37
OLDNEW
« no previous file with comments | « net/tools/balsa/simple_buffer.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698