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

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

Issue 2675063002: Browser tests for using the new SafeBrowsing protocol (v4) (Closed)
Patch Set: Use ANNOTATE_LEAKING_OBJECT_PTR 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/services_delegate_impl.h" 5 #include "chrome/browser/safe_browsing/services_delegate_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 ExtendedReportingLevel 57 ExtendedReportingLevel
58 ServicesDelegateImpl::GetEstimatedExtendedReportingLevel() const { 58 ServicesDelegateImpl::GetEstimatedExtendedReportingLevel() const {
59 return safe_browsing_service_->estimated_extended_reporting_by_prefs(); 59 return safe_browsing_service_->estimated_extended_reporting_by_prefs();
60 } 60 }
61 61
62 const scoped_refptr<SafeBrowsingDatabaseManager>& 62 const scoped_refptr<SafeBrowsingDatabaseManager>&
63 ServicesDelegateImpl::v4_local_database_manager() const { 63 ServicesDelegateImpl::v4_local_database_manager() const {
64 return v4_local_database_manager_; 64 return v4_local_database_manager_;
65 } 65 }
66 66
67 void ServicesDelegateImpl::Initialize() { 67 void ServicesDelegateImpl::Initialize(bool v4_enabled) {
68 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 68 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
69 69
70 v4_local_database_manager_ = V4LocalDatabaseManager::Create( 70 if (v4_enabled) {
71 SafeBrowsingService::GetBaseFilename(), 71 v4_local_database_manager_ = V4LocalDatabaseManager::Create(
72 base::Bind(&ServicesDelegateImpl::GetEstimatedExtendedReportingLevel, 72 SafeBrowsingService::GetBaseFilename(),
73 base::Unretained(this))); 73 base::Bind(&ServicesDelegateImpl::GetEstimatedExtendedReportingLevel,
74 base::Unretained(this)));
75 }
74 76
75 download_service_.reset( 77 download_service_.reset(
76 (services_creator_ && 78 (services_creator_ &&
77 services_creator_->CanCreateDownloadProtectionService()) 79 services_creator_->CanCreateDownloadProtectionService())
78 ? services_creator_->CreateDownloadProtectionService() 80 ? services_creator_->CreateDownloadProtectionService()
79 : CreateDownloadProtectionService()); 81 : CreateDownloadProtectionService());
80 incident_service_.reset( 82 incident_service_.reset(
81 (services_creator_ && 83 (services_creator_ &&
82 services_creator_->CanCreateIncidentReportingService()) 84 services_creator_->CanCreateIncidentReportingService())
83 ? services_creator_->CreateIncidentReportingService() 85 ? services_creator_->CreateIncidentReportingService()
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 179 }
178 } 180 }
179 181
180 void ServicesDelegateImpl::StopOnIOThread(bool shutdown) { 182 void ServicesDelegateImpl::StopOnIOThread(bool shutdown) {
181 if (v4_local_database_manager_.get()) { 183 if (v4_local_database_manager_.get()) {
182 v4_local_database_manager_->StopOnIOThread(shutdown); 184 v4_local_database_manager_->StopOnIOThread(shutdown);
183 } 185 }
184 } 186 }
185 187
186 } // namespace safe_browsing 188 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/services_delegate_impl.h ('k') | chrome/browser/safe_browsing/services_delegate_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698