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

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

Issue 314293005: Change HistoryService::QueryURL to use CancelableTaskTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments 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_BACKEND_H_ 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_
6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 virtual void BroadcastNotifications(int type, 89 virtual void BroadcastNotifications(int type,
90 scoped_ptr<HistoryDetails> details) = 0; 90 scoped_ptr<HistoryDetails> details) = 0;
91 91
92 // Invoked when the backend has finished loading the db. 92 // Invoked when the backend has finished loading the db.
93 virtual void DBLoaded() = 0; 93 virtual void DBLoaded() = 0;
94 94
95 virtual void NotifyVisitDBObserversOnAddVisit( 95 virtual void NotifyVisitDBObserversOnAddVisit(
96 const history::BriefVisitInfo& info) = 0; 96 const history::BriefVisitInfo& info) = 0;
97 }; 97 };
98 98
99 // QueryURLResult stores the result of a call to QueryURL. The |row| and
100 // |visits| fields are only valid if |success| is true.
101 struct QueryURLResult {
102 QueryURLResult();
103 ~QueryURLResult();
104 bool success;
105 URLRow row;
106 VisitVector visits;
107 };
108
99 // Init must be called to complete object creation. This object can be 109 // Init must be called to complete object creation. This object can be
100 // constructed on any thread, but all other functions including Init() must 110 // constructed on any thread, but all other functions including Init() must
101 // be called on the history thread. 111 // be called on the history thread.
102 // 112 //
103 // |history_dir| is the directory where the history files will be placed. 113 // |history_dir| is the directory where the history files will be placed.
104 // See the definition of BroadcastNotificationsCallback above. This function 114 // See the definition of BroadcastNotificationsCallback above. This function
105 // takes ownership of the callback pointer. 115 // takes ownership of the callback pointer.
106 // 116 //
107 // |history_client| is used to determine bookmarked URLs when deleting and 117 // |history_client| is used to determine bookmarked URLs when deleting and
108 // may be NULL. 118 // may be NULL.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 161
152 // ScheduleAutocomplete() never frees |provider| (which is globally live). 162 // ScheduleAutocomplete() never frees |provider| (which is globally live).
153 // It passes |params| on to the autocomplete system which will eventually 163 // It passes |params| on to the autocomplete system which will eventually
154 // free it. 164 // free it.
155 void ScheduleAutocomplete(HistoryURLProvider* provider, 165 void ScheduleAutocomplete(HistoryURLProvider* provider,
156 HistoryURLProviderParams* params); 166 HistoryURLProviderParams* params);
157 167
158 void IterateURLs( 168 void IterateURLs(
159 const scoped_refptr<visitedlink::VisitedLinkDelegate::URLEnumerator>& 169 const scoped_refptr<visitedlink::VisitedLinkDelegate::URLEnumerator>&
160 enumerator); 170 enumerator);
161 void QueryURL(scoped_refptr<QueryURLRequest> request, 171 QueryURLResult QueryURL(const GURL& url, bool want_visits);
162 const GURL& url,
163 bool want_visits);
164 void QueryHistory(scoped_refptr<QueryHistoryRequest> request, 172 void QueryHistory(scoped_refptr<QueryHistoryRequest> request,
165 const base::string16& text_query, 173 const base::string16& text_query,
166 const QueryOptions& options); 174 const QueryOptions& options);
167 void QueryRedirectsFrom(scoped_refptr<QueryRedirectsRequest> request, 175 void QueryRedirectsFrom(scoped_refptr<QueryRedirectsRequest> request,
168 const GURL& url); 176 const GURL& url);
169 void QueryRedirectsTo(scoped_refptr<QueryRedirectsRequest> request, 177 void QueryRedirectsTo(scoped_refptr<QueryRedirectsRequest> request,
170 const GURL& url); 178 const GURL& url);
171 179
172 void GetVisibleVisitCountToHost( 180 void GetVisibleVisitCountToHost(
173 scoped_refptr<GetVisibleVisitCountToHostRequest> request, 181 scoped_refptr<GetVisibleVisitCountToHostRequest> request,
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 887
880 // Listens for the system being under memory pressure. 888 // Listens for the system being under memory pressure.
881 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; 889 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_;
882 890
883 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); 891 DISALLOW_COPY_AND_ASSIGN(HistoryBackend);
884 }; 892 };
885 893
886 } // namespace history 894 } // namespace history
887 895
888 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ 896 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698