| 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 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
| 7 | 7 |
| 8 // A class that implements Chrome's interface with the SafeBrowsing protocol. | 8 // A class that implements Chrome's interface with the SafeBrowsing protocol. |
| 9 // See https://developers.google.com/safe-browsing/developers_guide_v2 for | 9 // See https://developers.google.com/safe-browsing/developers_guide_v2 for |
| 10 // protocol details. | 10 // protocol details. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/safe_browsing/protocol_parser.h" | 29 #include "chrome/browser/safe_browsing/protocol_parser.h" |
| 30 #include "chrome/browser/safe_browsing/safe_browsing_util.h" | 30 #include "chrome/browser/safe_browsing/safe_browsing_util.h" |
| 31 #include "net/url_request/url_fetcher_delegate.h" | 31 #include "net/url_request/url_fetcher_delegate.h" |
| 32 #include "url/gurl.h" | 32 #include "url/gurl.h" |
| 33 | 33 |
| 34 namespace net { | 34 namespace net { |
| 35 class URLFetcher; | 35 class URLFetcher; |
| 36 class URLRequestContextGetter; | 36 class URLRequestContextGetter; |
| 37 } // namespace net | 37 } // namespace net |
| 38 | 38 |
| 39 #if defined(COMPILER_GCC) | |
| 40 // Allows us to use URLFetchers in a hash_map with gcc (MSVC is okay without | |
| 41 // specifying this). | |
| 42 namespace BASE_HASH_NAMESPACE { | |
| 43 template<> | |
| 44 struct hash<const net::URLFetcher*> { | |
| 45 size_t operator()(const net::URLFetcher* fetcher) const { | |
| 46 return reinterpret_cast<size_t>(fetcher); | |
| 47 } | |
| 48 }; | |
| 49 } | |
| 50 #endif | |
| 51 | |
| 52 class SBProtocolManagerFactory; | 39 class SBProtocolManagerFactory; |
| 53 class SafeBrowsingProtocolManagerDelegate; | 40 class SafeBrowsingProtocolManagerDelegate; |
| 54 | 41 |
| 55 class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, | 42 class SafeBrowsingProtocolManager : public net::URLFetcherDelegate, |
| 56 public base::NonThreadSafe { | 43 public base::NonThreadSafe { |
| 57 public: | 44 public: |
| 58 // FullHashCallback is invoked when GetFullHash completes. | 45 // FullHashCallback is invoked when GetFullHash completes. |
| 59 // Parameters: | 46 // Parameters: |
| 60 // - The vector of full hash results. If empty, indicates that there | 47 // - The vector of full hash results. If empty, indicates that there |
| 61 // were no matches, and that the resource is safe. | 48 // were no matches, and that the resource is safe. |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 virtual void AddChunks(const std::string& list, | 432 virtual void AddChunks(const std::string& list, |
| 446 scoped_ptr<ScopedVector<SBChunkData> > chunks, | 433 scoped_ptr<ScopedVector<SBChunkData> > chunks, |
| 447 AddChunksCallback callback) = 0; | 434 AddChunksCallback callback) = 0; |
| 448 | 435 |
| 449 // Delete chunks from the database. | 436 // Delete chunks from the database. |
| 450 virtual void DeleteChunks( | 437 virtual void DeleteChunks( |
| 451 scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes) = 0; | 438 scoped_ptr<std::vector<SBChunkDelete> > chunk_deletes) = 0; |
| 452 }; | 439 }; |
| 453 | 440 |
| 454 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ | 441 #endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_H_ |
| OLD | NEW |