Commit 7cd21209 authored by gab's avatar gab Committed by Commit bot

Fix uninitialized member in SafeBrowsingDatabaseNew.

Switch to using delegating constructors (https://chromium-cpp.appspot.com/) to streamline initialization.

This was probably not an issue in practice as |change_detected_| is only read in UpdateFinished() and is always set in UpdateStarted().

BUG=Uninitialized |change_detected_| member.

Review URL: https://codereview.chromium.org/745673002

Cr-Commit-Position: refs/heads/master@{#305103}
parent 24988063
...@@ -344,7 +344,7 @@ class SafeBrowsingDatabaseFactoryImpl : public SafeBrowsingDatabaseFactory { ...@@ -344,7 +344,7 @@ class SafeBrowsingDatabaseFactoryImpl : public SafeBrowsingDatabaseFactory {
// static // static
SafeBrowsingDatabaseFactory* SafeBrowsingDatabase::factory_ = NULL; SafeBrowsingDatabaseFactory* SafeBrowsingDatabase::factory_ = NULL;
// Factory method, non-thread safe. Caller has to make sure this s called // Factory method, non-thread safe. Caller has to make sure this is called
// on SafeBrowsing Thread. // on SafeBrowsing Thread.
// TODO(shess): There's no need for a factory any longer. Convert // TODO(shess): There's no need for a factory any longer. Convert
// SafeBrowsingDatabaseNew to SafeBrowsingDatabase, and have Create() // SafeBrowsingDatabaseNew to SafeBrowsingDatabase, and have Create()
...@@ -460,11 +460,14 @@ void SafeBrowsingDatabase::RecordFailure(FailureType failure_type) { ...@@ -460,11 +460,14 @@ void SafeBrowsingDatabase::RecordFailure(FailureType failure_type) {
} }
SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew() SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew()
: creation_loop_(base::MessageLoop::current()), : SafeBrowsingDatabaseNew(new SafeBrowsingStoreFile,
browse_store_(new SafeBrowsingStoreFile), NULL,
corruption_detected_(false), NULL,
change_detected_(false), NULL,
reset_factory_(this) { NULL,
NULL,
NULL,
NULL) {
DCHECK(browse_store_.get()); DCHECK(browse_store_.get());
DCHECK(!download_store_.get()); DCHECK(!download_store_.get());
DCHECK(!csd_whitelist_store_.get()); DCHECK(!csd_whitelist_store_.get());
...@@ -494,6 +497,7 @@ SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew( ...@@ -494,6 +497,7 @@ SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew(
ip_blacklist_store_(ip_blacklist_store), ip_blacklist_store_(ip_blacklist_store),
unwanted_software_store_(unwanted_software_store), unwanted_software_store_(unwanted_software_store),
corruption_detected_(false), corruption_detected_(false),
change_detected_(false),
reset_factory_(this) { reset_factory_(this) {
DCHECK(browse_store_.get()); DCHECK(browse_store_.get());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment