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

Side by Side Diff: chromeos/network/network_event_log.cc

Issue 112433004: Update uses of UTF conversions in chrome_frame/, chromeos/, components/ 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_frame/utils.cc ('k') | chromeos/settings/timezone_settings.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 "chromeos/network/network_event_log.h" 5 #include "chromeos/network/network_event_log.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 description(description), 70 description(description),
71 time(base::Time::Now()), 71 time(base::Time::Now()),
72 count(1) {} 72 count(1) {}
73 73
74 std::string LogEntry::ToString(bool show_time, 74 std::string LogEntry::ToString(bool show_time,
75 bool show_file, 75 bool show_file,
76 bool show_desc, 76 bool show_desc,
77 bool format_html) const { 77 bool format_html) const {
78 std::string line; 78 std::string line;
79 if (show_time) 79 if (show_time)
80 line += "[" + UTF16ToUTF8(base::TimeFormatTimeOfDay(time)) + "] "; 80 line += "[" + base::UTF16ToUTF8(base::TimeFormatTimeOfDay(time)) + "] ";
81 if (show_file) { 81 if (show_file) {
82 std::string filestr = format_html ? net::EscapeForHTML(file) : file; 82 std::string filestr = format_html ? net::EscapeForHTML(file) : file;
83 line += base::StringPrintf("%s:%d ", file.c_str(), file_line); 83 line += base::StringPrintf("%s:%d ", file.c_str(), file_line);
84 } 84 }
85 line += format_html ? GetHtmlText(show_desc) : GetNormalText(show_desc); 85 line += format_html ? GetHtmlText(show_desc) : GetNormalText(show_desc);
86 if (count > 1) 86 if (count > 1)
87 line += base::StringPrintf(" (%d)", count); 87 line += base::StringPrintf(" (%d)", count);
88 return line; 88 return line;
89 } 89 }
90 90
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 371
372 std::string ValueAsString(const base::Value& value) { 372 std::string ValueAsString(const base::Value& value) {
373 std::string vstr; 373 std::string vstr;
374 base::JSONWriter::WriteWithOptions( 374 base::JSONWriter::WriteWithOptions(
375 &value, base::JSONWriter::OPTIONS_OMIT_BINARY_VALUES, &vstr); 375 &value, base::JSONWriter::OPTIONS_OMIT_BINARY_VALUES, &vstr);
376 return vstr.empty() ? "''" : vstr; 376 return vstr.empty() ? "''" : vstr;
377 } 377 }
378 378
379 } // namespace network_event_log 379 } // namespace network_event_log
380 } // namespace chromeos 380 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome_frame/utils.cc ('k') | chromeos/settings/timezone_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698