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

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

Issue 9365030: More SQL statement usage regularization. Back-touch some (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head Created 8 years, 10 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) 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/browser/history/visit_database.h" 5 #include "chrome/browser/history/visit_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 visit->visit_time = base::Time::FromInternalValue(statement.ColumnInt64(2)); 99 visit->visit_time = base::Time::FromInternalValue(statement.ColumnInt64(2));
100 visit->referring_visit = statement.ColumnInt64(3); 100 visit->referring_visit = statement.ColumnInt64(3);
101 visit->transition = content::PageTransitionFromInt(statement.ColumnInt(4)); 101 visit->transition = content::PageTransitionFromInt(statement.ColumnInt(4));
102 visit->segment_id = statement.ColumnInt64(5); 102 visit->segment_id = statement.ColumnInt64(5);
103 visit->is_indexed = !!statement.ColumnInt(6); 103 visit->is_indexed = !!statement.ColumnInt(6);
104 } 104 }
105 105
106 // static 106 // static
107 bool VisitDatabase::FillVisitVector(sql::Statement& statement, 107 bool VisitDatabase::FillVisitVector(sql::Statement& statement,
108 VisitVector* visits) { 108 VisitVector* visits) {
109 if (!statement.is_valid())
110 return false;
111
109 while (statement.Step()) { 112 while (statement.Step()) {
110 history::VisitRow visit; 113 history::VisitRow visit;
111 FillVisitRow(statement, &visit); 114 FillVisitRow(statement, &visit);
112 visits->push_back(visit); 115 visits->push_back(visit);
113 } 116 }
114 117
115 return statement.Succeeded(); 118 return statement.Succeeded();
116 } 119 }
117 120
118 VisitID VisitDatabase::AddVisit(VisitRow* visit, VisitSource source) { 121 VisitID VisitDatabase::AddVisit(VisitRow* visit, VisitSource source) {
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // Get the source entries out of the query result. 506 // Get the source entries out of the query result.
504 while (statement.Step()) { 507 while (statement.Step()) {
505 std::pair<VisitID, VisitSource> source_entry(statement.ColumnInt64(0), 508 std::pair<VisitID, VisitSource> source_entry(statement.ColumnInt64(0),
506 static_cast<VisitSource>(statement.ColumnInt(1))); 509 static_cast<VisitSource>(statement.ColumnInt(1)));
507 sources->insert(source_entry); 510 sources->insert(source_entry);
508 } 511 }
509 } 512 }
510 } 513 }
511 514
512 } // namespace history 515 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/download_database.cc ('k') | chrome/browser/history/visitsegment_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698