summaryrefslogtreecommitdiffstats
path: root/chrome/common/visitedlink_common.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-13 17:18:50 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-13 17:18:50 +0000
commit8a6e174c293dfcce6b1c409f5f508537eaaa7f9c (patch)
treef4014f19df5697338cf5977fd5a70ec8c2b00c0c /chrome/common/visitedlink_common.h
parentdca408e49016c2bdf1fef64be587f6f2d3b81cf8 (diff)
downloadchromium_src-8a6e174c293dfcce6b1c409f5f508537eaaa7f9c.zip
chromium_src-8a6e174c293dfcce6b1c409f5f508537eaaa7f9c.tar.gz
chromium_src-8a6e174c293dfcce6b1c409f5f508537eaaa7f9c.tar.bz2
Implement visited link coloring.
Review URL: http://codereview.chromium.org/12928 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6970 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/visitedlink_common.h')
-rw-r--r--chrome/common/visitedlink_common.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/chrome/common/visitedlink_common.h b/chrome/common/visitedlink_common.h
index 65f540b..06a4f5c 100644
--- a/chrome/common/visitedlink_common.h
+++ b/chrome/common/visitedlink_common.h
@@ -55,13 +55,20 @@ class VisitedLinkCommon {
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 @@ class VisitedLinkCommon {
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]);