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

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

Issue 314293005: Change HistoryService::QueryURL to use CancelableTaskTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase & fix style errors Created 6 years, 6 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 (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 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_
6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 // Querying ------------------------------------------------------------------ 234 // Querying ------------------------------------------------------------------
235 235
236 // Returns the information about the requested URL. If the URL is found, 236 // Returns the information about the requested URL. If the URL is found,
237 // success will be true and the information will be in the URLRow parameter. 237 // success will be true and the information will be in the URLRow parameter.
238 // On success, the visits, if requested, will be sorted by date. If they have 238 // On success, the visits, if requested, will be sorted by date. If they have
239 // not been requested, the pointer will be valid, but the vector will be 239 // not been requested, the pointer will be valid, but the vector will be
240 // empty. 240 // empty.
241 // 241 //
242 // If success is false, neither the row nor the vector will be valid. 242 // If success is false, neither the row nor the vector will be valid.
243 typedef base::Callback<void( 243 typedef base::Callback<
244 Handle, 244 void(bool, // Success flag, when false, nothing else is valid.
245 bool, // Success flag, when false, nothing else is valid. 245 const history::URLRow&,
246 const history::URLRow*, 246 const history::VisitVector&)> QueryURLCallback;
247 history::VisitVector*)> QueryURLCallback;
248 247
249 // Queries the basic information about the URL in the history database. If 248 // Queries the basic information about the URL in the history database. If
250 // the caller is interested in the visits (each time the URL is visited), 249 // the caller is interested in the visits (each time the URL is visited),
251 // set |want_visits| to true. If these are not needed, the function will be 250 // set |want_visits| to true. If these are not needed, the function will be
252 // faster by setting this to false. 251 // faster by setting this to false.
253 Handle QueryURL(const GURL& url, 252 base::CancelableTaskTracker::TaskId QueryURL(
254 bool want_visits, 253 const GURL& url,
255 CancelableRequestConsumerBase* consumer, 254 bool want_visits,
256 const QueryURLCallback& callback); 255 const QueryURLCallback& callback,
256 base::CancelableTaskTracker* tracker);
257 257
258 // Provides the result of a query. See QueryResults in history_types.h. 258 // Provides the result of a query. See QueryResults in history_types.h.
259 // The common use will be to use QueryResults.Swap to suck the contents of 259 // The common use will be to use QueryResults.Swap to suck the contents of
260 // the results out of the passed in parameter and take ownership of them. 260 // the results out of the passed in parameter and take ownership of them.
261 typedef base::Callback<void(Handle, history::QueryResults*)> 261 typedef base::Callback<void(Handle, history::QueryResults*)>
262 QueryHistoryCallback; 262 QueryHistoryCallback;
263 263
264 // Queries all history with the given options (see QueryOptions in 264 // Queries all history with the given options (see QueryOptions in
265 // history_types.h). If empty, all results matching the given options 265 // history_types.h). If empty, all results matching the given options
266 // will be returned. 266 // will be returned.
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; 1047 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_;
1048 1048
1049 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; 1049 ObserverList<history::VisitDatabaseObserver> visit_database_observers_;
1050 1050
1051 history::DeleteDirectiveHandler delete_directive_handler_; 1051 history::DeleteDirectiveHandler delete_directive_handler_;
1052 1052
1053 DISALLOW_COPY_AND_ASSIGN(HistoryService); 1053 DISALLOW_COPY_AND_ASSIGN(HistoryService);
1054 }; 1054 };
1055 1055
1056 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ 1056 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698