| 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..bb658c229c21fa176fc7be9795c54207c8483c8d 100644
|
| --- a/net/ssl/ssl_client_session_cache.h
|
| +++ b/net/ssl/ssl_client_session_cache.h
|
| @@ -49,6 +49,12 @@ class NET_EXPORT SSLClientSessionCache : public base::MemoryCoordinatorClient {
|
| // of the MRU list. Returns nullptr if there is none.
|
| bssl::UniquePtr<SSL_SESSION> Lookup(const std::string& cache_key);
|
|
|
| + // If Lookup returns a non-null pointer, this method must be called once the
|
| + // TLS handshake done with the session from Lookup has completed. If
|
| + // |should_log| is true, the number of concurrent lookups will be logged to
|
| + // UMA once the count has reached 0.
|
| + void DecrementLookupCount(const std::string& cache_key, bool should_log);
|
| +
|
| // 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
|
| // checked for stale entries.
|
| @@ -64,6 +70,18 @@ class NET_EXPORT SSLClientSessionCache : public base::MemoryCoordinatorClient {
|
| void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd);
|
|
|
| private:
|
| + struct Entry {
|
| + public:
|
| + Entry();
|
| + Entry(Entry&&);
|
| + ~Entry();
|
| +
|
| + size_t active_lookups;
|
| + size_t max_lookups;
|
| + bool should_log;
|
| + bssl::UniquePtr<SSL_SESSION> session;
|
| + };
|
| +
|
| // base::MemoryCoordinatorClient implementation:
|
| void OnMemoryStateChange(base::MemoryState state) override;
|
|
|
| @@ -79,7 +97,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
|
|
|