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

Side by Side Diff: chrome/renderer/safe_browsing/phishing_classifier.cc

Issue 698263003: [chrome/common/renderer/media && chrome/common/renderer/safe_browsing] Convert VLOGs to DVLOGs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer/safe_browsing/phishing_classifier.h" 5 #include "chrome/renderer/safe_browsing/phishing_classifier.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 // Hash all of the features so that they match the model, then compute 187 // Hash all of the features so that they match the model, then compute
188 // the score. 188 // the score.
189 FeatureMap hashed_features; 189 FeatureMap hashed_features;
190 ClientPhishingRequest verdict; 190 ClientPhishingRequest verdict;
191 verdict.set_model_version(scorer_->model_version()); 191 verdict.set_model_version(scorer_->model_version());
192 verdict.set_url(main_frame->document().url().spec()); 192 verdict.set_url(main_frame->document().url().spec());
193 for (base::hash_map<std::string, double>::const_iterator it = 193 for (base::hash_map<std::string, double>::const_iterator it =
194 features_->features().begin(); 194 features_->features().begin();
195 it != features_->features().end(); ++it) { 195 it != features_->features().end(); ++it) {
196 VLOG(2) << "Feature: " << it->first << " = " << it->second; 196 DVLOG(2) << "Feature: " << it->first << " = " << it->second;
197 bool result = hashed_features.AddRealFeature( 197 bool result = hashed_features.AddRealFeature(
198 crypto::SHA256HashString(it->first), it->second); 198 crypto::SHA256HashString(it->first), it->second);
199 DCHECK(result); 199 DCHECK(result);
200 ClientPhishingRequest::Feature* feature = verdict.add_feature_map(); 200 ClientPhishingRequest::Feature* feature = verdict.add_feature_map();
201 feature->set_name(it->first); 201 feature->set_name(it->first);
202 feature->set_value(it->second); 202 feature->set_value(it->second);
203 } 203 }
204 for (std::set<uint32>::const_iterator it = shingle_hashes_->begin(); 204 for (std::set<uint32>::const_iterator it = shingle_hashes_->begin();
205 it != shingle_hashes_->end(); ++it) { 205 it != shingle_hashes_->end(); ++it) {
206 verdict.add_shingle_hashes(*it); 206 verdict.add_shingle_hashes(*it);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 242
243 void PhishingClassifier::Clear() { 243 void PhishingClassifier::Clear() {
244 page_text_ = NULL; 244 page_text_ = NULL;
245 done_callback_.Reset(); 245 done_callback_.Reset();
246 features_.reset(NULL); 246 features_.reset(NULL);
247 shingle_hashes_.reset(NULL); 247 shingle_hashes_.reset(NULL);
248 } 248 }
249 249
250 } // namespace safe_browsing 250 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/renderer/media/cast_udp_transport.cc ('k') | chrome/renderer/safe_browsing/phishing_classifier_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698