| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/activity_log/ad_network_database.h" | 8 #include "chrome/browser/extensions/activity_log/ad_network_database.h" |
| 9 | 9 |
| 10 namespace extensions { | 10 namespace extensions { |
| 11 | 11 |
| 12 // The standard ("real") implementation of the AdNetworkDatabase, which stores | 12 // The standard ("real") implementation of the AdNetworkDatabase, which stores |
| 13 // a list of hashes of ad networks. | 13 // a list of hashes of ad networks. |
| 14 class HashedAdNetworkDatabase : public AdNetworkDatabase { | 14 class HashedAdNetworkDatabase : public AdNetworkDatabase { |
| 15 public: | 15 public: |
| 16 HashedAdNetworkDatabase(); | 16 HashedAdNetworkDatabase(); |
| 17 virtual ~HashedAdNetworkDatabase(); | 17 virtual ~HashedAdNetworkDatabase(); |
| 18 | 18 |
| 19 void set_entries_for_testing(const char** entries, int num_entries) { | 19 void set_entries_for_testing(const char** entries, int num_entries) { |
| 20 entries_ = entries; | 20 entries_ = entries; |
| 21 num_entries_ = num_entries; | 21 num_entries_ = num_entries; |
| 22 } | 22 } |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 // AdNetworkDatabase implementation. | 25 // AdNetworkDatabase implementation. |
| 26 virtual bool IsAdNetwork(const GURL& url) const OVERRIDE; | 26 virtual bool IsAdNetwork(const GURL& url) const override; |
| 27 | 27 |
| 28 // Points to the array of hash entries. In practice, this is always set to | 28 // Points to the array of hash entries. In practice, this is always set to |
| 29 // kHashedAdNetworks, but is exposed via set_entries_for_testing(). | 29 // kHashedAdNetworks, but is exposed via set_entries_for_testing(). |
| 30 const char** entries_; | 30 const char** entries_; |
| 31 | 31 |
| 32 // The number of entries. | 32 // The number of entries. |
| 33 int num_entries_; | 33 int num_entries_; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 } // namespace extensions | 36 } // namespace extensions |
| 37 | 37 |
| 38 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_ | 38 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_ |
| OLD | NEW |