summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 02:51:49 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 02:51:49 +0000
commit7fb6c8616a5fb423fd73fdd7df7705e13edf18e3 (patch)
treec451d0a7cd8bd71e9ba7a1ba5fbbb5047c548796 /chrome
parent1abbd4aa7ee407983d2a824f009966af9d06c870 (diff)
downloadchromium_src-7fb6c8616a5fb423fd73fdd7df7705e13edf18e3.zip
chromium_src-7fb6c8616a5fb423fd73fdd7df7705e13edf18e3.tar.gz
chromium_src-7fb6c8616a5fb423fd73fdd7df7705e13edf18e3.tar.bz2
Don't leak visited site information from original profile to OTR profile.
BUG=8388 R=brettw Review URL: http://codereview.chromium.org/42114 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/profile.cc4
-rw-r--r--chrome/common/visitedlink_common.cc5
-rw-r--r--chrome/common/visitedlink_common.h5
3 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 1bc6956..526e528 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -142,7 +142,9 @@ class OffTheRecordProfileImpl : public Profile,
}
virtual VisitedLinkMaster* GetVisitedLinkMaster() {
- return profile_->GetVisitedLinkMaster();
+ // We don't provide access to the VisitedLinkMaster when we're OffTheRecord
+ // because we don't want to leak the sites that the user has visited before.
+ return NULL;
}
virtual ExtensionsService* GetExtensionsService() {
diff --git a/chrome/common/visitedlink_common.cc b/chrome/common/visitedlink_common.cc
index c694859..9c2b231 100644
--- a/chrome/common/visitedlink_common.cc
+++ b/chrome/common/visitedlink_common.cc
@@ -24,11 +24,8 @@ bool VisitedLinkCommon::IsVisited(const char* canonical_url,
size_t url_len) const {
if (url_len == 0)
return false;
- if (!hash_table_ || table_length_ == 0) {
- // Init() will always create a table, this means somebody forgot
- NOTREACHED();
+ if (!hash_table_ || table_length_ == 0)
return false;
- }
return IsVisited(ComputeURLFingerprint(canonical_url, url_len));
}
diff --git a/chrome/common/visitedlink_common.h b/chrome/common/visitedlink_common.h
index 0009154..6081f49 100644
--- a/chrome/common/visitedlink_common.h
+++ b/chrome/common/visitedlink_common.h
@@ -94,9 +94,8 @@ class VisitedLinkCommon {
// function should be called instead of accessing the table directly to
// contain endian issues.
Fingerprint FingerprintAt(int32 table_offset) const {
- DCHECK(hash_table_);
if (!hash_table_)
- return 0;
+ return null_fingerprint_;
return hash_table_[table_offset];
}
@@ -111,6 +110,8 @@ class VisitedLinkCommon {
// Computes the hash value of the given fingerprint, this is used as a lookup
// into the hashtable.
static Hash HashFingerprint(Fingerprint fingerprint, int32 table_length) {
+ if (table_length == 0)
+ return null_hash_;
return static_cast<Hash>(fingerprint % table_length);
}
// Uses the current hashtable.