diff options
author | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-28 08:45:35 +0000 |
---|---|---|
committer | gavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-28 08:45:35 +0000 |
commit | 8b2f8a5046ea33e7b7d98baa73e97cb8430e23ca (patch) | |
tree | 59b871e9766d39d6cbacf39fd5f98f44085f55ba | |
parent | 073f071a469ea65a82679b84e44444c9d72f87b4 (diff) | |
download | chromium_src-8b2f8a5046ea33e7b7d98baa73e97cb8430e23ca.zip chromium_src-8b2f8a5046ea33e7b7d98baa73e97cb8430e23ca.tar.gz chromium_src-8b2f8a5046ea33e7b7d98baa73e97cb8430e23ca.tar.bz2 |
Reduce Simple Index memory use.
Cut the EntryMetadata object from sixteen bytes to eight.
R=pasko,clamy,pliard
BUG=None
Review URL: https://chromiumcodereview.appspot.com/23283012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219969 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/disk_cache/backend_unittest.cc | 1 | ||||
-rw-r--r-- | net/disk_cache/disk_cache_test_base.cc | 12 | ||||
-rw-r--r-- | net/disk_cache/entry_unittest.cc | 1 | ||||
-rw-r--r-- | net/disk_cache/simple/simple_index.cc | 69 | ||||
-rw-r--r-- | net/disk_cache/simple/simple_index.h | 26 | ||||
-rw-r--r-- | net/disk_cache/simple/simple_index_file_unittest.cc | 12 | ||||
-rw-r--r-- | net/disk_cache/simple/simple_index_unittest.cc | 88 |
7 files changed, 148 insertions, 61 deletions
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index 7eeeee1..e2144d2 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -1509,6 +1509,7 @@ void DiskCacheBackendTest::BackendDoomBetween() { AddDelay(); Time middle_end = Time::Now(); + AddDelay(); ASSERT_EQ(net::OK, CreateEntry("fourth", &entry)); entry->Close(); diff --git a/net/disk_cache/disk_cache_test_base.cc b/net/disk_cache/disk_cache_test_base.cc index dc7bb6c..9eea949 100644 --- a/net/disk_cache/disk_cache_test_base.cc +++ b/net/disk_cache/disk_cache_test_base.cc @@ -7,6 +7,7 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/run_loop.h" +#include "base/threading/platform_thread.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/test_completion_callback.h" @@ -221,6 +222,17 @@ void DiskCacheTestWithCache::TrimDeletedListForTest(bool empty) { } void DiskCacheTestWithCache::AddDelay() { + if (simple_cache_mode_) { + // The simple cache uses second resolution for many timeouts, so it's safest + // to advance by at least whole seconds before falling back into the normal + // disk cache epsilon advance. + const base::Time initial_time = base::Time::Now(); + do { + base::PlatformThread::YieldCurrentThread(); + } while (base::Time::Now() - + initial_time < base::TimeDelta::FromSeconds(1)); + } + base::Time initial = base::Time::Now(); while (base::Time::Now() <= initial) { base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1)); diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc index 7addc85..a7e6d9e 100644 --- a/net/disk_cache/entry_unittest.cc +++ b/net/disk_cache/entry_unittest.cc @@ -3079,6 +3079,7 @@ TEST_F(DiskCacheEntryTest, SimpleCacheEvictOldEntries) { EXPECT_EQ(kWriteSize, WriteData(entry, 0, 0, buffer.get(), kWriteSize, false)); entry->Close(); + AddDelay(); std::string key2("the key prefix"); for (int i = 0; i < kNumExtraEntries; i++) { diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc index e17ada7..97b3be4 100644 --- a/net/disk_cache/simple/simple_index.cc +++ b/net/disk_cache/simple/simple_index.cc @@ -4,6 +4,7 @@ #include "net/disk_cache/simple/simple_index.h" +#include <limits> #include <utility> #include "base/bind.h" @@ -72,31 +73,63 @@ bool CompareHashesForTimestamp::operator()(uint64 hash1, uint64 hash2) { namespace disk_cache { -EntryMetadata::EntryMetadata() : last_used_time_(0), entry_size_(0) {} +EntryMetadata::EntryMetadata() + : last_used_time_seconds_since_epoch_(0), + entry_size_(0) { +} -EntryMetadata::EntryMetadata(base::Time last_used_time, uint64 entry_size) - : last_used_time_(last_used_time.ToInternalValue()), - entry_size_(entry_size) {} +EntryMetadata::EntryMetadata(base::Time last_used_time, int entry_size) + : last_used_time_seconds_since_epoch_(0), + entry_size_(entry_size) { + SetLastUsedTime(last_used_time); +} base::Time EntryMetadata::GetLastUsedTime() const { - return base::Time::FromInternalValue(last_used_time_); + // Preserve nullity. + if (last_used_time_seconds_since_epoch_ == 0) + return base::Time(); + + return base::Time::UnixEpoch() + + base::TimeDelta::FromSeconds(last_used_time_seconds_since_epoch_); } void EntryMetadata::SetLastUsedTime(const base::Time& last_used_time) { - last_used_time_ = last_used_time.ToInternalValue(); + // Preserve nullity. + if (last_used_time.is_null()) { + last_used_time_seconds_since_epoch_ = 0; + return; + } + + const base::TimeDelta since_unix_epoch = + last_used_time - base::Time::UnixEpoch(); + const int64 seconds_since_unix_epoch = since_unix_epoch.InSeconds(); + DCHECK_LE(implicit_cast<int64>(std::numeric_limits<uint32>::min()), + seconds_since_unix_epoch); + DCHECK_GE(implicit_cast<int64>(std::numeric_limits<uint32>::max()), + seconds_since_unix_epoch); + + last_used_time_seconds_since_epoch_ = seconds_since_unix_epoch; + // Avoid accidental nullity. + if (last_used_time_seconds_since_epoch_ == 0) + last_used_time_seconds_since_epoch_ = 1; } void EntryMetadata::Serialize(Pickle* pickle) const { DCHECK(pickle); - COMPILE_ASSERT(sizeof(EntryMetadata) == (sizeof(int64) + sizeof(uint64)), - EntryMetadata_has_two_member_variables); - pickle->WriteInt64(last_used_time_); + int64 internal_last_used_time = GetLastUsedTime().ToInternalValue(); + pickle->WriteInt64(internal_last_used_time); pickle->WriteUInt64(entry_size_); } bool EntryMetadata::Deserialize(PickleIterator* it) { DCHECK(it); - return it->ReadInt64(&last_used_time_) && it->ReadUInt64(&entry_size_); + int64 tmp_last_used_time; + uint64 tmp_entry_size; + if (!it->ReadInt64(&tmp_last_used_time) || !it->ReadUInt64(&tmp_entry_size)) + return false; + SetLastUsedTime(base::Time::FromInternalValue(tmp_last_used_time)); + entry_size_ = tmp_entry_size; + return true; } SimpleIndex::SimpleIndex(base::SingleThreadTaskRunner* io_thread, @@ -292,7 +325,7 @@ void SimpleIndex::StartEvictionIfNeeded() { base::Bind(&SimpleIndex::EvictionDone, AsWeakPtr())); } -bool SimpleIndex::UpdateEntrySize(uint64 entry_hash, uint64 entry_size) { +bool SimpleIndex::UpdateEntrySize(uint64 entry_hash, int entry_size) { DCHECK(io_thread_checker_.CalledOnValidThread()); EntrySet::iterator it = entries_set_.find(entry_hash); if (it == entries_set_.end()) @@ -336,10 +369,10 @@ void SimpleIndex::PostponeWritingToDisk() { } void SimpleIndex::UpdateEntryIteratorSize(EntrySet::iterator* it, - uint64 entry_size) { + int entry_size) { // Update the total cache size with the new entry size. DCHECK(io_thread_checker_.CalledOnValidThread()); - DCHECK_GE(cache_size_, (*it)->second.GetEntrySize()); + DCHECK_GE(cache_size_, implicit_cast<uint64>((*it)->second.GetEntrySize())); cache_size_ -= (*it)->second.GetEntrySize(); cache_size_ += entry_size; (*it)->second.SetEntrySize(entry_size); @@ -434,9 +467,17 @@ void SimpleIndex::WriteToDisk() { } scoped_ptr<SimpleIndex::HashList> SimpleIndex::ExtractEntriesBetween( - const base::Time initial_time, const base::Time end_time, + base::Time initial_time, + base::Time end_time, bool delete_entries) { DCHECK_EQ(true, initialized_); + + if (!initial_time.is_null()) + initial_time -= EntryMetadata::GetLowerEpsilonForTimeComparisons(); + if (end_time.is_null()) + end_time = base::Time::Max(); + else + end_time += EntryMetadata::GetUpperEpsilonForTimeComparisons(); const base::Time extended_end_time = end_time.is_null() ? base::Time::Max() : end_time; DCHECK(extended_end_time >= initial_time); diff --git a/net/disk_cache/simple/simple_index.h b/net/disk_cache/simple/simple_index.h index 9890e29..d35bd39 100644 --- a/net/disk_cache/simple/simple_index.h +++ b/net/disk_cache/simple/simple_index.h @@ -38,32 +38,36 @@ struct SimpleIndexLoadResult; class NET_EXPORT_PRIVATE EntryMetadata { public: EntryMetadata(); - EntryMetadata(base::Time last_used_time, uint64 entry_size); + EntryMetadata(base::Time last_used_time, int entry_size); base::Time GetLastUsedTime() const; void SetLastUsedTime(const base::Time& last_used_time); - uint64 GetEntrySize() const { return entry_size_; } - void SetEntrySize(uint64 entry_size) { entry_size_ = entry_size; } + int GetEntrySize() const { return entry_size_; } + void SetEntrySize(int entry_size) { entry_size_ = entry_size; } // Serialize the data into the provided pickle. void Serialize(Pickle* pickle) const; bool Deserialize(PickleIterator* it); + static base::TimeDelta GetLowerEpsilonForTimeComparisons() { + return base::TimeDelta::FromSeconds(1); + } + static base::TimeDelta GetUpperEpsilonForTimeComparisons() { + return base::TimeDelta(); + } + private: friend class SimpleIndexFileTest; // When adding new members here, you should update the Serialize() and // Deserialize() methods. - // This is the serialized format from Time::ToInternalValue(). - // If you want to make calculations/comparisons, you should use the - // base::Time() class. Use the GetLastUsedTime() method above. - // TODO(felipeg): Use Time() here. - int64 last_used_time_; + uint32 last_used_time_seconds_since_epoch_; - uint64 entry_size_; // Storage size in bytes. + int32 entry_size_; // Storage size in bytes. }; +COMPILE_ASSERT(sizeof(EntryMetadata) == 8, metadata_size); // This class is not Thread-safe. class NET_EXPORT_PRIVATE SimpleIndex @@ -97,7 +101,7 @@ class NET_EXPORT_PRIVATE SimpleIndex // Update the size (in bytes) of an entry, in the metadata stored in the // index. This should be the total disk-file size including all streams of the // entry. - bool UpdateEntrySize(uint64 entry_hash, uint64 entry_size); + bool UpdateEntrySize(uint64 entry_hash, int entry_size); typedef base::hash_map<uint64, EntryMetadata> EntrySet; @@ -136,7 +140,7 @@ class NET_EXPORT_PRIVATE SimpleIndex void PostponeWritingToDisk(); - void UpdateEntryIteratorSize(EntrySet::iterator* it, uint64 entry_size); + void UpdateEntryIteratorSize(EntrySet::iterator* it, int entry_size); // Must run on IO Thread. void MergeInitializingSet(scoped_ptr<SimpleIndexLoadResult> load_result); diff --git a/net/disk_cache/simple/simple_index_file_unittest.cc b/net/disk_cache/simple/simple_index_file_unittest.cc index bf7ee83..cf3b594 100644 --- a/net/disk_cache/simple/simple_index_file_unittest.cc +++ b/net/disk_cache/simple/simple_index_file_unittest.cc @@ -75,8 +75,10 @@ class WrappedSimpleIndexFile : public SimpleIndexFile { class SimpleIndexFileTest : public testing::Test { public: bool CompareTwoEntryMetadata(const EntryMetadata& a, const EntryMetadata& b) { - return a.last_used_time_ == b.last_used_time_ && - a.entry_size_ == b.entry_size_; + return + a.last_used_time_seconds_since_epoch_ == + b.last_used_time_seconds_since_epoch_ && + a.entry_size_ == b.entry_size_; } protected: @@ -108,8 +110,7 @@ TEST_F(SimpleIndexFileTest, Serialize) { 456); for (size_t i = 0; i < kNumHashes; ++i) { uint64 hash = kHashes[i]; - metadata_entries[i] = - EntryMetadata(Time::FromInternalValue(hash), hash); + metadata_entries[i] = EntryMetadata(Time(), hash); SimpleIndex::InsertInEntrySet(hash, metadata_entries[i], &entries); } @@ -177,8 +178,7 @@ TEST_F(SimpleIndexFileTest, WriteThenLoadIndex) { EntryMetadata metadata_entries[kNumHashes]; for (size_t i = 0; i < kNumHashes; ++i) { uint64 hash = kHashes[i]; - metadata_entries[i] = - EntryMetadata(Time::FromInternalValue(hash), hash); + metadata_entries[i] = EntryMetadata(Time(), hash); SimpleIndex::InsertInEntrySet(hash, metadata_entries[i], &entries); } diff --git a/net/disk_cache/simple/simple_index_unittest.cc b/net/disk_cache/simple/simple_index_unittest.cc index a2c9016..3dc0dec 100644 --- a/net/disk_cache/simple/simple_index_unittest.cc +++ b/net/disk_cache/simple/simple_index_unittest.cc @@ -21,10 +21,9 @@ namespace disk_cache { namespace { -const int64 kTestLastUsedTimeInternal = 12345; const base::Time kTestLastUsedTime = - base::Time::FromInternalValue(kTestLastUsedTimeInternal); -const uint64 kTestEntrySize = 789; + base::Time::UnixEpoch() + base::TimeDelta::FromDays(20); +const int kTestEntrySize = 789; } // namespace @@ -36,7 +35,10 @@ class EntryMetadataTest : public testing::Test { } void CheckEntryMetadataValues(const EntryMetadata& entry_metadata) { - EXPECT_EQ(kTestLastUsedTime, entry_metadata.GetLastUsedTime()); + EXPECT_LT(kTestLastUsedTime - base::TimeDelta::FromSeconds(2), + entry_metadata.GetLastUsedTime()); + EXPECT_GT(kTestLastUsedTime + base::TimeDelta::FromSeconds(2), + entry_metadata.GetLastUsedTime()); EXPECT_EQ(kTestEntrySize, entry_metadata.GetEntrySize()); } }; @@ -119,11 +121,11 @@ class SimpleIndexTest : public testing::Test { } void WaitForTimeChange() { - base::Time now(base::Time::Now()); - + const base::Time initial_time = base::Time::Now(); do { base::PlatformThread::YieldCurrentThread(); - } while (now == base::Time::Now()); + } while (base::Time::Now() - + initial_time < base::TimeDelta::FromSeconds(1)); } // Redirect to allow single "friend" declaration in base class. @@ -137,7 +139,7 @@ class SimpleIndexTest : public testing::Test { void InsertIntoIndexFileReturn(uint64 hash_key, base::Time last_used_time, - uint64 entry_size) { + int entry_size) { index_file_->load_result()->entries.insert(std::make_pair( hash_key, EntryMetadata(last_used_time, entry_size))); } @@ -158,15 +160,19 @@ class SimpleIndexTest : public testing::Test { TEST_F(EntryMetadataTest, Basics) { EntryMetadata entry_metadata; - EXPECT_EQ(base::Time::FromInternalValue(0), entry_metadata.GetLastUsedTime()); - EXPECT_EQ(size_t(0), entry_metadata.GetEntrySize()); + EXPECT_EQ(base::Time(), entry_metadata.GetLastUsedTime()); + EXPECT_EQ(0, entry_metadata.GetEntrySize()); entry_metadata = NewEntryMetadataWithValues(); CheckEntryMetadataValues(entry_metadata); - const base::Time new_time = base::Time::FromInternalValue(5); + const base::Time new_time = base::Time::Now(); entry_metadata.SetLastUsedTime(new_time); - EXPECT_EQ(new_time, entry_metadata.GetLastUsedTime()); + + EXPECT_LT(new_time - base::TimeDelta::FromSeconds(2), + entry_metadata.GetLastUsedTime()); + EXPECT_GT(new_time + base::TimeDelta::FromSeconds(2), + entry_metadata.GetLastUsedTime()); } TEST_F(EntryMetadataTest, Serialize) { @@ -216,7 +222,7 @@ TEST_F(SimpleIndexTest, BasicInsertRemove) { // Confirm blank state. EntryMetadata metadata; EXPECT_EQ(base::Time(), metadata.GetLastUsedTime()); - EXPECT_EQ(0ul, metadata.GetEntrySize()); + EXPECT_EQ(0, metadata.GetEntrySize()); // Confirm state after insert. index()->Insert(hashes_.at<1>()); @@ -224,14 +230,14 @@ TEST_F(SimpleIndexTest, BasicInsertRemove) { base::Time now(base::Time::Now()); EXPECT_LT(now - base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); EXPECT_GT(now + base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); - EXPECT_EQ(0ul, metadata.GetEntrySize()); + EXPECT_EQ(0, metadata.GetEntrySize()); // Confirm state after remove. metadata = EntryMetadata(); index()->Remove(hashes_.at<1>()); EXPECT_FALSE(GetEntryForTesting(hashes_.at<1>(), &metadata)); EXPECT_EQ(base::Time(), metadata.GetLastUsedTime()); - EXPECT_EQ(0ul, metadata.GetEntrySize()); + EXPECT_EQ(0, metadata.GetEntrySize()); } TEST_F(SimpleIndexTest, Has) { @@ -304,17 +310,22 @@ TEST_F(SimpleIndexTest, UpdateEntrySize) { index()->SetMaxSize(1000); const uint64 kHash1 = hashes_.at<1>(); - InsertIntoIndexFileReturn(kHash1, now - base::TimeDelta::FromDays(2), 475u); + InsertIntoIndexFileReturn(kHash1, now - base::TimeDelta::FromDays(2), 475); ReturnIndexFile(); EntryMetadata metadata; EXPECT_TRUE(GetEntryForTesting(kHash1, &metadata)); - EXPECT_EQ(now - base::TimeDelta::FromDays(2), metadata.GetLastUsedTime()); - EXPECT_EQ(475u, metadata.GetEntrySize()); + EXPECT_LT( + now - base::TimeDelta::FromDays(2) - base::TimeDelta::FromSeconds(1), + metadata.GetLastUsedTime()); + EXPECT_GT( + now - base::TimeDelta::FromDays(2) + base::TimeDelta::FromSeconds(1), + metadata.GetLastUsedTime()); + EXPECT_EQ(475, metadata.GetEntrySize()); index()->UpdateEntrySize(kHash1, 600u); EXPECT_TRUE(GetEntryForTesting(kHash1, &metadata)); - EXPECT_EQ(600u, metadata.GetEntrySize()); + EXPECT_EQ(600, metadata.GetEntrySize()); EXPECT_EQ(1, index()->GetEntryCount()); } @@ -357,11 +368,21 @@ TEST_F(SimpleIndexTest, BasicInit) { EntryMetadata metadata; EXPECT_TRUE(GetEntryForTesting(hashes_.at<1>(), &metadata)); - EXPECT_EQ(now - base::TimeDelta::FromDays(2), metadata.GetLastUsedTime()); - EXPECT_EQ(10ul, metadata.GetEntrySize()); + EXPECT_LT( + now - base::TimeDelta::FromDays(2) - base::TimeDelta::FromSeconds(1), + metadata.GetLastUsedTime()); + EXPECT_GT( + now - base::TimeDelta::FromDays(2) + base::TimeDelta::FromSeconds(1), + metadata.GetLastUsedTime()); + EXPECT_EQ(10, metadata.GetEntrySize()); EXPECT_TRUE(GetEntryForTesting(hashes_.at<2>(), &metadata)); - EXPECT_EQ(now - base::TimeDelta::FromDays(3), metadata.GetLastUsedTime()); - EXPECT_EQ(100ul, metadata.GetEntrySize()); + EXPECT_LT( + now - base::TimeDelta::FromDays(3) - base::TimeDelta::FromSeconds(1), + metadata.GetLastUsedTime()); + EXPECT_GT( + now - base::TimeDelta::FromDays(3) + base::TimeDelta::FromSeconds(1), + metadata.GetLastUsedTime()); + EXPECT_EQ(100, metadata.GetEntrySize()); } // Remove something that's going to come in from the loaded index. @@ -393,7 +414,7 @@ TEST_F(SimpleIndexTest, InsertBeforeInit) { base::Time now(base::Time::Now()); EXPECT_LT(now - base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); EXPECT_GT(now + base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); - EXPECT_EQ(0ul, metadata.GetEntrySize()); + EXPECT_EQ(0, metadata.GetEntrySize()); } // Insert and Remove something that's going to come in from the loaded index. @@ -426,7 +447,7 @@ TEST_F(SimpleIndexTest, RemoveInsertBeforeInit) { base::Time now(base::Time::Now()); EXPECT_LT(now - base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); EXPECT_GT(now + base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); - EXPECT_EQ(0ul, metadata.GetEntrySize()); + EXPECT_EQ(0, metadata.GetEntrySize()); } // Do all above tests at once + a non-conflict to test for cross-key @@ -464,18 +485,25 @@ TEST_F(SimpleIndexTest, AllInitConflicts) { EXPECT_TRUE(GetEntryForTesting(hashes_.at<2>(), &metadata)); EXPECT_LT(now - base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); EXPECT_GT(now + base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); - EXPECT_EQ(0ul, metadata.GetEntrySize()); + EXPECT_EQ(0, metadata.GetEntrySize()); EXPECT_FALSE(index()->Has(hashes_.at<3>())); EXPECT_TRUE(GetEntryForTesting(hashes_.at<4>(), &metadata)); EXPECT_LT(now - base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); EXPECT_GT(now + base::TimeDelta::FromMinutes(1), metadata.GetLastUsedTime()); - EXPECT_EQ(0ul, metadata.GetEntrySize()); + EXPECT_EQ(0, metadata.GetEntrySize()); EXPECT_TRUE(GetEntryForTesting(hashes_.at<5>(), &metadata)); - EXPECT_EQ(now - base::TimeDelta::FromDays(6), metadata.GetLastUsedTime()); - EXPECT_EQ(100000u, metadata.GetEntrySize()); + + EXPECT_GT( + now - base::TimeDelta::FromDays(6) + base::TimeDelta::FromSeconds(1), + metadata.GetLastUsedTime()); + EXPECT_LT( + now - base::TimeDelta::FromDays(6) - base::TimeDelta::FromSeconds(1), + metadata.GetLastUsedTime()); + + EXPECT_EQ(100000, metadata.GetEntrySize()); } TEST_F(SimpleIndexTest, BasicEviction) { @@ -564,7 +592,7 @@ TEST_F(SimpleIndexTest, DiskWriteExecuted) { const EntryMetadata& entry1(entry_set.begin()->second); EXPECT_LT(now - base::TimeDelta::FromMinutes(1), entry1.GetLastUsedTime()); EXPECT_GT(now + base::TimeDelta::FromMinutes(1), entry1.GetLastUsedTime()); - EXPECT_EQ(20u, entry1.GetEntrySize()); + EXPECT_EQ(20, entry1.GetEntrySize()); } TEST_F(SimpleIndexTest, DiskWritePostponed) { |