summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 17:47:31 +0000
committerlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 17:47:31 +0000
commiteaa4226c0d2c9d8d108fbbb698408c087a43874a (patch)
tree04324768a07e4ce5aaf1fc34a2b756f90a055002
parent61265352c022321d94fc99f59a7dcdd837ee05c6 (diff)
downloadchromium_src-eaa4226c0d2c9d8d108fbbb698408c087a43874a.zip
chromium_src-eaa4226c0d2c9d8d108fbbb698408c087a43874a.tar.gz
chromium_src-eaa4226c0d2c9d8d108fbbb698408c087a43874a.tar.bz2
Enable download protection by default and convert the enable switch to disable switch.
Since currently on download url is checked, this only enables download url checks. Because the safe browsing server used by safe_browsing_test.cc does not understand the new list for safebrowsing download, we have to disable the download protect in that test. TEST=safe browsing related tests stay green. BUG=60822 Review URL: http://codereview.chromium.org/6611006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77297 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_test.cc5
-rw-r--r--chrome/common/chrome_switches.cc20
-rw-r--r--chrome/common/chrome_switches.h2
5 files changed, 18 insertions, 13 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index 04ec974..5bbfb6f 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -525,7 +525,7 @@ void SafeBrowsingService::OnIOInitialize(
CommandLine* cmdline = CommandLine::ForCurrentProcess();
enable_download_protection_ =
- cmdline->HasSwitch(switches::kSbEnableDownloadProtection);
+ !cmdline->HasSwitch(switches::kSbDisableDownloadProtection);
MakeDatabaseAvailable();
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
index 44c4be8..eeb302d 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -289,8 +289,6 @@ class SafeBrowsingServiceTest : public InProcessBrowserTest {
// This test will fill up the database using testing prefixes
// and urls.
command_line->AppendSwitch(switches::kSbDisableAutoUpdate);
-
- command_line->AppendSwitch(switches::kSbEnableDownloadProtection);
}
virtual void SetUpInProcessBrowserTestFixture() {
diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc
index e17cbd5..aad0d1a 100644
--- a/chrome/browser/safe_browsing/safe_browsing_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_test.cc
@@ -289,11 +289,16 @@ class SafeBrowsingServiceTest : public InProcessBrowserTest {
// Makes sure the auto update is not triggered. This test will force the
// update when needed.
command_line->AppendSwitch(switches::kSbDisableAutoUpdate);
+
// This test uses loopback. No need to use IPv6 especially it makes
// local requests slow on Windows trybot when ipv6 local address [::1]
// is not setup.
command_line->AppendSwitch(switches::kDisableIPv6);
+ // TODO(lzheng): The test server does not understand download related
+ // requests. We need to fix the server.
+ command_line->AppendSwitch(switches::kSbDisableDownloadProtection);
+
// In this test, we fetch SafeBrowsing data and Mac key from the same
// server. Although in real production, they are served from different
// servers.
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index aefed69..d3023e7 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -953,15 +953,17 @@ const char kSbMacKeyURLPrefix[] = "safebrowsing-mackey-url-prefix";
// This is used for testing only.
const char kSbDisableAutoUpdate[] = "safebrowsing-disable-auto-update";
-// If present, safebrowsing checks download url and download content's hash
-// to make sure the content are not malicious.
-const char kSbEnableDownloadProtection[] = "safebrowsing-download-protection";
-
-// This flag is used together with kSbEnableDownloadProtection. When that flag
-// is present but this flag is absent, we won't show the warning ui. The purpose
-// of this flag is to make sure we roll out download url detection smoothly.
-// We will remove this flag once we verify that the download url detection works
-// as expectecd according to UMA reports.
+// TODO(lzheng): Remove this flag once the feature works fine
+// (http://crbug.com/74848).
+// This flag disables safebrowsing feature that checks download url and download
+// content's hash to make sure the content are not malicious.
+const char kSbDisableDownloadProtection[] =
+ "safebrowsing-disable-download-protection";
+
+// When this flag is absent, we won't show the warning ui. The purpose of this
+// flag is to make sure we roll out download url detection smoothly. We will
+// remove this flag once we verify that the download url detection works as
+// expectecd according to UMA reports.
const char kSbEnableDownloadWarningUI[] = "safebrowsing-download-warning-ui";
// Enable support for SDCH filtering (dictionary based expansion of content).
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 5a2c4e3..d4d9b13 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -265,7 +265,7 @@ extern const char kRestoreLastSession[];
extern const char kSbInfoURLPrefix[];
extern const char kSbMacKeyURLPrefix[];
extern const char kSbDisableAutoUpdate[];
-extern const char kSbEnableDownloadProtection[];
+extern const char kSbDisableDownloadProtection[];
extern const char kSbEnableDownloadWarningUI[];
extern const char kSdchFilter[];
extern const char kSearchInOmniboxHint[];