Index: chrome/browser/safe_browsing/safe_browsing_service.cc |
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc |
index eafb8f1b42837b235832259d4c25d2f25cf5c6b1..d124f5a5afa72b017b5e3bbc8227dce09df5b740 100644 |
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc |
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc |
@@ -345,6 +345,9 @@ void SafeBrowsingService::Initialize() { |
} |
void SafeBrowsingService::ShutDown() { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ shutdown_callback_list_.Notify(); |
+ |
// Delete the PrefChangeRegistrars, whose dtors also unregister |this| as an |
// observer of the preferences. |
prefs_map_.clear(); |
@@ -384,9 +387,10 @@ bool SafeBrowsingService::DownloadBinHashNeeded() const { |
#endif |
} |
-net::URLRequestContextGetter* SafeBrowsingService::url_request_context() { |
+scoped_refptr<net::URLRequestContextGetter> |
+SafeBrowsingService::url_request_context() { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
- return url_request_context_getter_.get(); |
+ return url_request_context_getter_; |
} |
const scoped_refptr<SafeBrowsingUIManager>& |
@@ -690,6 +694,13 @@ SafeBrowsingService::RegisterStateCallback( |
return state_callback_list_.Add(callback); |
} |
+std::unique_ptr<SafeBrowsingService::ShutdownSubscription> |
+SafeBrowsingService::RegisterShutdownCallback( |
+ const base::Callback<void(void)>& callback) { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ return shutdown_callback_list_.Add(callback); |
+} |
+ |
void SafeBrowsingService::RefreshState() { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
// Check if any profile requires the service to be active. |