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

Unified Diff: chrome/browser/history/history_service.cc

Issue 164703002: Don't leak WebHistoryService::Request on HistoryService shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dubroy comments Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/history/web_history_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_service.cc
diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc
index 20b90f21b98846c12abfad3a590a2bfc91ee401a..ecd16a93c0581ff29af632603784f4efec036b31 100644
--- a/chrome/browser/history/history_service.cc
+++ b/chrome/browser/history/history_service.cc
@@ -115,11 +115,11 @@ class URLIteratorFromURLRows
};
// Callback from WebHistoryService::ExpireWebHistory().
-void ExpireWebHistoryComplete(
- history::WebHistoryService::Request* request,
- bool success) {
- // Ignore the result and delete the request.
- delete request;
+void ExpireWebHistoryComplete(bool success) {
+ // Ignore the result.
+ //
+ // TODO(davidben): ExpireLocalAndRemoteHistoryBetween callback should not fire
+ // until this completes.
}
} // namespace
@@ -1163,14 +1163,12 @@ void HistoryService::ExpireLocalAndRemoteHistoryBetween(
// Attempt online deletion from the history server, but ignore the result.
// Deletion directives ensure that the results will eventually be deleted.
- // Pass ownership of the request to the callback.
- scoped_ptr<history::WebHistoryService::Request> request =
- web_history->ExpireHistoryBetween(
- restrict_urls, begin_time, end_time,
- base::Bind(&ExpireWebHistoryComplete));
-
- // The request will be freed when the callback is called.
- CHECK(request.release());
+ //
+ // TODO(davidben): |callback| should not run until this operation completes
+ // too.
+ web_history->ExpireHistoryBetween(
+ restrict_urls, begin_time, end_time,
+ base::Bind(&ExpireWebHistoryComplete));
}
ExpireHistoryBetween(restrict_urls, begin_time, end_time, callback, tracker);
}
« no previous file with comments | « no previous file | chrome/browser/history/web_history_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698