| Index: net/ssl/ssl_client_session_cache.h
|
| diff --git a/net/ssl/ssl_client_session_cache.h b/net/ssl/ssl_client_session_cache.h
|
| index 4a82010badda3722a6d318ff74951016a155bfc2..0cfefc31e75ad63756d04e25ba1a1fde53631571 100644
|
| --- a/net/ssl/ssl_client_session_cache.h
|
| +++ b/net/ssl/ssl_client_session_cache.h
|
| @@ -46,8 +46,14 @@ class NET_EXPORT SSLClientSessionCache : public base::MemoryCoordinatorClient {
|
| size_t size() const;
|
|
|
| // Returns the session associated with |cache_key| and moves it to the front
|
| - // of the MRU list. Returns nullptr if there is none.
|
| - bssl::UniquePtr<SSL_SESSION> Lookup(const std::string& cache_key);
|
| + // of the MRU list. Returns nullptr if there is none. If |count| is non-null,
|
| + // |*count| will contain the number of times this session has been looked up
|
| + // (including this call).
|
| + bssl::UniquePtr<SSL_SESSION> Lookup(const std::string& cache_key, int* count);
|
| +
|
| + // Resets the count returned by Lookup to 0 for the session associated with
|
| + // |cache_key|.
|
| + void ResetLookupCount(const std::string& cache_key);
|
|
|
| // Inserts |session| into the cache at |cache_key|. If there is an existing
|
| // one, it is released. Every |expiration_check_count| calls, the cache is
|
| @@ -64,6 +70,15 @@ class NET_EXPORT SSLClientSessionCache : public base::MemoryCoordinatorClient {
|
| void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd);
|
|
|
| private:
|
| + struct Entry {
|
| + Entry();
|
| + Entry(Entry&&);
|
| + ~Entry();
|
| +
|
| + int lookups;
|
| + bssl::UniquePtr<SSL_SESSION> session;
|
| + };
|
| +
|
| // base::MemoryCoordinatorClient implementation:
|
| void OnMemoryStateChange(base::MemoryState state) override;
|
|
|
| @@ -79,7 +94,7 @@ class NET_EXPORT SSLClientSessionCache : public base::MemoryCoordinatorClient {
|
|
|
| std::unique_ptr<base::Clock> clock_;
|
| Config config_;
|
| - base::HashingMRUCache<std::string, bssl::UniquePtr<SSL_SESSION>> cache_;
|
| + base::HashingMRUCache<std::string, Entry> cache_;
|
| size_t lookups_since_flush_;
|
|
|
| // TODO(davidben): After https://crbug.com/458365 is fixed, replace this with
|
|
|