diff options
author | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-16 21:22:19 +0000 |
---|---|---|
committer | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-16 21:22:19 +0000 |
commit | ce82c057bf25ea69aede1a546eff032ef3a79c45 (patch) | |
tree | 66921c8fcb6ff572d6e8628f816a0acdd21dd27d /chrome/browser/safe_browsing/safe_browsing_service.cc | |
parent | c7ebcb98313a3726a45325c30e468bf8efd4b80f (diff) | |
download | chromium_src-ce82c057bf25ea69aede1a546eff032ef3a79c45.zip chromium_src-ce82c057bf25ea69aede1a546eff032ef3a79c45.tar.gz chromium_src-ce82c057bf25ea69aede1a546eff032ef3a79c45.tar.bz2 |
Replace SafeBrowsing MAC with downloads over SSL.
BUG=119662
TEST=updated unittests, ran Chrome and verified SB functionality on new profile
Review URL: http://codereview.chromium.org/10069031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132456 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.cc | 61 |
1 files changed, 10 insertions, 51 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 8ab946eb..6b02909e 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -59,14 +59,9 @@ namespace { const FilePath::CharType kCookiesFile[] = FILE_PATH_LITERAL(" Cookies"); // The default URL prefix where browser fetches chunk updates, hashes, -// and reports safe browsing hits. -const char* const kSbDefaultInfoURLPrefix = - "http://safebrowsing.clients.google.com/safebrowsing"; - -// The default URL prefix where browser fetches MAC client key and reports -// malware details. -const char* const kSbDefaultMacKeyURLPrefix = - "https://sb-ssl.google.com/safebrowsing"; +// and reports safe browsing hits and malware details. +const char* const kSbDefaultURLPrefix = + "https://safebrowsing.google.com/safebrowsing"; // When download url check takes this long, client's callback will be called // without waiting for the result. @@ -586,26 +581,11 @@ void SafeBrowsingService::OnBlockingPageDone( } } -void SafeBrowsingService::OnNewMacKeys(const std::string& client_key, - const std::string& wrapped_key) { - PrefService* prefs = g_browser_process->local_state(); - if (prefs) { - prefs->SetString(prefs::kSafeBrowsingClientKey, client_key); - prefs->SetString(prefs::kSafeBrowsingWrappedKey, wrapped_key); - } -} - net::URLRequestContextGetter* SafeBrowsingService::url_request_context() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); return url_request_context_getter_.get(); } -// static -void SafeBrowsingService::RegisterPrefs(PrefService* prefs) { - prefs->RegisterStringPref(prefs::kSafeBrowsingClientKey, ""); - prefs->RegisterStringPref(prefs::kSafeBrowsingWrappedKey, ""); -} - void SafeBrowsingService::ResetDatabase() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(enabled_); @@ -653,9 +633,7 @@ void SafeBrowsingService::DestroyURLRequestContextOnIOThread() { url_request_context_ = NULL; } -void SafeBrowsingService::StartOnIOThread( - const std::string& client_key, - const std::string& wrapped_key) { +void SafeBrowsingService::StartOnIOThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (enabled_) return; @@ -686,24 +664,17 @@ void SafeBrowsingService::StartOnIOThread( bool disable_auto_update = cmdline->HasSwitch(switches::kSbDisableAutoUpdate) || cmdline->HasSwitch(switches::kDisableBackgroundNetworking); - std::string info_url_prefix = - cmdline->HasSwitch(switches::kSbInfoURLPrefix) ? - cmdline->GetSwitchValueASCII(switches::kSbInfoURLPrefix) : - kSbDefaultInfoURLPrefix; - std::string mackey_url_prefix = - cmdline->HasSwitch(switches::kSbMacKeyURLPrefix) ? - cmdline->GetSwitchValueASCII(switches::kSbMacKeyURLPrefix) : - kSbDefaultMacKeyURLPrefix; + std::string url_prefix = + cmdline->HasSwitch(switches::kSbURLPrefix) ? + cmdline->GetSwitchValueASCII(switches::kSbURLPrefix) : + kSbDefaultURLPrefix; DCHECK(!protocol_manager_); protocol_manager_ = SafeBrowsingProtocolManager::Create(this, client_name, - client_key, - wrapped_key, url_request_context_getter_, - info_url_prefix, - mackey_url_prefix, + url_prefix, disable_auto_update); protocol_manager_->Initialize(); @@ -1005,17 +976,6 @@ void SafeBrowsingService::DatabaseUpdateFinished(bool update_succeeded) { void SafeBrowsingService::Start() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - // Retrieve client MAC keys. - PrefService* local_state = g_browser_process->local_state(); - DCHECK(local_state); - std::string client_key, wrapped_key; - if (local_state) { - client_key = - local_state->GetString(prefs::kSafeBrowsingClientKey); - wrapped_key = - local_state->GetString(prefs::kSafeBrowsingWrappedKey); - } - CommandLine* cmdline = CommandLine::ForCurrentProcess(); enable_download_protection_ = !cmdline->HasSwitch(switches::kSbDisableDownloadProtection); @@ -1039,8 +999,7 @@ void SafeBrowsingService::Start() { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&SafeBrowsingService::StartOnIOThread, - this, client_key, wrapped_key)); + base::Bind(&SafeBrowsingService::StartOnIOThread, this)); } void SafeBrowsingService::Stop() { |