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

Side by Side Diff: chrome/browser/page_cycler/page_cycler.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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
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/page_cycler/page_cycler.h" 5 #include "chrome/browser/page_cycler/page_cycler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 void PageCycler::PrepareResultsOnBackgroundThread() { 185 void PageCycler::PrepareResultsOnBackgroundThread() {
186 CHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 186 CHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
187 std::string output; 187 std::string output;
188 if (!stats_file_.empty()) { 188 if (!stats_file_.empty()) {
189 #if defined(OS_POSIX) 189 #if defined(OS_POSIX)
190 base::ProcessId pid = base::GetParentProcessId(base::GetCurrentProcId()); 190 base::ProcessId pid = base::GetParentProcessId(base::GetCurrentProcId());
191 #elif defined(OS_WIN) 191 #elif defined(OS_WIN)
192 base::ProcessId pid = base::GetCurrentProcId(); 192 base::ProcessId pid = base::GetCurrentProcId();
193 #endif // OS_WIN 193 #endif // OS_WIN
194 ChromeProcessList chrome_processes(GetRunningChromeProcesses(pid)); 194 ChromeProcessList chrome_processes(GetRunningChromeProcesses(pid));
195 output += perf_test::MemoryUsageInfoToString("", chrome_processes, pid); 195 output += perf_test::MemoryUsageInfoToString(
196 output += perf_test::IOPerfInfoToString("", chrome_processes, pid); 196 std::string(), chrome_processes, pid);
197 output += perf_test::SystemCommitChargeToString("", 197 output +=
198 base::GetSystemCommitCharge(), false); 198 perf_test::IOPerfInfoToString(std::string(), chrome_processes, pid);
199 output += perf_test::SystemCommitChargeToString(
200 std::string(), base::GetSystemCommitCharge(), false);
199 output.append("Pages: [" + urls_string_ + "]\n"); 201 output.append("Pages: [" + urls_string_ + "]\n");
200 output.append("*RESULT times: t_ref= [" + timings_string_ + "] ms\n"); 202 output.append("*RESULT times: t_ref= [" + timings_string_ + "] ms\n");
201 } 203 }
202 WriteResultsOnBackgroundThread(output); 204 WriteResultsOnBackgroundThread(output);
203 } 205 }
204 206
205 void PageCycler::WriteResultsOnBackgroundThread(const std::string& output) { 207 void PageCycler::WriteResultsOnBackgroundThread(const std::string& output) {
206 CHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 208 CHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
207 209
208 if (!output.empty()) { 210 if (!output.empty()) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 aborted_ = true; 259 aborted_ = true;
258 error_.append(ASCIIToUTF16( 260 error_.append(ASCIIToUTF16(
259 "Browser was closed before the run was completed.")); 261 "Browser was closed before the run was completed."));
260 DLOG(WARNING) << 262 DLOG(WARNING) <<
261 "Page Cycler: browser was closed before the run was completed."; 263 "Page Cycler: browser was closed before the run was completed.";
262 content::BrowserThread::PostBlockingPoolTask( 264 content::BrowserThread::PostBlockingPoolTask(
263 FROM_HERE, 265 FROM_HERE,
264 base::Bind(&PageCycler::PrepareResultsOnBackgroundThread, this)); 266 base::Bind(&PageCycler::PrepareResultsOnBackgroundThread, this));
265 } 267 }
266 } 268 }
OLDNEW
« no previous file with comments | « chrome/browser/net/url_info.cc ('k') | chrome/browser/password_manager/native_backend_kwallet_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698