OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // A library to manage RLZ information for access-points shared | 5 // A library to manage RLZ information for access-points shared |
6 // across different client applications. | 6 // across different client applications. |
7 | 7 |
8 #include "rlz/lib/rlz_lib.h" | 8 #include "rlz/lib/rlz_lib.h" |
9 | 9 |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 default: | 52 default: |
53 return true; | 53 return true; |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 // Current RLZ can only use [a-zA-Z0-9_\-] | 57 // Current RLZ can only use [a-zA-Z0-9_\-] |
58 // We will be more liberal and allow some additional chars, but not url meta | 58 // We will be more liberal and allow some additional chars, but not url meta |
59 // chars. | 59 // chars. |
60 bool IsGoodRlzChar(const char ch) { | 60 bool IsGoodRlzChar(const char ch) { |
61 if (IsAsciiAlpha(ch) || IsAsciiDigit(ch)) | 61 if (base::IsAsciiAlpha(ch) || base::IsAsciiDigit(ch)) |
62 return true; | 62 return true; |
63 | 63 |
64 switch (ch) { | 64 switch (ch) { |
65 case '_': | 65 case '_': |
66 case '-': | 66 case '-': |
67 case '!': | 67 case '!': |
68 case '@': | 68 case '@': |
69 case '$': | 69 case '$': |
70 case '*': | 70 case '*': |
71 case '(': | 71 case '(': |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 if (cgi_string.size() >= cgi_size) | 644 if (cgi_string.size() >= cgi_size) |
645 return false; | 645 return false; |
646 | 646 |
647 strncpy(cgi, cgi_string.c_str(), cgi_size); | 647 strncpy(cgi, cgi_string.c_str(), cgi_size); |
648 cgi[cgi_size - 1] = 0; | 648 cgi[cgi_size - 1] = 0; |
649 | 649 |
650 return true; | 650 return true; |
651 } | 651 } |
652 | 652 |
653 } // namespace rlz_lib | 653 } // namespace rlz_lib |
OLD | NEW |