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

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

Issue 173133004: Separate pre-classification checks for client-side malware and phishing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set right enum type for boolean histograms. Created 6 years, 9 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
Index: chrome/browser/safe_browsing/client_side_detection_host.h
diff --git a/chrome/browser/safe_browsing/client_side_detection_host.h b/chrome/browser/safe_browsing/client_side_detection_host.h
index c5cf95acbbd3a0a6a589fce8372ee09086564f9f..1492f13b541e3e9e8500d16cc524fdba985b4211 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host.h
+++ b/chrome/browser/safe_browsing/client_side_detection_host.h
@@ -79,6 +79,11 @@ class ClientSideDetectionHost : public content::WebContentsObserver,
class ShouldClassifyUrlRequest;
friend class ShouldClassifyUrlRequest;
+ // These methods are called when pre-classification checks are done for
+ // the phishing and malware clasifiers.
+ void OnPhishingPreClassificationDone(bool should_classify);
+ void OnMalwarePreClassificationDone(bool should_classify);
+
// Verdict is an encoded ClientPhishingRequest protocol message.
void OnPhishingDetectionDone(const std::string& verdict);
@@ -98,10 +103,14 @@ class ClientSideDetectionHost : public content::WebContentsObserver,
// the UI thread.
void FeatureExtractionDone(bool success, ClientPhishingRequest* request);
+ // Start malware classification once the onload handler was called and
+ // malware pre-classification checks are done and passed.
+ void MaybeStartMalwareFeatureExtraction();
+
// Function to be called when the browser malware feature extractor is done.
// Called on the UI thread.
- void MalwareFeatureExtractionDone(bool success,
- scoped_ptr<ClientMalwareRequest> request);
+ void MalwareFeatureExtractionDone(
+ bool success, scoped_ptr<ClientMalwareRequest> request);
// Update the entries in browse_info_->ips map.
void UpdateIPUrlMap(const std::string& ip,
@@ -116,6 +125,10 @@ class ClientSideDetectionHost : public content::WebContentsObserver,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // Inherited from WebContentsObserver. This is called once the onload handler
+ // is called.
+ virtual void DocumentOnLoadCompletedInMainFrame(int32 page_id) OVERRIDE;
+
// Returns true if the user has seen a regular SafeBrowsing
// interstitial for the current page. This is only true if the user has
// actually clicked through the warning. This method is called on the UI
@@ -126,10 +139,6 @@ class ClientSideDetectionHost : public content::WebContentsObserver,
// class.
void set_client_side_detection_service(ClientSideDetectionService* service);
- // Get/Set malware_killswitch_on_ value. These methods called on UI thread.
- bool MalwareKillSwitchIsOn();
- void SetMalwareKillSwitch(bool killswitch_on);
-
// This pointer may be NULL if client-side phishing detection is disabled.
ClientSideDetectionService* csd_service_;
// These pointers may be NULL if SafeBrowsing is disabled.
@@ -158,6 +167,10 @@ class ClientSideDetectionHost : public content::WebContentsObserver,
// Max number of urls we report for each malware IP.
static const int kMaxUrlsPerIP;
+ bool should_extract_malware_features_;
+ bool should_classify_for_malware_;
+ bool onload_complete_;
+
base::WeakPtrFactory<ClientSideDetectionHost> weak_factory_;
// Unique page ID of the most recent unsafe site that was loaded in this tab
@@ -165,14 +178,6 @@ class ClientSideDetectionHost : public content::WebContentsObserver,
int unsafe_unique_page_id_;
scoped_ptr<SafeBrowsingUIManager::UnsafeResource> unsafe_resource_;
- // Whether the malware IP matching feature killswitch is on.
- // This should be accessed from UI thread.
- bool malware_killswitch_on_;
-
- // Whether the malware bad ip matching and report feature is enabled.
- // This should be accessed from UI thread.
- bool malware_report_enabled_;
-
DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionHost);
};
« no previous file with comments | « chrome/browser/safe_browsing/browser_feature_extractor.cc ('k') | chrome/browser/safe_browsing/client_side_detection_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698