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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 base::AtExitManager exit_manager; | 46 base::AtExitManager exit_manager; |
47 | 47 |
48 // Only use OutputDebugString in debug mode. | 48 // Only use OutputDebugString in debug mode. |
49 #ifdef NDEBUG | 49 #ifdef NDEBUG |
50 logging::LoggingDestination destination = logging::LOG_TO_FILE; | 50 logging::LoggingDestination destination = logging::LOG_TO_FILE; |
51 #else | 51 #else |
52 logging::LoggingDestination destination = | 52 logging::LoggingDestination destination = |
53 logging::LOG_TO_ALL; | 53 logging::LOG_TO_ALL; |
54 #endif | 54 #endif |
55 | 55 |
56 CommandLine::Init(argc, argv); | 56 base::CommandLine::Init(argc, argv); |
57 | 57 |
58 base::FilePath log_filename; | 58 base::FilePath log_filename; |
59 PathService::Get(base::DIR_EXE, &log_filename); | 59 PathService::Get(base::DIR_EXE, &log_filename); |
60 log_filename = log_filename.AppendASCII("tld_cleanup.log"); | 60 log_filename = log_filename.AppendASCII("tld_cleanup.log"); |
61 logging::LoggingSettings settings; | 61 logging::LoggingSettings settings; |
62 settings.logging_dest = destination; | 62 settings.logging_dest = destination; |
63 settings.log_file = log_filename.value().c_str(); | 63 settings.log_file = log_filename.value().c_str(); |
64 settings.delete_old = logging::DELETE_OLD_LOG_FILE; | 64 settings.delete_old = logging::DELETE_OLD_LOG_FILE; |
65 logging::InitLogging(settings); | 65 logging::InitLogging(settings); |
66 | 66 |
(...skipping 18 matching lines...) Expand all Loading... |
85 net::tld_cleanup::NormalizeFile(input_file, output_file); | 85 net::tld_cleanup::NormalizeFile(input_file, output_file); |
86 if (result != net::tld_cleanup::kSuccess) { | 86 if (result != net::tld_cleanup::kSuccess) { |
87 fprintf(stderr, | 87 fprintf(stderr, |
88 "Errors or warnings processing file. See log in tld_cleanup.log."); | 88 "Errors or warnings processing file. See log in tld_cleanup.log."); |
89 } | 89 } |
90 | 90 |
91 if (result == net::tld_cleanup::kError) | 91 if (result == net::tld_cleanup::kError) |
92 return 1; | 92 return 1; |
93 return 0; | 93 return 0; |
94 } | 94 } |
OLD | NEW |