summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/safe_browsing_service.cc
diff options
context:
space:
mode:
authorpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-11 21:49:56 +0000
committerpaulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-11 21:49:56 +0000
commita5a3752356ab9c7703c49e3809da0af7ca998472 (patch)
tree327e73f68387c53219dac46afc13fe6962485a17 /chrome/browser/safe_browsing/safe_browsing_service.cc
parente77ea34b5c0bef7f64399256968263058d6b24f2 (diff)
downloadchromium_src-a5a3752356ab9c7703c49e3809da0af7ca998472.zip
chromium_src-a5a3752356ab9c7703c49e3809da0af7ca998472.tar.gz
chromium_src-a5a3752356ab9c7703c49e3809da0af7ca998472.tar.bz2
Handle the possibility of failure when starting a
SafeBrowsing update transaction. If we fail to start the transaction, we report the error to the protocol manager which aborts the update process. Review URL: http://codereview.chromium.org/9778 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5207 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/safe_browsing_service.cc')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service.cc20
1 files changed, 3 insertions, 17 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index 5a2f257..792a4d8 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -465,13 +465,6 @@ void SafeBrowsingService::GetAllChunks() {
this, &SafeBrowsingService::GetAllChunksFromDatabase));
}
-void SafeBrowsingService::UpdateStarted() {
- DCHECK(MessageLoop::current() == io_loop_);
- DCHECK(enabled_);
- db_thread_->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &SafeBrowsingService::DatabaseUpdateStarted));
-}
-
void SafeBrowsingService::UpdateFinished(bool update_succeeded) {
DCHECK(MessageLoop::current() == io_loop_);
DCHECK(enabled_);
@@ -479,12 +472,6 @@ void SafeBrowsingService::UpdateFinished(bool update_succeeded) {
this, &SafeBrowsingService::DatabaseUpdateFinished, update_succeeded));
}
-void SafeBrowsingService::DatabaseUpdateStarted() {
- DCHECK(MessageLoop::current() == db_thread_->message_loop());
- if (GetDatabase())
- GetDatabase()->UpdateStarted();
-}
-
void SafeBrowsingService::DatabaseUpdateFinished(bool update_succeeded) {
DCHECK(MessageLoop::current() == db_thread_->message_loop());
if (GetDatabase())
@@ -606,12 +593,11 @@ void SafeBrowsingService::DeleteChunks(
// Database worker function.
void SafeBrowsingService::GetAllChunksFromDatabase() {
DCHECK(MessageLoop::current() == db_thread_->message_loop());
- bool database_error = false;
+ bool database_error = true;
std::vector<SBListChunkRanges> lists;
- if (GetDatabase()) {
+ if (GetDatabase() && GetDatabase()->UpdateStarted()) {
GetDatabase()->GetListsInfo(&lists);
- } else {
- database_error = true;
+ database_error = false;
}
io_loop_->PostTask(FROM_HERE, NewRunnableMethod(