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

Unified Diff: chrome/browser/extensions/api/history/history_api.cc

Issue 314293005: Change HistoryService::QueryURL to use CancelableTaskTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and add comment for scoped_ptr usage 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/history/history_api.cc
diff --git a/chrome/browser/extensions/api/history/history_api.cc b/chrome/browser/extensions/api/history/history_api.cc
index bf0608865f676d5df3dc43837696378e3722452e..a454ce2dbba8b816c157eb3c43a2ee60bc9df981 100644
--- a/chrome/browser/extensions/api/history/history_api.cc
+++ b/chrome/browser/extensions/api/history/history_api.cc
@@ -301,22 +301,20 @@ bool HistoryGetVisitsFunction::RunAsyncImpl() {
GetProfile(), Profile::EXPLICIT_ACCESS);
hs->QueryURL(url,
true, // Retrieve full history of a URL.
- &cancelable_consumer_,
base::Bind(&HistoryGetVisitsFunction::QueryComplete,
- base::Unretained(this)));
-
+ base::Unretained(this)),
+ &task_tracker_);
return true;
}
void HistoryGetVisitsFunction::QueryComplete(
- HistoryService::Handle request_service,
bool success,
- const history::URLRow* url_row,
- history::VisitVector* visits) {
+ const history::URLRow& url_row,
+ const history::VisitVector& visits) {
VisitItemList visit_item_vec;
- if (visits && !visits->empty()) {
- for (history::VisitVector::iterator iterator = visits->begin();
- iterator != visits->end();
+ if (success && !visits.empty()) {
+ for (history::VisitVector::const_iterator iterator = visits.begin();
+ iterator != visits.end();
++iterator) {
visit_item_vec.push_back(make_linked_ptr(
GetVisitItem(*iterator).release()));

Powered by Google App Engine
This is Rietveld 408576698