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

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

Issue 6398001: Run pre-classification checks in the browser before starting client-side phishing detection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Noe's review comments Created 9 years, 10 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/client_side_detection_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/client_side_detection_service.h
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.h b/chrome/browser/safe_browsing/client_side_detection_service.h
index a9bc7f6966ddfb82ccc5d9ce970795b6ddc8ea58..c299ca62239591004f3402ebf22aaee0851cec75 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.h
+++ b/chrome/browser/safe_browsing/client_side_detection_service.h
@@ -33,6 +33,8 @@
#include "base/time.h"
#include "chrome/browser/safe_browsing/csd.pb.h"
#include "chrome/common/net/url_fetcher.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
class URLRequestContextGetter;
@@ -43,7 +45,8 @@ class URLRequestStatus;
namespace safe_browsing {
-class ClientSideDetectionService : public URLFetcher::Delegate {
+class ClientSideDetectionService : public URLFetcher::Delegate,
+ public NotificationObserver {
public:
typedef Callback1<base::PlatformFile>::Type OpenModelDoneCallback;
@@ -67,6 +70,11 @@ class ClientSideDetectionService : public URLFetcher::Delegate {
const ResponseCookies& cookies,
const std::string& data);
+ // From the NotificationObserver interface.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
// Gets the model file descriptor once the model is ready and stored
// on disk. If there was an error the callback is called and the
// platform file is set to kInvalidPlatformFileValue. The
@@ -89,6 +97,8 @@ class ClientSideDetectionService : public URLFetcher::Delegate {
private:
friend class ClientSideDetectionServiceTest;
+ friend class ClientSideDetectionServiceHooksTest;
+ class ShouldClassifyUrlRequest;
enum ModelStatus {
// It's unclear whether or not the model was already fetched.
@@ -199,6 +209,9 @@ class ClientSideDetectionService : public URLFetcher::Delegate {
// The context we use to issue network requests.
scoped_refptr<URLRequestContextGetter> request_context_getter_;
+ // Used to register for page load notifications.
+ NotificationRegistrar registrar_;
+
DISALLOW_COPY_AND_ASSIGN(ClientSideDetectionService);
};
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/client_side_detection_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698