| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 base::AtExitManager exit_manager; | 201 base::AtExitManager exit_manager; |
| 202 | 202 |
| 203 // Only use OutputDebugString in debug mode. | 203 // Only use OutputDebugString in debug mode. |
| 204 #ifdef NDEBUG | 204 #ifdef NDEBUG |
| 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 #if defined(OS_LINUX) | 211 CommandLine::Init(argc, argv); |
| 212 CommandLine::SetArgcArgv(argc, argv); | |
| 213 #endif | |
| 214 | 212 |
| 215 FilePath log_filename; | 213 FilePath log_filename; |
| 216 PathService::Get(base::DIR_EXE, &log_filename); | 214 PathService::Get(base::DIR_EXE, &log_filename); |
| 217 log_filename = log_filename.Append(FILE_PATH_LITERAL("tld_cleanup.log")); | 215 log_filename = log_filename.Append(FILE_PATH_LITERAL("tld_cleanup.log")); |
| 218 logging::InitLogging(log_filename.value().c_str(), | 216 logging::InitLogging(log_filename.value().c_str(), |
| 219 destination, | 217 destination, |
| 220 logging::LOCK_LOG_FILE, | 218 logging::LOCK_LOG_FILE, |
| 221 logging::DELETE_OLD_LOG_FILE); | 219 logging::DELETE_OLD_LOG_FILE); |
| 222 | 220 |
| 223 icu_util::Initialize(); | 221 icu_util::Initialize(); |
| 224 | 222 |
| 225 NormalizeResult result = NormalizeFile(UTF8ToWide(argv[1]), | 223 NormalizeResult result = NormalizeFile(UTF8ToWide(argv[1]), |
| 226 UTF8ToWide(argv[2])); | 224 UTF8ToWide(argv[2])); |
| 227 if (result != kSuccess) { | 225 if (result != kSuccess) { |
| 228 fprintf(stderr, | 226 fprintf(stderr, |
| 229 "Errors or warnings processing file. See log in tld_cleanup.log."); | 227 "Errors or warnings processing file. See log in tld_cleanup.log."); |
| 230 } | 228 } |
| 231 | 229 |
| 232 if (result == kError) | 230 if (result == kError) |
| 233 return 1; | 231 return 1; |
| 234 return 0; | 232 return 0; |
| 235 } | 233 } |
| OLD | NEW |