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

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

Issue 2648193002: SafeBrowsing: Move enabled_ to base class DB Manager (Closed)
Patch Set: Update comments Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/local_database_manager.h" 5 #include "chrome/browser/safe_browsing/local_database_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 } else { 265 } else {
266 NOTREACHED(); 266 NOTREACHED();
267 } 267 }
268 } 268 }
269 269
270 LocalSafeBrowsingDatabaseManager::LocalSafeBrowsingDatabaseManager( 270 LocalSafeBrowsingDatabaseManager::LocalSafeBrowsingDatabaseManager(
271 const scoped_refptr<SafeBrowsingService>& service) 271 const scoped_refptr<SafeBrowsingService>& service)
272 : sb_service_(service), 272 : sb_service_(service),
273 database_(NULL), 273 database_(NULL),
274 enabled_(false),
275 enable_download_protection_(false), 274 enable_download_protection_(false),
276 enable_csd_whitelist_(false), 275 enable_csd_whitelist_(false),
277 enable_download_whitelist_(false), 276 enable_download_whitelist_(false),
278 enable_extension_blacklist_(false), 277 enable_extension_blacklist_(false),
279 enable_ip_blacklist_(false), 278 enable_ip_blacklist_(false),
280 enable_unwanted_software_blacklist_(true), 279 enable_unwanted_software_blacklist_(true),
281 enable_module_whitelist_(true), 280 enable_module_whitelist_(true),
282 update_in_progress_(false), 281 update_in_progress_(false),
283 database_update_in_progress_(false), 282 database_update_in_progress_(false),
284 closing_database_(false), 283 closing_database_(false),
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); 684 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
686 } 685 }
687 686
688 enabled_ = true; 687 enabled_ = true;
689 688
690 MakeDatabaseAvailable(); 689 MakeDatabaseAvailable();
691 } 690 }
692 691
693 void LocalSafeBrowsingDatabaseManager::StopOnIOThread(bool shutdown) { 692 void LocalSafeBrowsingDatabaseManager::StopOnIOThread(bool shutdown) {
694 DCHECK_CURRENTLY_ON(BrowserThread::IO); 693 DCHECK_CURRENTLY_ON(BrowserThread::IO);
695 SafeBrowsingDatabaseManager::StopOnIOThread(shutdown);
696 694
697 DoStopOnIOThread(); 695 DoStopOnIOThread();
698 if (shutdown) { 696 if (shutdown) {
699 sb_service_ = NULL; 697 sb_service_ = NULL;
700 } 698 }
699
700 SafeBrowsingDatabaseManager::StopOnIOThread(shutdown);
701 } 701 }
702 702
703 void LocalSafeBrowsingDatabaseManager::NotifyDatabaseUpdateFinished( 703 void LocalSafeBrowsingDatabaseManager::NotifyDatabaseUpdateFinished(
704 bool update_succeeded) { 704 bool update_succeeded) {
705 DCHECK_CURRENTLY_ON(BrowserThread::UI); 705 DCHECK_CURRENTLY_ON(BrowserThread::UI);
706 content::NotificationService::current()->Notify( 706 content::NotificationService::current()->Notify(
707 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, 707 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE,
708 content::Source<SafeBrowsingDatabaseManager>(this), 708 content::Source<SafeBrowsingDatabaseManager>(this),
709 content::Details<bool>(&update_succeeded)); 709 content::Details<bool>(&update_succeeded));
710 } 710 }
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 base::Bind(&LocalSafeBrowsingDatabaseManager::TimeoutCallback, 1242 base::Bind(&LocalSafeBrowsingDatabaseManager::TimeoutCallback,
1243 check_ptr->weak_ptr_factory_->GetWeakPtr(), check_ptr), 1243 check_ptr->weak_ptr_factory_->GetWeakPtr(), check_ptr),
1244 check_timeout_); 1244 check_timeout_);
1245 } 1245 }
1246 1246
1247 bool LocalSafeBrowsingDatabaseManager::IsDownloadProtectionEnabled() const { 1247 bool LocalSafeBrowsingDatabaseManager::IsDownloadProtectionEnabled() const {
1248 return enable_download_protection_; 1248 return enable_download_protection_;
1249 } 1249 }
1250 1250
1251 } // namespace safe_browsing 1251 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/local_database_manager.h ('k') | components/safe_browsing_db/database_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698