diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-11-20 10:33:36 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-11-22 11:45:12 +0000 |
commit | be59a35641616a4cf23c4a13fa0632624b021c1b (patch) | |
tree | 9da183258bdf9cc413f7562079d25ace6955467f /chromium/net/http/mock_http_cache.cc | |
parent | d702e4b6a64574e97fc7df8fe3238cde70242080 (diff) | |
download | qtwebengine-chromium-be59a35641616a4cf23c4a13fa0632624b021c1b.tar.gz |
BASELINE: Update Chromium to 62.0.3202.101
Change-Id: I2d5eca8117600df6d331f6166ab24d943d9814ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/net/http/mock_http_cache.cc')
-rw-r--r-- | chromium/net/http/mock_http_cache.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/chromium/net/http/mock_http_cache.cc b/chromium/net/http/mock_http_cache.cc index bf81c4ee1ee..fcafea32c0d 100644 --- a/chromium/net/http/mock_http_cache.cc +++ b/chromium/net/http/mock_http_cache.cc @@ -68,6 +68,7 @@ struct MockDiskEntry::CallbackInfo { MockDiskEntry::MockDiskEntry(const std::string& key) : key_(key), + in_memory_data_(0), doomed_(false), sparse_(false), fail_requests_(false), @@ -394,6 +395,7 @@ MockDiskCache::MockDiskCache() soft_failures_(false), double_create_check_(true), fail_sparse_requests_(false), + support_in_memory_entry_data_(true), defer_op_(MockDiskEntry::DEFER_NONE), resume_return_code_(0) {} @@ -552,6 +554,22 @@ size_t MockDiskCache::DumpMemoryStats( return 0u; } +uint8_t MockDiskCache::GetEntryInMemoryData(const std::string& key) { + if (!support_in_memory_entry_data_) + return 0; + + EntryMap::iterator it = entries_.find(key); + if (it != entries_.end()) + return it->second->in_memory_data(); + return 0; +} + +void MockDiskCache::SetEntryInMemoryData(const std::string& key, uint8_t data) { + EntryMap::iterator it = entries_.find(key); + if (it != entries_.end()) + it->second->set_in_memory_data(data); +} + void MockDiskCache::ReleaseAll() { for (auto entry : entries_) entry.second->Release(); @@ -606,12 +624,12 @@ MockHttpCache::MockHttpCache( : MockHttpCache(std::move(disk_cache_factory), false) {} MockHttpCache::MockHttpCache(bool is_main_cache) - : MockHttpCache(base::MakeUnique<MockBackendFactory>(), is_main_cache) {} + : MockHttpCache(std::make_unique<MockBackendFactory>(), is_main_cache) {} MockHttpCache::MockHttpCache( std::unique_ptr<HttpCache::BackendFactory> disk_cache_factory, bool is_main_cache) - : http_cache_(base::MakeUnique<MockNetworkLayer>(), + : http_cache_(std::make_unique<MockNetworkLayer>(), std::move(disk_cache_factory), is_main_cache) {} |