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

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

Issue 2479093002: Migrate more files to histogram_macros.h from histogram.h. (Closed)
Patch Set: Created 4 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/scorer.h" 5 #include "chrome/renderer/safe_browsing/scorer.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram_macros.h"
13 #include "base/strings/string_piece.h" 13 #include "base/strings/string_piece.h"
14 #include "chrome/common/safe_browsing/client_model.pb.h" 14 #include "chrome/common/safe_browsing/client_model.pb.h"
15 #include "chrome/renderer/safe_browsing/features.h" 15 #include "chrome/renderer/safe_browsing/features.h"
16 16
17 namespace { 17 namespace {
18 // Enum used to keep stats about the status of the Scorer creation. 18 // Enum used to keep stats about the status of the Scorer creation.
19 enum ScorerCreationStatus { 19 enum ScorerCreationStatus {
20 SCORER_SUCCESS, 20 SCORER_SUCCESS,
21 SCORER_FAIL_MODEL_OPEN_FAIL, // Not used anymore 21 SCORER_FAIL_MODEL_OPEN_FAIL, // Not used anymore
22 SCORER_FAIL_MODEL_FILE_EMPTY, // Not used anymore 22 SCORER_FAIL_MODEL_FILE_EMPTY, // Not used anymore
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // If the feature of the rule does not exist in the given feature map the 123 // If the feature of the rule does not exist in the given feature map the
124 // feature weight is considered to be zero. If the feature weight is zero 124 // feature weight is considered to be zero. If the feature weight is zero
125 // we leave early since we know that the rule score will be zero. 125 // we leave early since we know that the rule score will be zero.
126 return 0.0; 126 return 0.0;
127 } 127 }
128 rule_score *= it->second; 128 rule_score *= it->second;
129 } 129 }
130 return rule_score * rule.weight(); 130 return rule_score * rule.weight();
131 } 131 }
132 } // namespace safe_browsing 132 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/renderer/safe_browsing/phishing_url_feature_extractor.cc ('k') | chrome/service/cloud_print/cloud_print_auth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698