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

Unified Diff: components/visitedlink/common/visitedlink_common.h

Issue 1549993003: Switch to standard integer types in components/, part 4 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: components/visitedlink/common/visitedlink_common.h
diff --git a/components/visitedlink/common/visitedlink_common.h b/components/visitedlink/common/visitedlink_common.h
index 37afe1d157581a010214801f361142ca12b652d7..0a0401d5e294a1c6f7fa034a1765787afca7a56c 100644
--- a/components/visitedlink/common/visitedlink_common.h
+++ b/components/visitedlink/common/visitedlink_common.h
@@ -5,9 +5,12 @@
#ifndef COMPONENTS_VISITEDLINK_COMMON_VISITEDLINK_COMMON_H_
#define COMPONENTS_VISITEDLINK_COMMON_VISITEDLINK_COMMON_H_
+#include <stddef.h>
+#include <stdint.h>
+
#include <vector>
-#include "base/basictypes.h"
+#include "base/macros.h"
class GURL;
@@ -45,11 +48,11 @@ namespace visitedlink {
class VisitedLinkCommon {
public:
// A number that identifies the URL.
- typedef uint64 Fingerprint;
+ typedef uint64_t Fingerprint;
typedef std::vector<Fingerprint> Fingerprints;
// A hash value of a fingerprint
- typedef int32 Hash;
+ typedef int32_t Hash;
// A fingerprint or hash value that does not exist
static const Fingerprint null_fingerprint_;
@@ -73,7 +76,7 @@ class VisitedLinkCommon {
#ifdef UNIT_TEST
// Returns statistics about DB usage
- void GetUsageStatistics(int32* table_size,
+ void GetUsageStatistics(int32_t* table_size,
VisitedLinkCommon::Fingerprint** fingerprints) {
*table_size = table_length_;
*fingerprints = hash_table_;
@@ -85,16 +88,16 @@ class VisitedLinkCommon {
// can get stats on the table
struct SharedHeader {
// see goes into table_length_
- uint32 length;
+ uint32_t length;
// goes into salt_
- uint8 salt[LINK_SALT_LENGTH];
+ uint8_t salt[LINK_SALT_LENGTH];
};
// Returns the fingerprint at the given index into the URL table. This
// function should be called instead of accessing the table directly to
// contain endian issues.
- Fingerprint FingerprintAt(int32 table_offset) const {
+ Fingerprint FingerprintAt(int32_t table_offset) const {
if (!hash_table_)
return null_fingerprint_;
return hash_table_[table_offset];
@@ -104,13 +107,14 @@ class VisitedLinkCommon {
// same algorithm can be re-used by the table rebuilder, so you will have to
// 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]);
+ static Fingerprint ComputeURLFingerprint(
+ const char* canonical_url,
+ size_t url_len,
+ const uint8_t salt[LINK_SALT_LENGTH]);
// 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) {
+ static Hash HashFingerprint(Fingerprint fingerprint, int32_t table_length) {
if (table_length == 0)
return null_hash_;
return static_cast<Hash>(fingerprint % table_length);
@@ -124,10 +128,10 @@ class VisitedLinkCommon {
VisitedLinkCommon::Fingerprint* hash_table_;
// the number of items in the hash table
- int32 table_length_;
+ int32_t table_length_;
// salt used for each URL when computing the fingerprint
- uint8 salt_[LINK_SALT_LENGTH];
+ uint8_t salt_[LINK_SALT_LENGTH];
private:
DISALLOW_COPY_AND_ASSIGN(VisitedLinkCommon);
« no previous file with comments | « components/visitedlink/browser/visitedlink_master.cc ('k') | components/visitedlink/common/visitedlink_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698