OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/gfx/codec/jpeg_codec.h" | 10 #include "app/gfx/codec/jpeg_codec.h" |
11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/i18n/icu_util.h" | 13 #include "base/i18n/icu_util.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
17 #include "base/string_util.h" | |
18 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "base/utf_string_conversions.h" |
19 #include "chrome/browser/history/history.h" | 19 #include "chrome/browser/history/history.h" |
20 #include "chrome/common/thumbnail_score.h" | 20 #include "chrome/common/thumbnail_score.h" |
21 #include "third_party/skia/include/core/SkBitmap.h" | 21 #include "third_party/skia/include/core/SkBitmap.h" |
22 | 22 |
23 using base::Time; | 23 using base::Time; |
24 | 24 |
25 // Probabilities of different word lengths, as measured from Darin's profile. | 25 // Probabilities of different word lengths, as measured from Darin's profile. |
26 // kWordLengthProbabilities[n-1] = P(word of length n) | 26 // kWordLengthProbabilities[n-1] = P(word of length n) |
27 const float kWordLengthProbabilities[] = { 0.069f, 0.132f, 0.199f, | 27 const float kWordLengthProbabilities[] = { 0.069f, 0.132f, 0.199f, |
28 0.137f, 0.088f, 0.115f, 0.081f, 0.055f, 0.034f, 0.021f, 0.019f, 0.018f, | 28 0.137f, 0.088f, 0.115f, 0.081f, 0.055f, 0.034f, 0.021f, 0.019f, 0.018f, |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 const int kBatchSize = 2000; | 212 const int kBatchSize = 2000; |
213 int page_id = 0; | 213 int page_id = 0; |
214 while (page_id < url_count) { | 214 while (page_id < url_count) { |
215 const int batch_size = std::min(kBatchSize, url_count - page_id); | 215 const int batch_size = std::min(kBatchSize, url_count - page_id); |
216 InsertURLBatch(profile_dir, page_id, batch_size, history_only); | 216 InsertURLBatch(profile_dir, page_id, batch_size, history_only); |
217 page_id += batch_size; | 217 page_id += batch_size; |
218 } | 218 } |
219 | 219 |
220 return 0; | 220 return 0; |
221 } | 221 } |
OLD | NEW |