| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 10 |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 362 |
| 363 // Called on the database thread to retrieve chunks. | 363 // Called on the database thread to retrieve chunks. |
| 364 void GetAllChunksFromDatabase(GetChunksCallback callback); | 364 void GetAllChunksFromDatabase(GetChunksCallback callback); |
| 365 | 365 |
| 366 // Called on the IO thread with the results of all chunks. | 366 // Called on the IO thread with the results of all chunks. |
| 367 void OnGetAllChunksFromDatabase(const std::vector<SBListChunkRanges>& lists, | 367 void OnGetAllChunksFromDatabase(const std::vector<SBListChunkRanges>& lists, |
| 368 bool database_error, | 368 bool database_error, |
| 369 GetChunksCallback callback); | 369 GetChunksCallback callback); |
| 370 | 370 |
| 371 // Called on the IO thread after the database reports that it added a chunk. | 371 // Called on the IO thread after the database reports that it added a chunk. |
| 372 void OnChunkInserted(); | 372 void OnAddChunksComplete(AddChunksCallback callback); |
| 373 | 373 |
| 374 // Notification that the database is done loading its bloom filter. We may | 374 // Notification that the database is done loading its bloom filter. We may |
| 375 // have had to queue checks until the database is ready, and if so, this | 375 // have had to queue checks until the database is ready, and if so, this |
| 376 // checks them. | 376 // checks them. |
| 377 void DatabaseLoadComplete(); | 377 void DatabaseLoadComplete(); |
| 378 | 378 |
| 379 // Called on the database thread to add/remove chunks and host keys. | 379 // Called on the database thread to add/remove chunks and host keys. |
| 380 // Callee will free the data when it's done. | 380 // Callee will free the data when it's done. |
| 381 void HandleChunkForDatabase(const std::string& list, | 381 void HandleChunkForDatabase(const std::string& list, |
| 382 SBChunkList* chunks); | 382 SBChunkList* chunks, |
| 383 AddChunksCallback callback); |
| 383 | 384 |
| 384 void DeleteDatabaseChunks(std::vector<SBChunkDelete>* chunk_deletes); | 385 void DeleteDatabaseChunks(std::vector<SBChunkDelete>* chunk_deletes); |
| 385 | 386 |
| 386 static SBThreatType GetThreatTypeFromListname(const std::string& list_name); | 387 static SBThreatType GetThreatTypeFromListname(const std::string& list_name); |
| 387 | 388 |
| 388 void NotifyClientBlockingComplete(Client* client, bool proceed); | 389 void NotifyClientBlockingComplete(Client* client, bool proceed); |
| 389 | 390 |
| 390 void DatabaseUpdateFinished(bool update_succeeded); | 391 void DatabaseUpdateFinished(bool update_succeeded); |
| 391 | 392 |
| 392 void NotifyDatabaseUpdateFinished(bool update_succeeded); | 393 void NotifyDatabaseUpdateFinished(bool update_succeeded); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 | 467 |
| 467 // PrefObserver override | 468 // PrefObserver override |
| 468 virtual void OnPreferenceChanged(PrefServiceBase* service, | 469 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 469 const std::string& pref_name) OVERRIDE; | 470 const std::string& pref_name) OVERRIDE; |
| 470 | 471 |
| 471 // SafeBrowsingProtocolManageDelegate override | 472 // SafeBrowsingProtocolManageDelegate override |
| 472 virtual void ResetDatabase() OVERRIDE; | 473 virtual void ResetDatabase() OVERRIDE; |
| 473 virtual void UpdateStarted() OVERRIDE; | 474 virtual void UpdateStarted() OVERRIDE; |
| 474 virtual void UpdateFinished(bool success) OVERRIDE; | 475 virtual void UpdateFinished(bool success) OVERRIDE; |
| 475 virtual void GetChunks(GetChunksCallback callback) OVERRIDE; | 476 virtual void GetChunks(GetChunksCallback callback) OVERRIDE; |
| 476 virtual void AddChunks(const std::string& list, SBChunkList* chunks) OVERRIDE; | 477 virtual void AddChunks(const std::string& list, SBChunkList* chunks, |
| 478 AddChunksCallback) OVERRIDE; |
| 477 virtual void DeleteChunks( | 479 virtual void DeleteChunks( |
| 478 std::vector<SBChunkDelete>* delete_chunks) OVERRIDE; | 480 std::vector<SBChunkDelete>* delete_chunks) OVERRIDE; |
| 479 | 481 |
| 480 // Starts following the safe browsing preference on |pref_service|. | 482 // Starts following the safe browsing preference on |pref_service|. |
| 481 void AddPrefService(PrefService* pref_service); | 483 void AddPrefService(PrefService* pref_service); |
| 482 | 484 |
| 483 // Stop following the safe browsing preference on |pref_service|. | 485 // Stop following the safe browsing preference on |pref_service|. |
| 484 void RemovePrefService(PrefService* pref_service); | 486 void RemovePrefService(PrefService* pref_service); |
| 485 | 487 |
| 486 // Checks if any profile is currently using the safe browsing service, and | 488 // Checks if any profile is currently using the safe browsing service, and |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 class SafeBrowsingServiceFactory { | 593 class SafeBrowsingServiceFactory { |
| 592 public: | 594 public: |
| 593 SafeBrowsingServiceFactory() { } | 595 SafeBrowsingServiceFactory() { } |
| 594 virtual ~SafeBrowsingServiceFactory() { } | 596 virtual ~SafeBrowsingServiceFactory() { } |
| 595 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; | 597 virtual SafeBrowsingService* CreateSafeBrowsingService() = 0; |
| 596 private: | 598 private: |
| 597 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); | 599 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceFactory); |
| 598 }; | 600 }; |
| 599 | 601 |
| 600 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ | 602 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_SERVICE_H_ |
| OLD | NEW |