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

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

Issue 2259523003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/safe_browsing_database.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_database.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 public: 282 public:
283 std::unique_ptr<SafeBrowsingDatabase> CreateSafeBrowsingDatabase( 283 std::unique_ptr<SafeBrowsingDatabase> CreateSafeBrowsingDatabase(
284 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, 284 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
285 bool enable_download_protection, 285 bool enable_download_protection,
286 bool enable_client_side_whitelist, 286 bool enable_client_side_whitelist,
287 bool enable_download_whitelist, 287 bool enable_download_whitelist,
288 bool enable_extension_blacklist, 288 bool enable_extension_blacklist,
289 bool enable_ip_blacklist, 289 bool enable_ip_blacklist,
290 bool enable_unwanted_software_list, 290 bool enable_unwanted_software_list,
291 bool enable_module_whitelist) override { 291 bool enable_module_whitelist) override {
292 return base::WrapUnique(new SafeBrowsingDatabaseNew( 292 return base::MakeUnique<SafeBrowsingDatabaseNew>(
293 db_task_runner, CreateStore(true, db_task_runner), // browse_store 293 db_task_runner, CreateStore(true, db_task_runner), // browse_store
294 CreateStore(enable_download_protection, db_task_runner), 294 CreateStore(enable_download_protection, db_task_runner),
295 CreateStore(enable_client_side_whitelist, db_task_runner), 295 CreateStore(enable_client_side_whitelist, db_task_runner),
296 CreateStore(enable_download_whitelist, db_task_runner), 296 CreateStore(enable_download_whitelist, db_task_runner),
297 CreateStore(enable_extension_blacklist, db_task_runner), 297 CreateStore(enable_extension_blacklist, db_task_runner),
298 CreateStore(enable_ip_blacklist, db_task_runner), 298 CreateStore(enable_ip_blacklist, db_task_runner),
299 CreateStore(enable_unwanted_software_list, db_task_runner), 299 CreateStore(enable_unwanted_software_list, db_task_runner),
300 CreateStore(enable_module_whitelist, db_task_runner), 300 CreateStore(enable_module_whitelist, db_task_runner),
301 CreateStore(true, db_task_runner))); // resource_blacklist_store 301 CreateStore(true, db_task_runner)); // resource_blacklist_store
302 } 302 }
303 303
304 SafeBrowsingDatabaseFactoryImpl() {} 304 SafeBrowsingDatabaseFactoryImpl() {}
305 305
306 private: 306 private:
307 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseFactoryImpl); 307 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseFactoryImpl);
308 }; 308 };
309 309
310 // static 310 // static
311 SafeBrowsingDatabaseFactory* SafeBrowsingDatabase::factory_ = NULL; 311 SafeBrowsingDatabaseFactory* SafeBrowsingDatabase::factory_ = NULL;
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 1877
1878 // Histogram properties as in UMA_HISTOGRAM_COUNTS macro. 1878 // Histogram properties as in UMA_HISTOGRAM_COUNTS macro.
1879 base::HistogramBase* histogram_pointer = base::Histogram::FactoryGet( 1879 base::HistogramBase* histogram_pointer = base::Histogram::FactoryGet(
1880 histogram_name, 1, 1000000, 50, 1880 histogram_name, 1, 1000000, 50,
1881 base::HistogramBase::kUmaTargetedHistogramFlag); 1881 base::HistogramBase::kUmaTargetedHistogramFlag);
1882 1882
1883 histogram_pointer->Add(file_size_kilobytes); 1883 histogram_pointer->Add(file_size_kilobytes);
1884 } 1884 }
1885 1885
1886 } // namespace safe_browsing 1886 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698