summaryrefslogtreecommitdiff
path: root/chromium/net/disk_cache/simple
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-15 10:20:33 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-05-15 10:28:57 +0000
commitd17ea114e5ef69ad5d5d7413280a13e6428098aa (patch)
tree2c01a75df69f30d27b1432467cfe7c1467a498da /chromium/net/disk_cache/simple
parent8c5c43c7b138c9b4b0bf56d946e61d3bbc111bec (diff)
downloadqtwebengine-chromium-d17ea114e5ef69ad5d5d7413280a13e6428098aa.tar.gz
BASELINE: Update Chromium to 67.0.3396.47
Change-Id: Idcb1341782e417561a2473eeecc82642dafda5b7 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/net/disk_cache/simple')
-rw-r--r--chromium/net/disk_cache/simple/simple_entry_impl.cc7
-rw-r--r--chromium/net/disk_cache/simple/simple_entry_impl.h1
-rw-r--r--chromium/net/disk_cache/simple/simple_index.cc7
-rw-r--r--chromium/net/disk_cache/simple/simple_index.h2
4 files changed, 17 insertions, 0 deletions
diff --git a/chromium/net/disk_cache/simple/simple_entry_impl.cc b/chromium/net/disk_cache/simple/simple_entry_impl.cc
index 147350d3714..594e50f6180 100644
--- a/chromium/net/disk_cache/simple/simple_entry_impl.cc
+++ b/chromium/net/disk_cache/simple/simple_entry_impl.cc
@@ -599,6 +599,13 @@ int SimpleEntryImpl::ReadyForSparseIO(const CompletionCallback& callback) {
return net::OK;
}
+void SimpleEntryImpl::SetLastUsedTimeForTest(base::Time time) {
+ // Note that we do not update |last_used_| here as it gets overwritten
+ // by UpdateDataFromEntryStat with the current time. It would be more involved
+ // to make that value stick and is not needed by the current tests.
+ backend_->index()->SetLastUsedTimeForTest(entry_hash_, time);
+}
+
size_t SimpleEntryImpl::EstimateMemoryUsage() const {
// TODO(xunjieli): crbug.com/669108. It'd be nice to have the rest of |entry|
// measured, but the ownership of SimpleSynchronousEntry isn't straightforward
diff --git a/chromium/net/disk_cache/simple/simple_entry_impl.h b/chromium/net/disk_cache/simple/simple_entry_impl.h
index 1f56b92c4df..6cae881d3cf 100644
--- a/chromium/net/disk_cache/simple/simple_entry_impl.h
+++ b/chromium/net/disk_cache/simple/simple_entry_impl.h
@@ -132,6 +132,7 @@ class NET_EXPORT_PRIVATE SimpleEntryImpl : public Entry,
bool CouldBeSparse() const override;
void CancelSparseIO() override;
int ReadyForSparseIO(const CompletionCallback& callback) override;
+ void SetLastUsedTimeForTest(base::Time time) override;
// Returns the estimate of dynamically allocated memory in bytes.
size_t EstimateMemoryUsage() const;
diff --git a/chromium/net/disk_cache/simple/simple_index.cc b/chromium/net/disk_cache/simple/simple_index.cc
index 30cf9efc833..a891458d32c 100644
--- a/chromium/net/disk_cache/simple/simple_index.cc
+++ b/chromium/net/disk_cache/simple/simple_index.cc
@@ -278,6 +278,13 @@ size_t SimpleIndex::EstimateMemoryUsage() const {
base::trace_event::EstimateMemoryUsage(removed_entries_);
}
+void SimpleIndex::SetLastUsedTimeForTest(uint64_t entry_hash,
+ const base::Time last_used) {
+ EntrySet::iterator it = entries_set_.find(entry_hash);
+ DCHECK(it != entries_set_.end());
+ it->second.SetLastUsedTime(last_used);
+}
+
void SimpleIndex::Insert(uint64_t entry_hash) {
DCHECK(io_thread_checker_.CalledOnValidThread());
// Upon insert we don't know yet the size of the entry.
diff --git a/chromium/net/disk_cache/simple/simple_index.h b/chromium/net/disk_cache/simple/simple_index.h
index 426241e2777..0da8cd91888 100644
--- a/chromium/net/disk_cache/simple/simple_index.h
+++ b/chromium/net/disk_cache/simple/simple_index.h
@@ -192,6 +192,8 @@ class NET_EXPORT_PRIVATE SimpleIndex
// Returns the estimate of dynamically allocated memory in bytes.
size_t EstimateMemoryUsage() const;
+ void SetLastUsedTimeForTest(uint64_t entry_hash, const base::Time last_used);
+
private:
friend class SimpleIndexTest;
FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, IndexSizeCorrectOnMerge);