Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1818)

Unified Diff: chrome/browser/extensions/activity_log/hashed_ad_network_database.h

Issue 263953003: Re-enable ActivityLog AdNetworkDatabase unittest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/activity_log/hashed_ad_network_database.h
diff --git a/chrome/browser/extensions/activity_log/hashed_ad_network_database.h b/chrome/browser/extensions/activity_log/hashed_ad_network_database.h
new file mode 100644
index 0000000000000000000000000000000000000000..74deb7bc78e6bd98badabcd21343ba307f8cd932
--- /dev/null
+++ b/chrome/browser/extensions/activity_log/hashed_ad_network_database.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_
+#define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_
+
+#include "base/containers/hash_tables.h"
+#include "base/memory/ref_counted.h"
+#include "chrome/browser/extensions/activity_log/ad_network_database.h"
+
+namespace base {
+class RefCountedStaticMemory;
+}
+
+namespace extensions {
+
+// The standard ("real") implementation of the AdNetworkDatabase, which stores
+// a list of hashes of ad networks.
+class HashedAdNetworkDatabase : public AdNetworkDatabase {
+ public:
+ explicit HashedAdNetworkDatabase(
+ scoped_refptr<base::RefCountedStaticMemory> memory);
+ virtual ~HashedAdNetworkDatabase();
+
+ private:
+ // AdNetworkDatabase implementation.
+ virtual bool IsAdNetwork(const GURL& url) const OVERRIDE;
+
+ // The set of partial hashes for known ad networks.
+ base::hash_set<int64> entries_;
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_HASHED_AD_NETWORK_DATABASE_H_

Powered by Google App Engine
This is Rietveld 408576698