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

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

Issue 13009: Rollback (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month 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/safe_browsing_service.h ('k') | chrome/plugin/plugin_main.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.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_service.cc (revision 6126)
+++ chrome/browser/safe_browsing/safe_browsing_service.cc (working copy)
@@ -12,7 +12,6 @@
#include "base/path_service.h"
#include "base/string_util.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/safe_browsing/protocol_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
@@ -35,16 +34,9 @@
resetting_(false),
database_loaded_(false) {
new_safe_browsing_ = !CommandLine().HasSwitch(switches::kUseOldSafeBrowsing);
- base::SystemMonitor* monitor = base::SystemMonitor::Get();
- DCHECK(monitor);
- if (monitor)
- monitor->AddObserver(this);
}
SafeBrowsingService::~SafeBrowsingService() {
- base::SystemMonitor* monitor = base::SystemMonitor::Get();
- if (monitor)
- monitor->RemoveObserver(this);
}
// Only called on the UI thread.
@@ -670,17 +662,18 @@
GetDatabase()->CacheHashResults(prefixes, full_hashes);
}
-void SafeBrowsingService::OnSuspend(base::SystemMonitor*) {
+void SafeBrowsingService::OnSuspend() {
}
// Tell the SafeBrowsing database not to do expensive disk operations for a few
// minutes after waking up. It's quite likely that the act of resuming from a
// low power state will involve much disk activity, which we don't want to
// exacerbate.
-void SafeBrowsingService::OnResume(base::SystemMonitor*) {
+void SafeBrowsingService::OnResume() {
+ DCHECK(MessageLoop::current() == io_loop_);
if (enabled_) {
- ChromeThread::GetMessageLoop(ChromeThread::DB)->PostTask(FROM_HERE,
- NewRunnableMethod(this, &SafeBrowsingService::HandleResume));
+ db_thread_->message_loop()->PostTask(FROM_HERE,
+ NewRunnableMethod(this, &SafeBrowsingService::HandleResume));
}
}
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.h ('k') | chrome/plugin/plugin_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698