Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(337)

Side by Side Diff: chrome/common/logging_chrome.cc

Issue 93793010: Update uses of UTF conversions in chrome/common to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/localized_error.cc ('k') | chrome/common/metrics/variations/experiment_labels.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 // Need to include this before most other files because it defines 7 // Need to include this before most other files because it defines
8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define 8 // IPC_MESSAGE_LOG_ENABLED. We need to use it to define
9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the 9 // IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the
10 // ViewMsgLog et al. functions. 10 // ViewMsgLog et al. functions.
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 std::ifstream log_file; 429 std::ifstream log_file;
430 log_file.open(GetLogFileName().value().c_str()); 430 log_file.open(GetLogFileName().value().c_str());
431 if (!log_file.is_open()) 431 if (!log_file.is_open())
432 return 0; 432 return 0;
433 433
434 std::string utf8_line; 434 std::string utf8_line;
435 std::wstring wide_line; 435 std::wstring wide_line;
436 while (!log_file.eof()) { 436 while (!log_file.eof()) {
437 getline(log_file, utf8_line); 437 getline(log_file, utf8_line);
438 if (utf8_line.find(":FATAL:") != std::string::npos) { 438 if (utf8_line.find(":FATAL:") != std::string::npos) {
439 wide_line = UTF8ToWide(utf8_line); 439 wide_line = base::UTF8ToWide(utf8_line);
440 if (assertions) 440 if (assertions)
441 assertions->push_back(wide_line); 441 assertions->push_back(wide_line);
442 ++assertion_count; 442 ++assertion_count;
443 } 443 }
444 } 444 }
445 log_file.close(); 445 log_file.close();
446 446
447 return assertion_count; 447 return assertion_count;
448 } 448 }
449 449
450 base::FilePath GenerateTimestampedName(const base::FilePath& base_path, 450 base::FilePath GenerateTimestampedName(const base::FilePath& base_path,
451 base::Time timestamp) { 451 base::Time timestamp) {
452 base::Time::Exploded time_deets; 452 base::Time::Exploded time_deets;
453 timestamp.LocalExplode(&time_deets); 453 timestamp.LocalExplode(&time_deets);
454 std::string suffix = base::StringPrintf("_%02d%02d%02d-%02d%02d%02d", 454 std::string suffix = base::StringPrintf("_%02d%02d%02d-%02d%02d%02d",
455 time_deets.year, 455 time_deets.year,
456 time_deets.month, 456 time_deets.month,
457 time_deets.day_of_month, 457 time_deets.day_of_month,
458 time_deets.hour, 458 time_deets.hour,
459 time_deets.minute, 459 time_deets.minute,
460 time_deets.second); 460 time_deets.second);
461 return base_path.InsertBeforeExtensionASCII(suffix); 461 return base_path.InsertBeforeExtensionASCII(suffix);
462 } 462 }
463 463
464 } // namespace logging 464 } // namespace logging
OLDNEW
« no previous file with comments | « chrome/common/localized_error.cc ('k') | chrome/common/metrics/variations/experiment_labels.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698