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

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

Issue 745673002: Fix uninitialized member in SafeBrowsingDatabaseNew (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a1_pythonSBfix
Patch Set: Created 6 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
« no previous file with comments | « no previous file | 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) 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 <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 SafeBrowsingDatabaseFactoryImpl() { } 338 SafeBrowsingDatabaseFactoryImpl() { }
339 339
340 private: 340 private:
341 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseFactoryImpl); 341 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingDatabaseFactoryImpl);
342 }; 342 };
343 343
344 // static 344 // static
345 SafeBrowsingDatabaseFactory* SafeBrowsingDatabase::factory_ = NULL; 345 SafeBrowsingDatabaseFactory* SafeBrowsingDatabase::factory_ = NULL;
346 346
347 // Factory method, non-thread safe. Caller has to make sure this s called 347 // Factory method, non-thread safe. Caller has to make sure this is called
348 // on SafeBrowsing Thread. 348 // on SafeBrowsing Thread.
349 // TODO(shess): There's no need for a factory any longer. Convert 349 // TODO(shess): There's no need for a factory any longer. Convert
350 // SafeBrowsingDatabaseNew to SafeBrowsingDatabase, and have Create() 350 // SafeBrowsingDatabaseNew to SafeBrowsingDatabase, and have Create()
351 // callers just construct things directly. 351 // callers just construct things directly.
352 SafeBrowsingDatabase* SafeBrowsingDatabase::Create( 352 SafeBrowsingDatabase* SafeBrowsingDatabase::Create(
353 bool enable_download_protection, 353 bool enable_download_protection,
354 bool enable_client_side_whitelist, 354 bool enable_client_side_whitelist,
355 bool enable_download_whitelist, 355 bool enable_download_whitelist,
356 bool enable_extension_blacklist, 356 bool enable_extension_blacklist,
357 bool enable_side_effect_free_whitelist, 357 bool enable_side_effect_free_whitelist,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 return NULL; 453 return NULL;
454 } 454 }
455 455
456 // static 456 // static
457 void SafeBrowsingDatabase::RecordFailure(FailureType failure_type) { 457 void SafeBrowsingDatabase::RecordFailure(FailureType failure_type) {
458 UMA_HISTOGRAM_ENUMERATION("SB2.DatabaseFailure", failure_type, 458 UMA_HISTOGRAM_ENUMERATION("SB2.DatabaseFailure", failure_type,
459 FAILURE_DATABASE_MAX); 459 FAILURE_DATABASE_MAX);
460 } 460 }
461 461
462 SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew() 462 SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew()
463 : creation_loop_(base::MessageLoop::current()), 463 : SafeBrowsingDatabaseNew(new SafeBrowsingStoreFile,
464 browse_store_(new SafeBrowsingStoreFile), 464 NULL,
465 corruption_detected_(false), 465 NULL,
466 change_detected_(false), 466 NULL,
467 reset_factory_(this) { 467 NULL,
468 NULL,
469 NULL,
470 NULL) {
468 DCHECK(browse_store_.get()); 471 DCHECK(browse_store_.get());
469 DCHECK(!download_store_.get()); 472 DCHECK(!download_store_.get());
470 DCHECK(!csd_whitelist_store_.get()); 473 DCHECK(!csd_whitelist_store_.get());
471 DCHECK(!download_whitelist_store_.get()); 474 DCHECK(!download_whitelist_store_.get());
472 DCHECK(!extension_blacklist_store_.get()); 475 DCHECK(!extension_blacklist_store_.get());
473 DCHECK(!side_effect_free_whitelist_store_.get()); 476 DCHECK(!side_effect_free_whitelist_store_.get());
474 DCHECK(!ip_blacklist_store_.get()); 477 DCHECK(!ip_blacklist_store_.get());
475 DCHECK(!unwanted_software_store_.get()); 478 DCHECK(!unwanted_software_store_.get());
476 } 479 }
477 480
478 SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew( 481 SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew(
479 SafeBrowsingStore* browse_store, 482 SafeBrowsingStore* browse_store,
480 SafeBrowsingStore* download_store, 483 SafeBrowsingStore* download_store,
481 SafeBrowsingStore* csd_whitelist_store, 484 SafeBrowsingStore* csd_whitelist_store,
482 SafeBrowsingStore* download_whitelist_store, 485 SafeBrowsingStore* download_whitelist_store,
483 SafeBrowsingStore* extension_blacklist_store, 486 SafeBrowsingStore* extension_blacklist_store,
484 SafeBrowsingStore* side_effect_free_whitelist_store, 487 SafeBrowsingStore* side_effect_free_whitelist_store,
485 SafeBrowsingStore* ip_blacklist_store, 488 SafeBrowsingStore* ip_blacklist_store,
486 SafeBrowsingStore* unwanted_software_store) 489 SafeBrowsingStore* unwanted_software_store)
487 : creation_loop_(base::MessageLoop::current()), 490 : creation_loop_(base::MessageLoop::current()),
488 browse_store_(browse_store), 491 browse_store_(browse_store),
489 download_store_(download_store), 492 download_store_(download_store),
490 csd_whitelist_store_(csd_whitelist_store), 493 csd_whitelist_store_(csd_whitelist_store),
491 download_whitelist_store_(download_whitelist_store), 494 download_whitelist_store_(download_whitelist_store),
492 extension_blacklist_store_(extension_blacklist_store), 495 extension_blacklist_store_(extension_blacklist_store),
493 side_effect_free_whitelist_store_(side_effect_free_whitelist_store), 496 side_effect_free_whitelist_store_(side_effect_free_whitelist_store),
494 ip_blacklist_store_(ip_blacklist_store), 497 ip_blacklist_store_(ip_blacklist_store),
495 unwanted_software_store_(unwanted_software_store), 498 unwanted_software_store_(unwanted_software_store),
496 corruption_detected_(false), 499 corruption_detected_(false),
500 change_detected_(false),
497 reset_factory_(this) { 501 reset_factory_(this) {
498 DCHECK(browse_store_.get()); 502 DCHECK(browse_store_.get());
499 } 503 }
500 504
501 SafeBrowsingDatabaseNew::~SafeBrowsingDatabaseNew() { 505 SafeBrowsingDatabaseNew::~SafeBrowsingDatabaseNew() {
502 // The DCHECK is disabled due to crbug.com/338486 . 506 // The DCHECK is disabled due to crbug.com/338486 .
503 // DCHECK_EQ(creation_loop_, base::MessageLoop::current()); 507 // DCHECK_EQ(creation_loop_, base::MessageLoop::current());
504 } 508 }
505 509
506 void SafeBrowsingDatabaseNew::Init(const base::FilePath& filename_base) { 510 void SafeBrowsingDatabaseNew::Init(const base::FilePath& filename_base) {
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 bool SafeBrowsingDatabaseNew::IsMalwareIPMatchKillSwitchOn() { 1676 bool SafeBrowsingDatabaseNew::IsMalwareIPMatchKillSwitchOn() {
1673 SBFullHash malware_kill_switch = SBFullHashForString(kMalwareIPKillSwitchUrl); 1677 SBFullHash malware_kill_switch = SBFullHashForString(kMalwareIPKillSwitchUrl);
1674 std::vector<SBFullHash> full_hashes; 1678 std::vector<SBFullHash> full_hashes;
1675 full_hashes.push_back(malware_kill_switch); 1679 full_hashes.push_back(malware_kill_switch);
1676 return ContainsWhitelistedHashes(csd_whitelist_, full_hashes); 1680 return ContainsWhitelistedHashes(csd_whitelist_, full_hashes);
1677 } 1681 }
1678 1682
1679 bool SafeBrowsingDatabaseNew::IsCsdWhitelistKillSwitchOn() { 1683 bool SafeBrowsingDatabaseNew::IsCsdWhitelistKillSwitchOn() {
1680 return csd_whitelist_.second; 1684 return csd_whitelist_.second;
1681 } 1685 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698