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

Side by Side Diff: trunk/src/chrome/tools/profiles/generate_profile.cc

Issue 14824006: Revert 198820 "Move FileEnumerator to its own file, do some refa..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 // 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"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/file_util.h" 12 #include "base/file_util.h"
13 #include "base/files/file_enumerator.h"
14 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
15 #include "base/i18n/icu_util.h" 14 #include "base/i18n/icu_util.h"
16 #include "base/logging.h" 15 #include "base/logging.h"
17 #include "base/message_loop.h" 16 #include "base/message_loop.h"
18 #include "base/path_service.h" 17 #include "base/path_service.h"
19 #include "base/process_util.h" 18 #include "base/process_util.h"
20 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
21 #include "base/time.h" 20 #include "base/time.h"
22 #include "base/utf_string_conversions.h" 21 #include "base/utf_string_conversions.h"
23 #include "chrome/browser/history/history_service.h" 22 #include "chrome/browser/history/history_service.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 page_id += batch_size; 283 page_id += batch_size;
285 } 284 }
286 285
287 printf("Writing to disk\n"); 286 printf("Writing to disk\n");
288 287
289 profile.DestroyTopSites(); 288 profile.DestroyTopSites();
290 profile.DestroyHistoryService(); 289 profile.DestroyHistoryService();
291 290
292 message_loop.RunUntilIdle(); 291 message_loop.RunUntilIdle();
293 292
294 base::FileEnumerator file_iterator(profile.GetPath(), false, 293 file_util::FileEnumerator file_iterator(profile.GetPath(), false,
295 base::FileEnumerator::FILES); 294 file_util::FileEnumerator::FILES);
296 base::FilePath path = file_iterator.Next(); 295 base::FilePath path = file_iterator.Next();
297 while (!path.empty()) { 296 while (!path.empty()) {
298 base::FilePath dst_file = dst_dir.Append(path.BaseName()); 297 base::FilePath dst_file = dst_dir.Append(path.BaseName());
299 file_util::Delete(dst_file, false); 298 file_util::Delete(dst_file, false);
300 printf("Copying file %" PRFilePath " to " 299 printf("Copying file %" PRFilePath " to "
301 "%" PRFilePath "\n", path.value().c_str(), 300 "%" PRFilePath "\n", path.value().c_str(),
302 dst_file.value().c_str()); 301 dst_file.value().c_str());
303 if (!file_util::CopyFile(path, dst_file)) { 302 if (!file_util::CopyFile(path, dst_file)) {
304 PLOG(ERROR) << "Copying file failed"; 303 PLOG(ERROR) << "Copying file failed";
305 return -1; 304 return -1;
306 } 305 }
307 path = file_iterator.Next(); 306 path = file_iterator.Next();
308 } 307 }
309 308
310 return 0; 309 return 0;
311 } 310 }
OLDNEW
« no previous file with comments | « trunk/src/chrome/test/webdriver/webdriver_util.cc ('k') | trunk/src/chrome_frame/test/reliability/page_load_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698