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

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

Issue 9071014: Database usage adjustment for .../history (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_ 5 #ifndef CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_
6 #define CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_ 6 #define CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/history/history_types.h" 9 #include "chrome/browser/history/history_types.h"
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // Fills all visits in the time range [begin, end) to the given vector. Either 63 // Fills all visits in the time range [begin, end) to the given vector. Either
64 // time can be is_null(), in which case the times in that direction are 64 // time can be is_null(), in which case the times in that direction are
65 // unbounded. 65 // unbounded.
66 // 66 //
67 // If |max_results| is non-zero, up to that many results will be returned. If 67 // If |max_results| is non-zero, up to that many results will be returned. If
68 // there are more results than that, the oldest ones will be returned. (This 68 // there are more results than that, the oldest ones will be returned. (This
69 // is used for history expiration.) 69 // is used for history expiration.)
70 // 70 //
71 // The results will be in increasing order of date. 71 // The results will be in increasing order of date.
72 void GetAllVisitsInRange(base::Time begin_time, base::Time end_time, 72 bool GetAllVisitsInRange(base::Time begin_time, base::Time end_time,
73 int max_results, VisitVector* visits); 73 int max_results, VisitVector* visits);
74 74
75 // Fills all visits with specified transition in the time range [begin, end) 75 // Fills all visits with specified transition in the time range [begin, end)
76 // to the given vector. Either time can be is_null(), in which case the times 76 // to the given vector. Either time can be is_null(), in which case the times
77 // in that direction are unbounded. 77 // in that direction are unbounded.
78 // 78 //
79 // If |max_results| is non-zero, up to that many results will be returned. If 79 // If |max_results| is non-zero, up to that many results will be returned. If
80 // there are more results than that, the oldest ones will be returned. (This 80 // there are more results than that, the oldest ones will be returned. (This
81 // is used for history expiration.) 81 // is used for history expiration.)
82 // 82 //
83 // The results will be in increasing order of date. 83 // The results will be in increasing order of date.
84 void GetVisitsInRangeForTransition(base::Time begin_time, 84 bool GetVisitsInRangeForTransition(base::Time begin_time,
85 base::Time end_time, 85 base::Time end_time,
86 int max_results, 86 int max_results,
87 content::PageTransition transition, 87 content::PageTransition transition,
88 VisitVector* visits); 88 VisitVector* visits);
89 89
90 // Fills all visits in the given time range into the given vector that should 90 // Fills all visits in the given time range into the given vector that should
91 // be user-visible, which excludes things like redirects and subframes. The 91 // be user-visible, which excludes things like redirects and subframes. The
92 // begin time is inclusive, the end time is exclusive. Either time can be 92 // begin time is inclusive, the end time is exclusive. Either time can be
93 // is_null(), in which case the times in that direction are unbounded. 93 // is_null(), in which case the times in that direction are unbounded.
94 // 94 //
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // Called by the derived classes on initialization to make sure the tables 163 // Called by the derived classes on initialization to make sure the tables
164 // and indices are properly set up. Must be called before anything else. 164 // and indices are properly set up. Must be called before anything else.
165 bool InitVisitTable(); 165 bool InitVisitTable();
166 166
167 // Convenience to fill a VisitRow. Assumes the visit values are bound starting 167 // Convenience to fill a VisitRow. Assumes the visit values are bound starting
168 // at index 0. 168 // at index 0.
169 static void FillVisitRow(sql::Statement& statement, VisitRow* visit); 169 static void FillVisitRow(sql::Statement& statement, VisitRow* visit);
170 170
171 // Convenience to fill a VisitVector. Assumes that statement.step() 171 // Convenience to fill a VisitVector. Assumes that statement.step()
172 // hasn't happened yet. 172 // hasn't happened yet.
173 static void FillVisitVector(sql::Statement& statement, VisitVector* visits); 173 static bool FillVisitVector(sql::Statement& statement, VisitVector* visits);
174 174
175 private: 175 private:
176 DISALLOW_COPY_AND_ASSIGN(VisitDatabase); 176 DISALLOW_COPY_AND_ASSIGN(VisitDatabase);
177 }; 177 };
178 178
179 } // history 179 } // history
180 180
181 #endif // CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_ 181 #endif // CHROME_BROWSER_HISTORY_VISIT_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698