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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.h

Issue 2503243003: Wire up CertificateReportingService to handle report uploads (Closed)
Patch Set: Rebase Created 4 years 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 | « chrome/browser/safe_browsing/ping_manager.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_service.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h
index 7e7668e6afa2e9886ecc0e9f1e9ea0adb26b30df..666d7aacaeb6124b377c49efd443836bcd46832e 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.h
+++ b/chrome/browser/safe_browsing/safe_browsing_service.h
@@ -122,7 +122,7 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
return services_delegate_->GetDownloadService();
}
- net::URLRequestContextGetter* url_request_context();
+ scoped_refptr<net::URLRequestContextGetter> url_request_context();
const scoped_refptr<SafeBrowsingUIManager>& ui_manager() const;
@@ -163,6 +163,7 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
// Type for subscriptions to SafeBrowsing service state.
typedef base::CallbackList<void(void)>::Subscription StateSubscription;
+ typedef base::CallbackList<void(void)>::Subscription ShutdownSubscription;
// Adds a listener for when SafeBrowsing preferences might have changed.
// To get the current state, the callback should call enabled_by_prefs().
@@ -170,6 +171,12 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
std::unique_ptr<StateSubscription> RegisterStateCallback(
const base::Callback<void(void)>& callback);
+ // Adds a listener for when SafeBrowsingService starts shutting down.
+ // The callbacks run on the UI thread, and give the subscribers an opportunity
+ // to clean up any references they hold to SafeBrowsingService.
+ std::unique_ptr<ShutdownSubscription> RegisterShutdownCallback(
+ const base::Callback<void(void)>& callback);
+
// Sends serialized download report to backend.
virtual void SendSerializedDownloadReport(const std::string& report);
@@ -287,6 +294,10 @@ class SafeBrowsingService : public base::RefCountedThreadSafe<
// Should only be accessed on the UI thread.
base::CallbackList<void(void)> state_callback_list_;
+ // Callbacks when SafeBrowsing service starts shutting down.
+ // Should only be accessed on the UI thread.
+ base::CallbackList<void(void)> shutdown_callback_list_;
+
// The UI manager handles showing interstitials. Accessed on both UI and IO
// thread.
scoped_refptr<SafeBrowsingUIManager> ui_manager_;
« no previous file with comments | « chrome/browser/safe_browsing/ping_manager.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698