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

Unified Diff: chrome/common/visitedlink_common.h

Issue 12928: Implement visited link coloring. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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
« no previous file with comments | « no previous file | chrome/common/visitedlink_common.cc » ('j') | webkit/glue/chromium_bridge_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/visitedlink_common.h
===================================================================
--- chrome/common/visitedlink_common.h (revision 6868)
+++ chrome/common/visitedlink_common.h (working copy)
@@ -55,13 +55,20 @@
VisitedLinkCommon();
virtual ~VisitedLinkCommon();
- // Computes the fingerprint of the key and looks it up in the table. We
- // return true if found. Does not modify the hastable. The input should be
- // the canonical 16-bit URL.
+ // Returns the fingerprint for the given URL.
+ Fingerprint ComputeURLFingerprint(const char* canonical_url,
+ size_t url_len) const {
+ return ComputeURLFingerprint(canonical_url, url_len, salt_);
+ }
+
+ // Looks up the given key in the table. The fingerprint for the URL is
+ // computed if you call one with the string argument. Returns true if found.
+ // Does not modify the hastable.
bool IsVisited(const char* canonical_url, size_t url_len) const;
bool IsVisited(const GURL& url) const {
return IsVisited(url.spec().data(), url.spec().size());
}
+ bool IsVisited(Fingerprint fingerprint) const;
#ifdef UNIT_TEST
// Returns statistics about DB usage
@@ -93,12 +100,10 @@
return hash_table_[table_offset];
}
- // Returns true if the given fingerprint is in the table.
- bool IsVisited(Fingerprint fingerprint) const;
-
// Computes the fingerprint of the given canonical URL. It is static so the
// same algorithm can be re-used by the table rebuilder, so you will have to
- // pass the salt as a parameter.
+ // pass the salt as a parameter. See the non-static version above if you
+ // want to use the current class' salt.
static Fingerprint ComputeURLFingerprint(const char* canonical_url,
size_t url_len,
const uint8 salt[LINK_SALT_LENGTH]);
« no previous file with comments | « no previous file | chrome/common/visitedlink_common.cc » ('j') | webkit/glue/chromium_bridge_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698