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

Side by Side Diff: components/history/core/browser/url_database.h

Issue 872313005: Remove dependency on visitedlink from history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@init-prefs
Patch Set: Rebase Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_ 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_
6 #define COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_ 6 #define COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "components/history/core/browser/keyword_id.h" 9 #include "components/history/core/browser/keyword_id.h"
10 #include "components/history/core/browser/url_row.h" 10 #include "components/history/core/browser/url_row.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 sql::Statement statement_; 130 sql::Statement statement_;
131 131
132 DISALLOW_COPY_AND_ASSIGN(URLEnumeratorBase); 132 DISALLOW_COPY_AND_ASSIGN(URLEnumeratorBase);
133 }; 133 };
134 134
135 // A basic enumerator to enumerate urls 135 // A basic enumerator to enumerate urls
136 class URLEnumerator : public URLEnumeratorBase { 136 class URLEnumerator : public URLEnumeratorBase {
137 public: 137 public:
138 URLEnumerator(); 138 URLEnumerator();
139 139
140 // Retreives the next url. Returns false if no more urls are available 140 // Retrieves the next url. Returns false if no more urls are available.
141 bool GetNextURL(URLRow* r); 141 bool GetNextURL(URLRow* r);
142 142
143 private: 143 private:
144 DISALLOW_COPY_AND_ASSIGN(URLEnumerator); 144 DISALLOW_COPY_AND_ASSIGN(URLEnumerator);
145 }; 145 };
146 146
147 // Initializes the given enumerator to enumerator all URLs in the database. 147 // Initializes the given enumerator to enumerator all URLs in the database.
148 bool InitURLEnumeratorForEverything(URLEnumerator* enumerator); 148 bool InitURLEnumeratorForEverything(URLEnumerator* enumerator);
149 149
150 // Initializes the given enumerator to enumerator all URLs in the database 150 // Initializes the given enumerator to enumerator all URLs in the database
151 // that are historically significant: ones having been visited within 3 days, 151 // that are historically significant: ones having been visited within 3 days,
152 // having their URL manually typed more than once, or having been visited 152 // having their URL manually typed more than once, or having been visited
153 // more than 3 times. 153 // more than 3 times.
154 bool InitURLEnumeratorForSignificant(URLEnumerator* enumerator); 154 bool InitURLEnumeratorForSignificant(URLEnumerator* enumerator);
155 155
156 // Favicons ------------------------------------------------------------------
157
158 // Autocomplete -------------------------------------------------------------- 156 // Autocomplete --------------------------------------------------------------
159 157
160 // Fills the given array with URLs matching the given prefix. They will be 158 // Fills the given array with URLs matching the given prefix. They will be
161 // sorted by typed count, then by visit count, then by visit date (most recent 159 // sorted by typed count, then by visit count, then by visit date (most recent
162 // first) up to the given maximum number. If |typed_only| is true, only urls 160 // first) up to the given maximum number. If |typed_only| is true, only urls
163 // that have been typed once are returned. For caller convenience, returns 161 // that have been typed once are returned. For caller convenience, returns
164 // whether any results were found. 162 // whether any results were found.
165 bool AutocompleteForPrefix(const std::string& prefix, 163 bool AutocompleteForPrefix(const std::string& prefix,
166 size_t max_results, 164 size_t max_results,
167 bool typed_only, 165 bool typed_only,
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // is_null() then this function determines a new time threshold each time it is 317 // is_null() then this function determines a new time threshold each time it is
320 // called. Since getting system time can be costly (such as for cases where 318 // called. Since getting system time can be costly (such as for cases where
321 // this function will be called in a loop over many history items), you can 319 // this function will be called in a loop over many history items), you can
322 // provide a non-null |time_cache| by simply initializing |time_cache| with 320 // provide a non-null |time_cache| by simply initializing |time_cache| with
323 // AutocompleteAgeThreshold() (or any other desired time in the past). 321 // AutocompleteAgeThreshold() (or any other desired time in the past).
324 bool RowQualifiesAsSignificant(const URLRow& row, const base::Time& threshold); 322 bool RowQualifiesAsSignificant(const URLRow& row, const base::Time& threshold);
325 323
326 } // namespace history 324 } // namespace history
327 325
328 #endif // COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_ 326 #endif // COMPONENTS_HISTORY_CORE_BROWSER_URL_DATABASE_H_
OLDNEW
« no previous file with comments | « components/history/core/browser/BUILD.gn ('k') | components/history/core/browser/visit_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698