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

Unified Diff: chrome/browser/ui/webui/history_ui.h

Issue 164703002: Don't leak WebHistoryService::Request on HistoryService shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remnant of previous version. 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
Index: chrome/browser/ui/webui/history_ui.h
diff --git a/chrome/browser/ui/webui/history_ui.h b/chrome/browser/ui/webui/history_ui.h
index ebe4c5c6bc2ccf6396088c557b43ad654ac245a4..99f43b705b5083fc9f69d87942ba51e93fb6ee4c 100644
--- a/chrome/browser/ui/webui/history_ui.h
+++ b/chrome/browser/ui/webui/history_ui.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/timer/timer.h"
@@ -157,8 +158,7 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
void RemoveComplete();
// Callback from history server when visits were deleted.
- void RemoveWebHistoryComplete(history::WebHistoryService::Request* request,
- bool success);
+ void RemoveWebHistoryComplete(bool success);
bool ExtractIntegerValueAtIndex(
const base::ListValue* value, int index, int* out_int);
@@ -181,9 +181,8 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// Deleting the request will cancel it.
scoped_ptr<history::WebHistoryService::Request> web_history_request_;
- // The currently-executing delete request for synced history.
- // Deleting the request will cancel it.
- scoped_ptr<history::WebHistoryService::Request> web_history_delete_request_;
+ // The number of pending delete requests to the history service.
+ int pending_delete_requests_;
// Tracker for delete requests to the history service.
base::CancelableTaskTracker delete_task_tracker_;
@@ -203,6 +202,8 @@ class BrowsingHistoryHandler : public content::WebUIMessageHandler,
// Timer used to implement a timeout on a Web History response.
base::OneShotTimer<BrowsingHistoryHandler> web_history_timer_;
+ base::WeakPtrFactory<BrowsingHistoryHandler> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(BrowsingHistoryHandler);
};

Powered by Google App Engine
This is Rietveld 408576698