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

Side by Side Diff: trunk/src/chrome/test/perf/generate_profile.cc

Issue 19637009: Revert 212459 "Remove TextDatabase from the history service." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « trunk/src/chrome/test/perf/generate_profile.h ('k') | no next file » | 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) 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 #include "chrome/test/perf/generate_profile.h" 5 #include "chrome/test/perf/generate_profile.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 redirects.push_back(url); 185 redirects.push_back(url);
186 } 186 }
187 187
188 // Add all of this information to the history service. 188 // Add all of this information to the history service.
189 history_service->AddPage(url, base::Time::Now(), 189 history_service->AddPage(url, base::Time::Now(),
190 id_scope, page_id, 190 id_scope, page_id,
191 previous_url, redirects, 191 previous_url, redirects,
192 transition, history::SOURCE_BROWSED, true); 192 transition, history::SOURCE_BROWSED, true);
193 ThumbnailScore score(0.75, false, false); 193 ThumbnailScore score(0.75, false, false);
194 history_service->SetPageTitle(url, ConstructRandomTitle()); 194 history_service->SetPageTitle(url, ConstructRandomTitle());
195 if (types & FULL_TEXT)
196 history_service->SetPageContents(url, ConstructRandomPage());
195 if (types & TOP_SITES && top_sites) { 197 if (types & TOP_SITES && top_sites) {
196 top_sites->SetPageThumbnailToJPEGBytes( 198 top_sites->SetPageThumbnailToJPEGBytes(
197 url, 199 url,
198 (RandomInt(0, 2) == 0) ? google_bitmap.get() : weewar_bitmap.get(), 200 (RandomInt(0, 2) == 0) ? google_bitmap.get() : weewar_bitmap.get(),
199 score); 201 score);
200 } 202 }
201 203
202 previous_url = url; 204 previous_url = url;
203 205
204 if (revisit_urls.empty() || RandomFloat() < kRevisitableURLProbability) 206 if (revisit_urls.empty() || RandomFloat() < kRevisitableURLProbability)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 path = file_iterator.Next(); 264 path = file_iterator.Next();
263 } 265 }
264 266
265 printf("Finished creating profiles for testing.\n"); 267 printf("Finished creating profiles for testing.\n");
266 268
267 // Restore the random seed. 269 // Restore the random seed.
268 srand(static_cast<unsigned int>(Time::Now().ToInternalValue())); 270 srand(static_cast<unsigned int>(Time::Now().ToInternalValue()));
269 271
270 return true; 272 return true;
271 } 273 }
OLDNEW
« no previous file with comments | « trunk/src/chrome/test/perf/generate_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698