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

Side by Side Diff: chrome/browser/feedback/feedback_data.cc

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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 "chrome/browser/feedback/feedback_data.h" 5 #include "chrome/browser/feedback/feedback_data.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_string_value_serializer.h" 8 #include "base/json/json_string_value_serializer.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 std::string LogsToString(const FeedbackData::SystemLogsMap& sys_info) { 49 std::string LogsToString(const FeedbackData::SystemLogsMap& sys_info) {
50 std::string syslogs_string; 50 std::string syslogs_string;
51 for (FeedbackData::SystemLogsMap::const_iterator it = sys_info.begin(); 51 for (FeedbackData::SystemLogsMap::const_iterator it = sys_info.begin();
52 it != sys_info.end(); ++it) { 52 it != sys_info.end(); ++it) {
53 std::string key = it->first; 53 std::string key = it->first;
54 std::string value = it->second; 54 std::string value = it->second;
55 55
56 if (FeedbackData::BelowCompressionThreshold(value)) 56 if (FeedbackData::BelowCompressionThreshold(value))
57 continue; 57 continue;
58 58
59 TrimString(key, "\n ", &key); 59 base::TrimString(key, "\n ", &key);
60 TrimString(value, "\n ", &value); 60 base::TrimString(value, "\n ", &value);
61 61
62 if (value.find("\n") != std::string::npos) { 62 if (value.find("\n") != std::string::npos) {
63 syslogs_string.append( 63 syslogs_string.append(
64 key + "=" + kMultilineIndicatorString + 64 key + "=" + kMultilineIndicatorString +
65 kMultilineStartString + 65 kMultilineStartString +
66 value + "\n" + 66 value + "\n" +
67 kMultilineEndString); 67 kMultilineEndString);
68 } else { 68 } else {
69 syslogs_string.append(key + "=" + value + "\n"); 69 syslogs_string.append(key + "=" + value + "\n");
70 } 70 }
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 feedback_page_data_complete_; 269 feedback_page_data_complete_;
270 } 270 }
271 271
272 void FeedbackData::SendReport() { 272 void FeedbackData::SendReport() {
273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
274 if (IsDataComplete() && !report_sent_) { 274 if (IsDataComplete() && !report_sent_) {
275 report_sent_ = true; 275 report_sent_ = true;
276 feedback_util::SendReport(this); 276 feedback_util::SendReport(this);
277 } 277 }
278 } 278 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698