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 // This command-line program converts an effective-TLD data file in UTF-8 from | 5 // This command-line program converts an effective-TLD data file in UTF-8 from |
6 // the format provided by Mozilla to the format expected by Chrome. This | 6 // the format provided by Mozilla to the format expected by Chrome. This |
7 // program generates an intermediate file which is then used by gperf to | 7 // program generates an intermediate file which is then used by gperf to |
8 // generate a perfect hash map. The benefit of this approach is that no time is | 8 // generate a perfect hash map. The benefit of this approach is that no time is |
9 // spent on program initialization to generate the map of this data. | 9 // spent on program initialization to generate the map of this data. |
10 // | 10 // |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 logging::LOCK_LOG_FILE, | 289 logging::LOCK_LOG_FILE, |
290 logging::DELETE_OLD_LOG_FILE, | 290 logging::DELETE_OLD_LOG_FILE, |
291 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 291 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
292 | 292 |
293 icu_util::Initialize(); | 293 icu_util::Initialize(); |
294 | 294 |
295 FilePath input_file; | 295 FilePath input_file; |
296 PathService::Get(base::DIR_SOURCE_ROOT, &input_file); | 296 PathService::Get(base::DIR_SOURCE_ROOT, &input_file); |
297 input_file = input_file.Append(FILE_PATH_LITERAL("net")) | 297 input_file = input_file.Append(FILE_PATH_LITERAL("net")) |
298 .Append(FILE_PATH_LITERAL("base")) | 298 .Append(FILE_PATH_LITERAL("base")) |
| 299 .Append(FILE_PATH_LITERAL( |
| 300 "registry_controlled_domains")) |
299 .Append(FILE_PATH_LITERAL("effective_tld_names.dat")); | 301 .Append(FILE_PATH_LITERAL("effective_tld_names.dat")); |
300 FilePath output_file; | 302 FilePath output_file; |
301 PathService::Get(base::DIR_SOURCE_ROOT, &output_file); | 303 PathService::Get(base::DIR_SOURCE_ROOT, &output_file); |
302 output_file = output_file.Append(FILE_PATH_LITERAL("net")) | 304 output_file = output_file.Append(FILE_PATH_LITERAL("net")) |
303 .Append(FILE_PATH_LITERAL("base")) | 305 .Append(FILE_PATH_LITERAL("base")) |
304 .Append(FILE_PATH_LITERAL( | 306 .Append(FILE_PATH_LITERAL( |
| 307 "registry_controlled_domains")) |
| 308 .Append(FILE_PATH_LITERAL( |
305 "effective_tld_names.gperf")); | 309 "effective_tld_names.gperf")); |
306 NormalizeResult result = NormalizeFile(input_file, output_file); | 310 NormalizeResult result = NormalizeFile(input_file, output_file); |
307 if (result != kSuccess) { | 311 if (result != kSuccess) { |
308 fprintf(stderr, | 312 fprintf(stderr, |
309 "Errors or warnings processing file. See log in tld_cleanup.log."); | 313 "Errors or warnings processing file. See log in tld_cleanup.log."); |
310 } | 314 } |
311 | 315 |
312 if (result == kError) | 316 if (result == kError) |
313 return 1; | 317 return 1; |
314 return 0; | 318 return 0; |
315 } | 319 } |
OLD | NEW |