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

Side by Side Diff: chrome/test/perf/generate_profile.cc

Issue 100573002: Move directory creation functions 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
« no previous file with comments | « chrome/test/chromedriver/chrome_launcher.cc ('k') | chrome/tools/crash_service/main.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 "chrome/test/perf/generate_profile.h" 5 #include "chrome/test/perf/generate_profile.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 if (revisit_urls.empty() || RandomFloat() < kRevisitableURLProbability) 198 if (revisit_urls.empty() || RandomFloat() < kRevisitableURLProbability)
199 revisit_urls.push_back(url); 199 revisit_urls.push_back(url);
200 } 200 }
201 } 201 }
202 202
203 } // namespace 203 } // namespace
204 204
205 bool GenerateProfile(GenerateProfileTypes types, 205 bool GenerateProfile(GenerateProfileTypes types,
206 int url_count, 206 int url_count,
207 const base::FilePath& dst_dir) { 207 const base::FilePath& dst_dir) {
208 if (!file_util::CreateDirectory(dst_dir)) { 208 if (!base::CreateDirectory(dst_dir)) {
209 PLOG(ERROR) << "Unable to create directory " << dst_dir.value().c_str(); 209 PLOG(ERROR) << "Unable to create directory " << dst_dir.value().c_str();
210 return false; 210 return false;
211 } 211 }
212 212
213 // We want this profile to be as deterministic as possible, so seed the 213 // We want this profile to be as deterministic as possible, so seed the
214 // random number generator with the number of urls we're generating. 214 // random number generator with the number of urls we're generating.
215 srand(static_cast<unsigned int>(url_count)); 215 srand(static_cast<unsigned int>(url_count));
216 216
217 printf("Creating profiles for testing...\n"); 217 printf("Creating profiles for testing...\n");
218 218
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 path = file_iterator.Next(); 259 path = file_iterator.Next();
260 } 260 }
261 261
262 printf("Finished creating profiles for testing.\n"); 262 printf("Finished creating profiles for testing.\n");
263 263
264 // Restore the random seed. 264 // Restore the random seed.
265 srand(static_cast<unsigned int>(Time::Now().ToInternalValue())); 265 srand(static_cast<unsigned int>(Time::Now().ToInternalValue()));
266 266
267 return true; 267 return true;
268 } 268 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/chrome_launcher.cc ('k') | chrome/tools/crash_service/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698