| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 static const char charsetString[] = "charset"; | 55 static const char charsetString[] = "charset"; |
| 56 static const size_t charsetLength = sizeof("charset") - 1; | 56 static const size_t charsetLength = sizeof("charset") - 1; |
| 57 | 57 |
| 58 String HTMLMetaCharsetParser::extractCharset(const String& value) | 58 String HTMLMetaCharsetParser::extractCharset(const String& value) |
| 59 { | 59 { |
| 60 size_t pos = 0; | 60 size_t pos = 0; |
| 61 unsigned length = value.length(); | 61 unsigned length = value.length(); |
| 62 | 62 |
| 63 while (pos < length) { | 63 while (pos < length) { |
| 64 pos = value.find(charsetString, pos, false); | 64 pos = value.find(charsetString, pos, false); |
| 65 if (pos == notFound) | 65 if (pos == kNotFound) |
| 66 break; | 66 break; |
| 67 | 67 |
| 68 pos += charsetLength; | 68 pos += charsetLength; |
| 69 | 69 |
| 70 // Skip whitespace. | 70 // Skip whitespace. |
| 71 while (pos < length && value[pos] <= ' ') | 71 while (pos < length && value[pos] <= ' ') |
| 72 ++pos; | 72 ++pos; |
| 73 | 73 |
| 74 if (value[pos] != '=') | 74 if (value[pos] != '=') |
| 75 continue; | 75 continue; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 return true; | 201 return true; |
| 202 } | 202 } |
| 203 | 203 |
| 204 m_token.clear(); | 204 m_token.clear(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 return false; | 207 return false; |
| 208 } | 208 } |
| 209 | 209 |
| 210 } | 210 } |
| OLD | NEW |