OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This program generates a user profile and history by randomly generating | 5 // This program generates a user profile and history by randomly generating |
6 // data and feeding it to the history service. | 6 // data and feeding it to the history service. |
7 | 7 |
8 #include "chrome/tools/profiles/thumbnail-inl.h" | 8 #include "chrome/tools/profiles/thumbnail-inl.h" |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 259 |
260 printf("Writing to disk\n"); | 260 printf("Writing to disk\n"); |
261 | 261 |
262 profile.DestroyTopSites(); | 262 profile.DestroyTopSites(); |
263 profile.DestroyHistoryService(); | 263 profile.DestroyHistoryService(); |
264 | 264 |
265 message_loop.RunAllPending(); | 265 message_loop.RunAllPending(); |
266 | 266 |
267 file_util::FileEnumerator file_iterator( | 267 file_util::FileEnumerator file_iterator( |
268 profile.GetPath(), false, | 268 profile.GetPath(), false, |
269 static_cast<file_util::FileEnumerator::FILE_TYPE>( | 269 static_cast<file_util::FileEnumerator::FileType>( |
270 file_util::FileEnumerator::FILES)); | 270 file_util::FileEnumerator::FILES)); |
271 FilePath path = file_iterator.Next(); | 271 FilePath path = file_iterator.Next(); |
272 while (!path.empty()) { | 272 while (!path.empty()) { |
273 FilePath dst_file = dst_dir.Append(path.BaseName()); | 273 FilePath dst_file = dst_dir.Append(path.BaseName()); |
274 file_util::Delete(dst_file, false); | 274 file_util::Delete(dst_file, false); |
275 printf("Copying file %ls to %ls\n", path.value().c_str(), | 275 printf("Copying file %ls to %ls\n", path.value().c_str(), |
276 dst_file.value().c_str()); | 276 dst_file.value().c_str()); |
277 if (!file_util::CopyFile(path, dst_file)) { | 277 if (!file_util::CopyFile(path, dst_file)) { |
278 printf("Copying file failed: %d\n", ::GetLastError()); | 278 printf("Copying file failed: %d\n", ::GetLastError()); |
279 return -1; | 279 return -1; |
280 } | 280 } |
281 path = file_iterator.Next(); | 281 path = file_iterator.Next(); |
282 } | 282 } |
283 | 283 |
284 return 0; | 284 return 0; |
285 } | 285 } |
OLD | NEW |