| Index: chrome/renderer/safe_browsing/phishing_term_feature_extractor.cc
|
| diff --git a/chrome/renderer/safe_browsing/phishing_term_feature_extractor.cc b/chrome/renderer/safe_browsing/phishing_term_feature_extractor.cc
|
| index 47161b9ae400d109be685330e3a6df6e770a8fae..082f9e1023be2774b4c60211a26997802ad5363f 100644
|
| --- a/chrome/renderer/safe_browsing/phishing_term_feature_extractor.cc
|
| +++ b/chrome/renderer/safe_browsing/phishing_term_feature_extractor.cc
|
| @@ -115,7 +115,7 @@ PhishingTermFeatureExtractor::~PhishingTermFeatureExtractor() {
|
| void PhishingTermFeatureExtractor::ExtractFeatures(
|
| const string16* page_text,
|
| FeatureMap* features,
|
| - DoneCallback* done_callback) {
|
| + const DoneCallback& done_callback) {
|
| // The RenderView should have called CancelPendingExtraction() before
|
| // starting a new extraction, so DCHECK this.
|
| CheckNoPendingExtraction();
|
| @@ -125,7 +125,7 @@ void PhishingTermFeatureExtractor::ExtractFeatures(
|
|
|
| page_text_ = page_text;
|
| features_ = features;
|
| - done_callback_.reset(done_callback);
|
| + done_callback_ = done_callback;
|
|
|
| state_.reset(new ExtractionState(*page_text_, clock_->Now()));
|
| MessageLoop::current()->PostTask(
|
| @@ -277,9 +277,9 @@ void PhishingTermFeatureExtractor::HandleWord(
|
| }
|
|
|
| void PhishingTermFeatureExtractor::CheckNoPendingExtraction() {
|
| - DCHECK(!done_callback_.get());
|
| + DCHECK(done_callback_.is_null());
|
| DCHECK(!state_.get());
|
| - if (done_callback_.get() || state_.get()) {
|
| + if (!done_callback_.is_null() || state_.get()) {
|
| LOG(ERROR) << "Extraction in progress, missing call to "
|
| << "CancelPendingExtraction";
|
| }
|
| @@ -294,15 +294,15 @@ void PhishingTermFeatureExtractor::RunCallback(bool success) {
|
| UMA_HISTOGRAM_TIMES("SBClientPhishing.TermFeatureTotalTime",
|
| clock_->Now() - state_->start_time);
|
|
|
| - DCHECK(done_callback_.get());
|
| - done_callback_->Run(success);
|
| + DCHECK(!done_callback_.is_null());
|
| + done_callback_.Run(success);
|
| Clear();
|
| }
|
|
|
| void PhishingTermFeatureExtractor::Clear() {
|
| page_text_ = NULL;
|
| features_ = NULL;
|
| - done_callback_.reset(NULL);
|
| + done_callback_.Reset();
|
| state_.reset(NULL);
|
| negative_word_cache_.Clear();
|
| }
|
|
|