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

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

Issue 1110723002: Split to SafeBrowsingDatabaseManager into Local* and Remote*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to review. Tweak comments and list initializer. Created 5 years, 7 months 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
Index: chrome/browser/safe_browsing/safe_browsing_test.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc
index faf36195026f4eb8bdebe1ab5bf8d0d0518bb79e..0e1b7ae9786722f23728275cfe3ae2c1a08b62a5 100644
--- a/chrome/browser/safe_browsing/safe_browsing_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_test.cc
@@ -33,6 +33,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/database_manager.h"
+#include "chrome/browser/safe_browsing/local_database_manager.h"
#include "chrome/browser/safe_browsing/local_safebrowsing_test_server.h"
#include "chrome/browser/safe_browsing/protocol_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
@@ -54,6 +55,10 @@
using content::BrowserThread;
+#ifndef SAFE_BROWSING_DB_LOCAL
+#error This test requires the SAFE_BROWSING_DB_LOCAL implementation.
+#endif
+
namespace {
const base::FilePath::CharType kDataFile[] =
@@ -187,9 +192,11 @@ class SafeBrowsingServerTest : public InProcessBrowserTest {
base::TimeDelta::FromSeconds(0));
}
+
void CheckIsDatabaseReady() {
base::AutoLock lock(update_status_mutex_);
- is_database_ready_ = !database_manager()->database_update_in_progress_;
+ is_database_ready_ =
+ !local_database_manager()->database_update_in_progress_;
}
void CheckUrl(SafeBrowsingDatabaseManager::Client* helper, const GURL& url) {
@@ -210,6 +217,13 @@ class SafeBrowsingServerTest : public InProcessBrowserTest {
return safe_browsing_service_->database_manager().get();
}
+ // TODO(nparker): Remove the need for this by wiring in our own
+ // SafeBrowsingDatabaseManager factory and keep a ptr to the subclass.
+ LocalSafeBrowsingDatabaseManager* local_database_manager() {
+ return static_cast<LocalSafeBrowsingDatabaseManager*>(database_manager());
+ }
+
+
bool is_checked_url_in_db() {
base::AutoLock l(update_status_mutex_);
return is_checked_url_in_db_;
@@ -241,7 +255,7 @@ class SafeBrowsingServerTest : public InProcessBrowserTest {
}
scoped_refptr<base::SequencedTaskRunner> SafeBrowsingTaskRunner() {
- return database_manager()->safe_browsing_task_runner_;
+ return local_database_manager()->safe_browsing_task_runner_;
}
const net::SpawnedTestServer& test_server() const {

Powered by Google App Engine
This is Rietveld 408576698