| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 // | 4 // | 
| 5 // The Safe Browsing service is responsible for downloading anti-phishing and | 5 // The Safe Browsing service is responsible for downloading anti-phishing and | 
| 6 // anti-malware tables and checking urls against them. | 6 // anti-malware tables and checking urls against them. | 
| 7 | 7 | 
| 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 
| 9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 9 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 
| 10 #pragma once | 10 #pragma once | 
| 11 | 11 | 
| 12 #include <deque> | 12 #include <deque> | 
| 13 #include <map> | 13 #include <map> | 
| 14 #include <set> | 14 #include <set> | 
| 15 #include <string> | 15 #include <string> | 
| 16 #include <vector> | 16 #include <vector> | 
| 17 | 17 | 
| 18 #include "base/hash_tables.h" | 18 #include "base/hash_tables.h" | 
| 19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" | 
| 20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" | 
|  | 21 #include "base/message_loop_helpers.h" | 
| 21 #include "base/observer_list.h" | 22 #include "base/observer_list.h" | 
| 22 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" | 
| 23 #include "base/task.h" |  | 
| 24 #include "base/time.h" | 24 #include "base/time.h" | 
| 25 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 25 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 
| 26 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" | 
| 27 #include "content/public/browser/notification_observer.h" | 27 #include "content/public/browser/notification_observer.h" | 
| 28 #include "content/public/browser/notification_registrar.h" | 28 #include "content/public/browser/notification_registrar.h" | 
| 29 #include "googleurl/src/gurl.h" | 29 #include "googleurl/src/gurl.h" | 
| 30 | 30 | 
| 31 class MalwareDetails; | 31 class MalwareDetails; | 
| 32 class PrefChangeRegistrar; | 32 class PrefChangeRegistrar; | 
| 33 class PrefService; | 33 class PrefService; | 
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 331 | 331 | 
| 332   // Clients that we've queued up for checking later once the database is ready. | 332   // Clients that we've queued up for checking later once the database is ready. | 
| 333   struct QueuedCheck { | 333   struct QueuedCheck { | 
| 334     Client* client; | 334     Client* client; | 
| 335     GURL url; | 335     GURL url; | 
| 336     base::TimeTicks start;  // When check was queued. | 336     base::TimeTicks start;  // When check was queued. | 
| 337   }; | 337   }; | 
| 338 | 338 | 
| 339   friend struct content::BrowserThread::DeleteOnThread< | 339   friend struct content::BrowserThread::DeleteOnThread< | 
| 340       content::BrowserThread::UI>; | 340       content::BrowserThread::UI>; | 
| 341   friend class DeleteTask<SafeBrowsingService>; | 341   friend class base::DeleteHelper<SafeBrowsingService>; | 
| 342   friend class SafeBrowsingServiceTest; | 342   friend class SafeBrowsingServiceTest; | 
| 343 | 343 | 
| 344   // Called to initialize objects that are used on the io_thread. | 344   // Called to initialize objects that are used on the io_thread. | 
| 345   void OnIOInitialize(const std::string& client_key, | 345   void OnIOInitialize(const std::string& client_key, | 
| 346                       const std::string& wrapped_key, | 346                       const std::string& wrapped_key, | 
| 347                       net::URLRequestContextGetter* request_context_getter); | 347                       net::URLRequestContextGetter* request_context_getter); | 
| 348 | 348 | 
| 349   // Called to shutdown operations on the io_thread. | 349   // Called to shutdown operations on the io_thread. | 
| 350   void OnIOShutdown(); | 350   void OnIOShutdown(); | 
| 351 | 351 | 
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 578 class SafeBrowsingServiceFactory { | 578 class SafeBrowsingServiceFactory { | 
| 579  public: | 579  public: | 
| 580   SafeBrowsingServiceFactory() { } | 580   SafeBrowsingServiceFactory() { } | 
| 581   virtual ~SafeBrowsingServiceFactory() { } | 581   virtual ~SafeBrowsingServiceFactory() { } | 
| 582   virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 582   virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 
| 583  private: | 583  private: | 
| 584   DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 584   DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 
| 585 }; | 585 }; | 
| 586 | 586 | 
| 587 #endif  // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 587 #endif  // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 
| OLD | NEW | 
|---|