summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/safe_browsing_store.h
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 18:52:24 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 18:52:24 +0000
commita2084949c6cfb146be4721f076e43c5f2a32060e (patch)
tree576ce1526c87e23470c72a07a9c76fdb0e84fbb0 /chrome/browser/safe_browsing/safe_browsing_store.h
parent6d603aab761645693dbf88cfe12c1964c7920ad2 (diff)
downloadchromium_src-a2084949c6cfb146be4721f076e43c5f2a32060e.zip
chromium_src-a2084949c6cfb146be4721f076e43c5f2a32060e.tar.gz
chromium_src-a2084949c6cfb146be4721f076e43c5f2a32060e.tar.bz2
Modify SafeBrowsingStore interface to explicitly use 32-bit times.
Existing code stores the |time_t| from |base::Time::ToTimeT()| using |bind_int64()|. But |time_t| is an unsigned 32-bit value so this didn't add anything. Also changed |SafeBrowsingStoreSqlite| to have the singleton writers use the array writers, rather than vice versa. The only tie-in is that otherwise it wanted a helper writer taking an int32 for the time component to share between |WriteAddHash()| and |WriteAddHashes()|. [This CL is a prelude to bulk-writing arrays of |SBAddFullHash| to the database, so making |SBAddFullHash.received| an explicitly simple type is worthwhile.] BUG=none TEST=none Review URL: http://codereview.chromium.org/646030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/safe_browsing_store.h')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_store.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_store.h b/chrome/browser/safe_browsing/safe_browsing_store.h
index 1d32e7d..8ef8574 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store.h
+++ b/chrome/browser/safe_browsing/safe_browsing_store.h
@@ -64,10 +64,18 @@ struct SBSubPrefix {
// different structs, and there aren't many full hashes. Hmm.
struct SBAddFullHash {
SBAddPrefix add_prefix;
- base::Time received;
+ int32 received;
SBFullHash full_hash;
SBAddFullHash(int32 id, SBPrefix p, base::Time r, SBFullHash h)
+ : add_prefix(id, p),
+ received(static_cast<int32>(r.ToTimeT())),
+ full_hash(h) {
+ }
+
+ // Provided for ReadAddHashes() implementations, which already have
+ // an int32 for the time.
+ SBAddFullHash(int32 id, SBPrefix p, int32 r, SBFullHash h)
: add_prefix(id, p), received(r), full_hash(h) {}
int32 GetAddChunkId() const { return add_prefix.chunk_id; }