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

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

Issue 8477004: Have content/ create and destroy its own threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix official build, avoid DCHECK in official Linux/ChromeOS builds. Created 9 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/browser/ui/gtk/select_file_dialog_impl_kde.cc ('k') | chrome_frame/chrome_frame.gyp » ('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) 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"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/file_util.h" 13 #include "base/file_util.h"
14 #include "base/i18n/icu_util.h" 14 #include "base/i18n/icu_util.h"
15 #include "base/message_loop.h" 15 #include "base/message_loop.h"
16 #include "base/path_service.h" 16 #include "base/path_service.h"
17 #include "base/process_util.h" 17 #include "base/process_util.h"
18 #include "base/string_number_conversions.h" 18 #include "base/string_number_conversions.h"
19 #include "base/time.h" 19 #include "base/time.h"
20 #include "base/utf_string_conversions.h" 20 #include "base/utf_string_conversions.h"
21 #include "chrome/browser/history/history.h" 21 #include "chrome/browser/history/history.h"
22 #include "chrome/browser/history/top_sites.h" 22 #include "chrome/browser/history/top_sites.h"
23 #include "chrome/common/chrome_paths.h" 23 #include "chrome/common/chrome_paths.h"
24 #include "chrome/common/thumbnail_score.h" 24 #include "chrome/common/thumbnail_score.h"
25 #include "chrome/test/base/testing_profile.h" 25 #include "chrome/test/base/testing_profile.h"
26 #include "content/browser/browser_thread_impl.h"
26 #include "content/browser/notification_service_impl.h" 27 #include "content/browser/notification_service_impl.h"
27 #include "content/public/browser/browser_thread.h" 28 #include "content/public/browser/browser_thread.h"
28 #include "third_party/skia/include/core/SkBitmap.h" 29 #include "third_party/skia/include/core/SkBitmap.h"
29 #include "ui/base/resource/resource_bundle.h" 30 #include "ui/base/resource/resource_bundle.h"
30 #include "ui/base/ui_base_paths.h" 31 #include "ui/base/ui_base_paths.h"
31 #include "ui/gfx/codec/jpeg_codec.h" 32 #include "ui/gfx/codec/jpeg_codec.h"
32 33
33 using base::Time; 34 using base::Time;
34 using content::BrowserThread; 35 using content::BrowserThread;
35 36
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 ::GetLastError()); 230 ::GetLastError());
230 } 231 }
231 232
232 icu_util::Initialize(); 233 icu_util::Initialize();
233 234
234 chrome::RegisterPathProvider(); 235 chrome::RegisterPathProvider();
235 ui::RegisterPathProvider(); 236 ui::RegisterPathProvider();
236 ResourceBundle::InitSharedInstance("en-US"); 237 ResourceBundle::InitSharedInstance("en-US");
237 NotificationServiceImpl notification_service; 238 NotificationServiceImpl notification_service;
238 MessageLoopForUI message_loop; 239 MessageLoopForUI message_loop;
239 content::DeprecatedBrowserThread ui_thread(BrowserThread::UI, &message_loop); 240 content::BrowserThreadImpl ui_thread(BrowserThread::UI, &message_loop);
240 content::DeprecatedBrowserThread db_thread(BrowserThread::DB, &message_loop); 241 content::BrowserThreadImpl db_thread(BrowserThread::DB, &message_loop);
241 TestingProfile profile; 242 TestingProfile profile;
242 profile.CreateHistoryService(false, false); 243 profile.CreateHistoryService(false, false);
243 if (types & TOP_SITES) { 244 if (types & TOP_SITES) {
244 profile.CreateTopSites(); 245 profile.CreateTopSites();
245 profile.BlockUntilTopSitesLoaded(); 246 profile.BlockUntilTopSitesLoaded();
246 } 247 }
247 248
248 srand(static_cast<unsigned int>(Time::Now().ToInternalValue())); 249 srand(static_cast<unsigned int>(Time::Now().ToInternalValue()));
249 250
250 // The maximum number of URLs to insert into history in one batch. 251 // The maximum number of URLs to insert into history in one batch.
(...skipping 26 matching lines...) Expand all
277 dst_file.value().c_str()); 278 dst_file.value().c_str());
278 if (!file_util::CopyFile(path, dst_file)) { 279 if (!file_util::CopyFile(path, dst_file)) {
279 printf("Copying file failed: %d\n", ::GetLastError()); 280 printf("Copying file failed: %d\n", ::GetLastError());
280 return -1; 281 return -1;
281 } 282 }
282 path = file_iterator.Next(); 283 path = file_iterator.Next();
283 } 284 }
284 285
285 return 0; 286 return 0;
286 } 287 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/select_file_dialog_impl_kde.cc ('k') | chrome_frame/chrome_frame.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698