| 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 a2b63f710bc2b5e8b36482a054ad35f6c0e3302e..6f1b9840b2a62c9c751fef48381c1a6630f88685 100644
|
| --- a/chrome/browser/safe_browsing/client_side_detection_service.h
|
| +++ b/chrome/browser/safe_browsing/client_side_detection_service.h
|
| @@ -31,6 +31,8 @@
|
| #include "base/task.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;
|
| @@ -41,7 +43,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;
|
|
|
| @@ -65,6 +68,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
|
| @@ -87,6 +95,7 @@ class ClientSideDetectionService : public URLFetcher::Delegate {
|
|
|
| private:
|
| friend class ClientSideDetectionServiceTest;
|
| + class ShouldClassifyUrlRequest;
|
|
|
| enum ModelStatus {
|
| // It's unclear whether or not the model was already fetched.
|
| @@ -187,6 +196,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);
|
| };
|
|
|
|
|