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

Side by Side Diff: chrome/browser/history/visit_database.cc

Issue 43054: Stop history search going on beyond the start of history.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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) 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 #include <algorithm> 5 #include <algorithm>
6 #include <limits> 6 #include <limits>
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "chrome/browser/history/visit_database.h" 10 #include "chrome/browser/history/visit_database.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 // We've never been to this page before. 361 // We've never been to this page before.
362 *count = 0; 362 *count = 0;
363 return true; 363 return true;
364 } 364 }
365 365
366 *first_visit = Time::FromInternalValue(statement->column_int64(0)); 366 *first_visit = Time::FromInternalValue(statement->column_int64(0));
367 *count = statement->column_int(1); 367 *count = statement->column_int(1);
368 return true; 368 return true;
369 } 369 }
370 370
371 bool VisitDatabase::GetStartDate(Time* first_visit) {
372 SQLITE_UNIQUE_STATEMENT(statement, GetStatementCache(),
373 "SELECT MIN(visit_time) FROM visits WHERE visit_time != 0");
374 if (!statement.is_valid() || statement->step() != SQLITE_ROW ||
375 statement->column_int64(0) == 0) {
376 *first_visit = Time::Now();
377 return false;
378 }
379 *first_visit = Time::FromInternalValue(statement->column_int64(0));
380 return true;
381 }
382
371 } // namespace history 383 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698