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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 8417040: Measure how often downloaded executables match the download whitelist. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Address Brian's comment. Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/safe_browsing/protocol_parser_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 // enabled. 906 // enabled.
907 #ifdef OS_CHROMEOS 907 #ifdef OS_CHROMEOS
908 // Client-side detection is disabled on ChromeOS for now, so don't bother 908 // Client-side detection is disabled on ChromeOS for now, so don't bother
909 // downloading the whitelist. 909 // downloading the whitelist.
910 enable_csd_whitelist_ = false; 910 enable_csd_whitelist_ = false;
911 #else 911 #else
912 enable_csd_whitelist_ = 912 enable_csd_whitelist_ =
913 !cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection); 913 !cmdline->HasSwitch(switches::kDisableClientSidePhishingDetection);
914 #endif 914 #endif
915 915
916 enable_download_whitelist_ = cmdline->HasSwitch( 916 // TODO(noelutz): remove this boolean variable since it should always be true
917 switches::kEnableImprovedDownloadProtection); 917 // if SafeBrowsing is enabled. Unfortunately, we have no test data for this
918 // list right now. This means that we need to be able to disable this list
919 // for the SafeBrowsing test to pass.
920 enable_download_whitelist_ = enable_csd_whitelist_;
918 921
919 BrowserThread::PostTask( 922 BrowserThread::PostTask(
920 BrowserThread::IO, FROM_HERE, 923 BrowserThread::IO, FROM_HERE,
921 NewRunnableMethod( 924 NewRunnableMethod(
922 this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key, 925 this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key,
923 request_context_getter)); 926 request_context_getter));
924 } 927 }
925 928
926 void SafeBrowsingService::Stop() { 929 void SafeBrowsingService::Stop() {
927 BrowserThread::PostTask( 930 BrowserThread::PostTask(
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 Stop(); 1359 Stop();
1357 1360
1358 if (csd_service_.get()) 1361 if (csd_service_.get())
1359 csd_service_->SetEnabledAndRefreshState(enable); 1362 csd_service_->SetEnabledAndRefreshState(enable);
1360 if (download_service_.get()) { 1363 if (download_service_.get()) {
1361 download_service_->SetEnabled( 1364 download_service_->SetEnabled(
1362 enable && CommandLine::ForCurrentProcess()->HasSwitch( 1365 enable && CommandLine::ForCurrentProcess()->HasSwitch(
1363 switches::kEnableImprovedDownloadProtection)); 1366 switches::kEnableImprovedDownloadProtection));
1364 } 1367 }
1365 } 1368 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/protocol_parser_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698