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

Side by Side Diff: net/ssl/ssl_client_session_cache.cc

Issue 2729733002: Roll src/third_party/boringssl/src be2ee342d..a58baaf9e (Closed)
Patch Set: roll further Created 3 years, 9 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 | « net/ssl/openssl_ssl_util.cc ('k') | third_party/boringssl/BUILD.generated_tests.gni » ('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 #include "net/ssl/ssl_client_session_cache.h" 5 #include "net/ssl/ssl_client_session_cache.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/containers/flat_set.h" 9 #include "base/containers/flat_set.h"
10 #include "base/memory/memory_coordinator_client_registry.h" 10 #include "base/memory/memory_coordinator_client_registry.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 cache_.Clear(); 100 cache_.Clear();
101 } 101 }
102 102
103 void SSLClientSessionCache::SetClockForTesting( 103 void SSLClientSessionCache::SetClockForTesting(
104 std::unique_ptr<base::Clock> clock) { 104 std::unique_ptr<base::Clock> clock) {
105 clock_ = std::move(clock); 105 clock_ = std::move(clock);
106 } 106 }
107 107
108 bool SSLClientSessionCache::IsExpired(SSL_SESSION* session, time_t now) { 108 bool SSLClientSessionCache::IsExpired(SSL_SESSION* session, time_t now) {
109 return now < SSL_SESSION_get_time(session) || 109 if (now < 0)
110 now >= 110 return true;
111 uint64_t now_u64 = static_cast<uint64_t>(now);
112 return now_u64 < SSL_SESSION_get_time(session) ||
113 now_u64 >=
111 SSL_SESSION_get_time(session) + SSL_SESSION_get_timeout(session); 114 SSL_SESSION_get_time(session) + SSL_SESSION_get_timeout(session);
112 } 115 }
113 116
114 void SSLClientSessionCache::DumpMemoryStats( 117 void SSLClientSessionCache::DumpMemoryStats(
115 base::trace_event::ProcessMemoryDump* pmd) { 118 base::trace_event::ProcessMemoryDump* pmd) {
116 std::string absolute_name = "net/ssl_session_cache"; 119 std::string absolute_name = "net/ssl_session_cache";
117 base::trace_event::MemoryAllocatorDump* cache_dump = 120 base::trace_event::MemoryAllocatorDump* cache_dump =
118 pmd->GetAllocatorDump(absolute_name); 121 pmd->GetAllocatorDump(absolute_name);
119 // This method can be reached from different URLRequestContexts. Since this is 122 // This method can be reached from different URLRequestContexts. Since this is
120 // a singleton, only log memory stats once. 123 // a singleton, only log memory stats once.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 Flush(); 199 Flush();
197 break; 200 break;
198 } 201 }
199 } 202 }
200 203
201 void SSLClientSessionCache::OnPurgeMemory() { 204 void SSLClientSessionCache::OnPurgeMemory() {
202 Flush(); 205 Flush();
203 } 206 }
204 207
205 } // namespace net 208 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/openssl_ssl_util.cc ('k') | third_party/boringssl/BUILD.generated_tests.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698