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

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

Issue 2062013002: Fetch incremental updates. Store new state in V4Store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git fetch && git pull && gclient sync Created 4 years, 5 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"
11 #include "base/metrics/field_trial.h" 11 #include "base/metrics/field_trial.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 13 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
14 #include "chrome/common/chrome_switches.h" 14 #include "chrome/common/chrome_switches.h"
15 #include "components/safe_browsing_db/v4_local_database_manager.h" 15 #include "components/safe_browsing_db/v4_local_database_manager.h"
16 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
17 17
18 namespace safe_browsing { 18 namespace safe_browsing {
19 19
20 #ifdef NDEBUG
20 namespace { 21 namespace {
21 const base::Feature kSafeBrowsingV4LocalDatabaseManagerEnabled { 22 const base::Feature kSafeBrowsingV4LocalDatabaseManagerEnabled {
22 "SafeBrowsingV4LocalDatabaseManagerEnabled", 23 "SafeBrowsingV4LocalDatabaseManagerEnabled",
23 base::FEATURE_DISABLED_BY_DEFAULT 24 base::FEATURE_DISABLED_BY_DEFAULT
24 }; 25 };
25 } // namespace 26 } // namespace
27 #endif
26 28
27 // static 29 // static
28 std::unique_ptr<ServicesDelegate> ServicesDelegate::Create( 30 std::unique_ptr<ServicesDelegate> ServicesDelegate::Create(
29 SafeBrowsingService* safe_browsing_service) { 31 SafeBrowsingService* safe_browsing_service) {
30 return base::WrapUnique( 32 return base::WrapUnique(
31 new ServicesDelegateImpl(safe_browsing_service, nullptr)); 33 new ServicesDelegateImpl(safe_browsing_service, nullptr));
32 } 34 }
33 35
34 // static 36 // static
35 std::unique_ptr<ServicesDelegate> ServicesDelegate::CreateForTest( 37 std::unique_ptr<ServicesDelegate> ServicesDelegate::CreateForTest(
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (v4_local_database_manager_.get()) { 179 if (v4_local_database_manager_.get()) {
178 v4_local_database_manager_->StopOnIOThread(shutdown); 180 v4_local_database_manager_->StopOnIOThread(shutdown);
179 } 181 }
180 } 182 }
181 183
182 V4LocalDatabaseManager* ServicesDelegateImpl::CreateV4LocalDatabaseManager() { 184 V4LocalDatabaseManager* ServicesDelegateImpl::CreateV4LocalDatabaseManager() {
183 return new V4LocalDatabaseManager(SafeBrowsingService::GetBaseFilename()); 185 return new V4LocalDatabaseManager(SafeBrowsingService::GetBaseFilename());
184 } 186 }
185 187
186 bool ServicesDelegateImpl::IsV4LocalDatabaseManagerEnabled() { 188 bool ServicesDelegateImpl::IsV4LocalDatabaseManagerEnabled() {
189 #ifndef NDEBUG
190 return true;
191 #else
187 return base::FeatureList::IsEnabled( 192 return base::FeatureList::IsEnabled(
188 kSafeBrowsingV4LocalDatabaseManagerEnabled); 193 kSafeBrowsingV4LocalDatabaseManagerEnabled);
194 #endif
189 } 195 }
190 196
191 } // namespace safe_browsing 197 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | components/safe_browsing_db/BUILD.gn » ('j') | components/safe_browsing_db/v4_database.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698