diff options
4 files changed, 6 insertions, 8 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc index 730b62b..59e9c6c 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc @@ -44,7 +44,6 @@ static const int kMaxStalenessMinutes = 45; SafeBrowsingDatabaseBloom::SafeBrowsingDatabaseBloom() : db_(NULL), init_(false), - chunk_inserted_callback_(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(reset_factory_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(resume_factory_(this)), did_resume_(false) { @@ -87,7 +86,7 @@ bool SafeBrowsingDatabaseBloom::Init(const std::wstring& filename, } init_ = true; - chunk_inserted_callback_ = chunk_inserted_callback; + chunk_inserted_callback_.reset(chunk_inserted_callback); return true; } @@ -405,7 +404,7 @@ void SafeBrowsingDatabaseBloom::InsertChunks(const std::string& list_name, delete chunks; - if (chunk_inserted_callback_) + if (chunk_inserted_callback_.get()) chunk_inserted_callback_->Run(); } diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.h b/chrome/browser/safe_browsing/safe_browsing_database_bloom.h index e470a64..9569a43 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.h +++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.h @@ -203,7 +203,7 @@ class SafeBrowsingDatabaseBloom : public SafeBrowsingDatabase { std::wstring filename_; // Called after an add/sub chunk is processed. - Callback0::Type* chunk_inserted_callback_; + scoped_ptr<Callback0::Type> chunk_inserted_callback_; // Used to schedule resetting the database because of corruption. ScopedRunnableMethodFactory<SafeBrowsingDatabaseBloom> reset_factory_; diff --git a/chrome/browser/safe_browsing/safe_browsing_database_impl.cc b/chrome/browser/safe_browsing/safe_browsing_database_impl.cc index db25ec7..9f47afd 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_impl.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_impl.cc @@ -64,7 +64,6 @@ SafeBrowsingDatabaseImpl::SafeBrowsingDatabaseImpl() transaction_count_(0), init_(false), asynchronous_(true), - chunk_inserted_callback_(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(process_factory_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(bloom_read_factory_(this)), ALLOW_THIS_IN_INITIALIZER_LIST(bloom_write_factory_(this)), @@ -109,7 +108,7 @@ bool SafeBrowsingDatabaseImpl::Init(const std::wstring& filename, } init_ = true; - chunk_inserted_callback_ = chunk_inserted_callback; + chunk_inserted_callback_.reset(chunk_inserted_callback); return true; } @@ -543,7 +542,7 @@ bool SafeBrowsingDatabaseImpl::ProcessChunks() { } } - if (chunk_inserted_callback_) + if (chunk_inserted_callback_.get()) chunk_inserted_callback_->Run(); return true; diff --git a/chrome/browser/safe_browsing/safe_browsing_database_impl.h b/chrome/browser/safe_browsing/safe_browsing_database_impl.h index 4c46b75..4b47859 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_impl.h +++ b/chrome/browser/safe_browsing/safe_browsing_database_impl.h @@ -242,7 +242,7 @@ class SafeBrowsingDatabaseImpl : public SafeBrowsingDatabase { std::queue<AddDelWork> pending_add_del_; // Called after an add/sub chunk is processed. - Callback0::Type* chunk_inserted_callback_; + scoped_ptr<Callback0::Type> chunk_inserted_callback_; // Used to schedule small bits of work when writing to the database. ScopedRunnableMethodFactory<SafeBrowsingDatabaseImpl> process_factory_; |