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 e4564bfec7d8d2d960eb120e4231d4580d088aa0..723a1644f7b4f982cba82b89addd57a7ce682362 100644 |
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc |
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc |
@@ -27,6 +27,7 @@ |
#include "chrome/common/url_constants.h" |
#include "content/browser/browser_thread.h" |
#include "content/browser/tab_contents/tab_contents.h" |
+#include "content/common/notification_service.h" |
#include "net/base/registry_controlled_domain.h" |
#include "net/url_request/url_request_context_getter.h" |
@@ -523,6 +524,9 @@ void SafeBrowsingService::OnIOInitialize( |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
enabled_ = true; |
+ registrar_.Add( |
Peter Kasting
2011/07/06 18:18:37
Nit: Put as many args on this line as will fit
Torne
2011/07/07 09:29:35
Done.
|
+ this, NotificationType::PURGE_MEMORY, NotificationService::AllSources()); |
+ |
MakeDatabaseAvailable(); |
// On Windows, get the safe browsing client name from the browser |
@@ -572,6 +576,8 @@ void SafeBrowsingService::OnIOShutdown() { |
enabled_ = false; |
+ registrar_.RemoveAll(); |
+ |
// This cancels all in-flight GetHash requests. |
delete protocol_manager_; |
protocol_manager_ = NULL; |
@@ -1202,6 +1208,14 @@ void SafeBrowsingService::UpdateWhitelist(const UnsafeResource& resource) { |
white_listed_entries_.push_back(entry); |
} |
+void SafeBrowsingService::Observe(NotificationType type, |
+ const NotificationSource& source, |
+ const NotificationDetails& details) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ DCHECK(type == NotificationType::PURGE_MEMORY); |
Scott Hess - ex-Googler
2011/07/06 17:01:28
Prefer DCHECK_EQ() for the improved diagnostic out
Peter Kasting
2011/07/06 18:18:37
I don't think DCHECK_EQ() works for this argument
Torne
2011/07/07 09:29:35
It doesn't, no; there's no ostream::operator<< def
|
+ CloseDatabase(); |
Peter Kasting
2011/07/06 18:18:37
Nit: Is this now only called from within the class
Torne
2011/07/07 09:29:35
Done.
|
+} |
+ |
bool SafeBrowsingService::IsWhitelisted(const UnsafeResource& resource) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
// Check if the user has already ignored our warning for this render_view |