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

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

Issue 7119003: Create a browser feature extractor that runs after the renderer has (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add new files Created 9 years, 6 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 d22931086a5cc4114f9ef9cc7427913fce8e91f0..fbe1cd60721ba81d0f23fe91d7c7bf51fa57fab8 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host.h
+++ b/chrome/browser/safe_browsing/client_side_detection_host.h
@@ -17,7 +17,8 @@
class TabContents;
namespace safe_browsing {
-
+class BrowserFeatureExtractor;
+class ClientPhishingRequest;
class ClientSideDetectionService;
// This class is used to receive the IPC from the renderer which
@@ -28,7 +29,7 @@ class ClientSideDetectionService;
class ClientSideDetectionHost : public TabContentsObserver {
public:
// The caller keeps ownership of the tab object and is responsible for
- // ensuring that it stays valid for the entire lifetime of this object.
+ // ensuring that it stays valid until TabContentsDestroyed is called.
static ClientSideDetectionHost* Create(TabContents* tab);
virtual ~ClientSideDetectionHost();
@@ -42,6 +43,10 @@ class ClientSideDetectionHost : public TabContentsObserver {
const content::LoadCommittedDetails& details,
const ViewHostMsg_FrameNavigate_Params& params);
+ protected:
+ // From TabContentsObserver. Called when the TabContents is being destroyed.
+ virtual void TabContentsDestroyed(TabContents* tab);
+
private:
friend class ClientSideDetectionHostTest;
class ShouldClassifyUrlRequest;
@@ -57,6 +62,11 @@ class ClientSideDetectionHost : public TabContentsObserver {
// Otherwise, we do nothing. Called in UI thread.
void MaybeShowPhishingWarning(GURL phishing_url, bool is_phishing);
+ // Callback that is called when the browser feature extractor is done.
+ // This method is responsible for deleting the request object. Called on
+ // the UI thread.
+ void FeatureExtractionDone(bool success, ClientPhishingRequest* request);
+
// Used for testing. This function does not take ownership of the service
// class.
void set_client_side_detection_service(ClientSideDetectionService* service);
@@ -72,6 +82,8 @@ class ClientSideDetectionHost : public TabContentsObserver {
// Keep a handle to the latest classification request so that we can cancel
// it if necessary.
scoped_refptr<ShouldClassifyUrlRequest> classification_request_;
+ // Browser-side feature extractor.
+ scoped_ptr<BrowserFeatureExtractor> feature_extractor_;
base::ScopedCallbackFactory<ClientSideDetectionHost> cb_factory_;

Powered by Google App Engine
This is Rietveld 408576698