OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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. Any errors | 6 // the format provided by Mozilla to the format expected by Chrome. Any errors |
7 // or warnings are recorded in tld_cleanup.log. | 7 // or warnings are recorded in tld_cleanup.log. |
8 // | 8 // |
9 // In particular, it | 9 // In particular, it |
10 // * Strips blank lines and comments, as well as notes for individual rules. | 10 // * Strips blank lines and comments, as well as notes for individual rules. |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 logging::LoggingDestination destination = logging::LOG_ONLY_TO_FILE; | 205 logging::LoggingDestination destination = logging::LOG_ONLY_TO_FILE; |
206 #else | 206 #else |
207 logging::LoggingDestination destination = | 207 logging::LoggingDestination destination = |
208 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG; | 208 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG; |
209 #endif | 209 #endif |
210 | 210 |
211 CommandLine::Init(argc, argv); | 211 CommandLine::Init(argc, argv); |
212 | 212 |
213 FilePath log_filename; | 213 FilePath log_filename; |
214 PathService::Get(base::DIR_EXE, &log_filename); | 214 PathService::Get(base::DIR_EXE, &log_filename); |
215 log_filename = log_filename.Append(FILE_PATH_LITERAL("tld_cleanup.log")); | 215 log_filename = log_filename.AppendASCII("tld_cleanup.log"); |
216 logging::InitLogging(log_filename.value().c_str(), | 216 logging::InitLogging(log_filename.value().c_str(), |
217 destination, | 217 destination, |
218 logging::LOCK_LOG_FILE, | 218 logging::LOCK_LOG_FILE, |
219 logging::DELETE_OLD_LOG_FILE); | 219 logging::DELETE_OLD_LOG_FILE); |
220 | 220 |
221 icu_util::Initialize(); | 221 icu_util::Initialize(); |
222 | 222 |
223 NormalizeResult result = NormalizeFile(UTF8ToWide(argv[1]), | 223 NormalizeResult result = NormalizeFile(UTF8ToWide(argv[1]), |
224 UTF8ToWide(argv[2])); | 224 UTF8ToWide(argv[2])); |
225 if (result != kSuccess) { | 225 if (result != kSuccess) { |
226 fprintf(stderr, | 226 fprintf(stderr, |
227 "Errors or warnings processing file. See log in tld_cleanup.log."); | 227 "Errors or warnings processing file. See log in tld_cleanup.log."); |
228 } | 228 } |
229 | 229 |
230 if (result == kError) | 230 if (result == kError) |
231 return 1; | 231 return 1; |
232 return 0; | 232 return 0; |
233 } | 233 } |
OLD | NEW |