Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1120)

Side by Side Diff: net/ssl/ssl_client_session_cache_openssl.h

Issue 1079943006: Make SSLClientSessionCacheOpenSSL thread-safe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/ssl/ssl_client_session_cache_openssl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_SSL_SSL_CLIENT_SESSION_CACHE_OPENSSL_H 5 #ifndef NET_SSL_SSL_CLIENT_SESSION_CACHE_OPENSSL_H
6 #define NET_SSL_SSL_CLIENT_SESSION_CACHE_OPENSSL_H 6 #define NET_SSL_SSL_CLIENT_SESSION_CACHE_OPENSSL_H
7 7
8 #include <openssl/ssl.h> 8 #include <openssl/ssl.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/containers/mru_cache.h" 12 #include "base/containers/mru_cache.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/synchronization/lock.h"
15 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
16 #include "base/time/time.h" 17 #include "base/time/time.h"
17 #include "net/base/net_export.h" 18 #include "net/base/net_export.h"
18 #include "net/ssl/scoped_openssl_types.h" 19 #include "net/ssl/scoped_openssl_types.h"
19 20
20 namespace base { 21 namespace base {
21 class Clock; 22 class Clock;
22 } 23 }
23 24
24 namespace net { 25 namespace net {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 bool IsExpired(CacheEntry* entry, const base::Time& now); 76 bool IsExpired(CacheEntry* entry, const base::Time& now);
76 77
77 // Removes all expired sessions from the cache. 78 // Removes all expired sessions from the cache.
78 void FlushExpiredSessions(); 79 void FlushExpiredSessions();
79 80
80 scoped_ptr<base::Clock> clock_; 81 scoped_ptr<base::Clock> clock_;
81 Config config_; 82 Config config_;
82 CacheEntryMap cache_; 83 CacheEntryMap cache_;
83 size_t lookups_since_flush_; 84 size_t lookups_since_flush_;
84 85
85 base::ThreadChecker thread_checker_; 86 // TODO(davidben): After https://crbug.com/458365 is fixed, replace this with
87 // a ThreadChecker. The session cache should be single-threaded like other
88 // classes in net.
89 base::Lock lock_;
86 90
87 DISALLOW_COPY_AND_ASSIGN(SSLClientSessionCacheOpenSSL); 91 DISALLOW_COPY_AND_ASSIGN(SSLClientSessionCacheOpenSSL);
88 }; 92 };
89 93
90 } // namespace net 94 } // namespace net
91 95
92 #endif // NET_SSL_SSL_CLIENT_SESSION_CACHE_OPENSSL_H 96 #endif // NET_SSL_SSL_CLIENT_SESSION_CACHE_OPENSSL_H
OLDNEW
« no previous file with comments | « no previous file | net/ssl/ssl_client_session_cache_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698