| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 174 } |
| 175 | 175 |
| 176 printf("Letting the history service catch up...\n"); | 176 printf("Letting the history service catch up...\n"); |
| 177 history_service->SetOnBackendDestroyTask(new MessageLoop::QuitTask); | 177 history_service->SetOnBackendDestroyTask(new MessageLoop::QuitTask); |
| 178 history_service->Cleanup(); | 178 history_service->Cleanup(); |
| 179 history_service = NULL; | 179 history_service = NULL; |
| 180 MessageLoop::current()->Run(); | 180 MessageLoop::current()->Run(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 int main(int argc, const char* argv[]) { | 183 int main(int argc, const char* argv[]) { |
| 184 process_util::EnableTerminationOnHeapCorruption(); | 184 base::EnableTerminationOnHeapCorruption(); |
| 185 base::AtExitManager exit_manager; | 185 base::AtExitManager exit_manager; |
| 186 | 186 |
| 187 int next_arg = 1; | 187 int next_arg = 1; |
| 188 bool history_only = false; | 188 bool history_only = false; |
| 189 if (strcmp(argv[next_arg], "--history-only") == 0) { | 189 if (strcmp(argv[next_arg], "--history-only") == 0) { |
| 190 history_only = true; | 190 history_only = true; |
| 191 next_arg++; | 191 next_arg++; |
| 192 } | 192 } |
| 193 | 193 |
| 194 // We require two arguments: urlcount and profiledir. | 194 // We require two arguments: urlcount and profiledir. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 211 const int kBatchSize = 2000; | 211 const int kBatchSize = 2000; |
| 212 int page_id = 0; | 212 int page_id = 0; |
| 213 while (page_id < url_count) { | 213 while (page_id < url_count) { |
| 214 const int batch_size = std::min(kBatchSize, url_count - page_id); | 214 const int batch_size = std::min(kBatchSize, url_count - page_id); |
| 215 InsertURLBatch(profile_dir, page_id, batch_size, history_only); | 215 InsertURLBatch(profile_dir, page_id, batch_size, history_only); |
| 216 page_id += batch_size; | 216 page_id += batch_size; |
| 217 } | 217 } |
| 218 | 218 |
| 219 return 0; | 219 return 0; |
| 220 } | 220 } |
| OLD | NEW |