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

Unified Diff: chrome/browser/safe_browsing/browser_feature_extractor.h

Issue 7746011: Revert 98168, it caused compile errors on mac: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/browser_feature_extractor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/browser_feature_extractor.h
===================================================================
--- chrome/browser/safe_browsing/browser_feature_extractor.h (revision 98169)
+++ chrome/browser/safe_browsing/browser_feature_extractor.h (working copy)
@@ -13,7 +13,6 @@
#include <map>
#include <set>
-#include <string>
#include <utility>
#include "base/basictypes.h"
@@ -45,6 +44,65 @@
~BrowseInfo();
};
+namespace features {
+
+// TODO(noelutz): move renderer/safe_browsing/features.h to common.
+////////////////////////////////////////////////////
+// History features.
+////////////////////////////////////////////////////
+
+// Number of visits to that URL stored in the browser history.
+// Should always be an integer larger than 1 because by the time
+// we lookup the history the current URL should already be stored there.
+extern const char kUrlHistoryVisitCount[];
+
+// Number of times the URL was typed in the Omnibox.
+extern const char kUrlHistoryTypedCount[];
+
+// Number of times the URL was reached by clicking a link.
+extern const char kUrlHistoryLinkCount[];
+
+// Number of times URL was visited more than 24h ago.
+extern const char kUrlHistoryVisitCountMoreThan24hAgo[];
+
+// Number of user-visible visits to all URLs on the same host/port as
+// the URL for HTTP and HTTPs.
+extern const char kHttpHostVisitCount[];
+extern const char kHttpsHostVisitCount[];
+
+// Boolean feature which is true if the host was visited for the first
+// time more than 24h ago (only considers user-visible visits like above).
+extern const char kFirstHttpHostVisitMoreThan24hAgo[];
+extern const char kFirstHttpsHostVisitMoreThan24hAgo[];
+
+////////////////////////////////////////////////////
+// Browse features.
+////////////////////////////////////////////////////
+// Note that these features may have the following prefixes appended to them
+// that tell for which page type the feature pertains.
+extern const char kHostPrefix[];
+extern const char kRedirectPrefix[];
+
+// Referrer
+extern const char kReferrer[];
+// True if the referrer was stripped because it is an SSL referrer.
+extern const char kHasSSLReferrer[];
+// Stores the page transition. See: PageTransition. We strip the qualifier.
+extern const char kPageTransitionType[];
+// True if this navigation is the first for this tab.
+extern const char kIsFirstNavigation[];
+
+// Resource was fetched from a known bad IP address.
+extern const char kBadIpFetch[];
+
+// SafeBrowsing related featues. Fields from the UnsafeResource if there is
+// any.
+extern const char kSafeBrowsingMaliciousUrl[];
+extern const char kSafeBrowsingOriginalUrl[];
+extern const char kSafeBrowsingIsSubresource[];
+extern const char kSafeBrowsingThreatType[];
+} // namespace features
+
// All methods of this class must be called on the UI thread (including
// the constructor).
class BrowserFeatureExtractor {
@@ -74,10 +132,6 @@
ClientPhishingRequest* request,
DoneCallback* callback);
- // The size of hash prefix to use for
- // ClientPhishingRequest.suffix_prefix_hash. Public for testing.
- static const int kSuffixPrefixHashLength;
-
private:
friend class DeleteTask<BrowserFeatureExtractor>;
typedef std::pair<ClientPhishingRequest*, DoneCallback*> ExtractionData;
@@ -139,10 +193,6 @@
// is set it will return true and false otherwise.
bool GetHistoryService(HistoryService** history);
- // Computes the SHA-256 hash prefix for the URL and adds it to the
- // ClientPhishingRequest.
- void ComputeURLHash(ClientPhishingRequest* request);
-
TabContents* tab_;
ClientSideDetectionService* service_;
CancelableRequestConsumer request_consumer_;
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/browser_feature_extractor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698