| OLD | NEW |
| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 profile.DestroyHistoryService(); | 250 profile.DestroyHistoryService(); |
| 251 | 251 |
| 252 message_loop.RunUntilIdle(); | 252 message_loop.RunUntilIdle(); |
| 253 | 253 |
| 254 base::FileEnumerator file_iterator(profile.GetPath(), false, | 254 base::FileEnumerator file_iterator(profile.GetPath(), false, |
| 255 base::FileEnumerator::FILES); | 255 base::FileEnumerator::FILES); |
| 256 base::FilePath path = file_iterator.Next(); | 256 base::FilePath path = file_iterator.Next(); |
| 257 while (!path.empty()) { | 257 while (!path.empty()) { |
| 258 base::FilePath dst_file = dst_dir.Append(path.BaseName()); | 258 base::FilePath dst_file = dst_dir.Append(path.BaseName()); |
| 259 base::Delete(dst_file, false); | 259 base::Delete(dst_file, false); |
| 260 if (!file_util::CopyFile(path, dst_file)) { | 260 if (!base::CopyFile(path, dst_file)) { |
| 261 PLOG(ERROR) << "Copying file failed"; | 261 PLOG(ERROR) << "Copying file failed"; |
| 262 return false; | 262 return false; |
| 263 } | 263 } |
| 264 path = file_iterator.Next(); | 264 path = file_iterator.Next(); |
| 265 } | 265 } |
| 266 | 266 |
| 267 printf("Finished creating profiles for testing.\n"); | 267 printf("Finished creating profiles for testing.\n"); |
| 268 | 268 |
| 269 // Restore the random seed. | 269 // Restore the random seed. |
| 270 srand(static_cast<unsigned int>(Time::Now().ToInternalValue())); | 270 srand(static_cast<unsigned int>(Time::Now().ToInternalValue())); |
| 271 | 271 |
| 272 return true; | 272 return true; |
| 273 } | 273 } |
| OLD | NEW |