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

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

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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') | net/ssl/ssl_platform_key_nss.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 #include "net/ssl/ssl_client_session_cache_openssl.h" 5 #include "net/ssl/ssl_client_session_cache_openssl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/time/clock.h" 9 #include "base/time/clock.h"
10 #include "base/time/default_clock.h" 10 #include "base/time/default_clock.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 void SSLClientSessionCacheOpenSSL::Flush() { 63 void SSLClientSessionCacheOpenSSL::Flush() {
64 base::AutoLock lock(lock_); 64 base::AutoLock lock(lock_);
65 65
66 cache_.Clear(); 66 cache_.Clear();
67 } 67 }
68 68
69 void SSLClientSessionCacheOpenSSL::SetClockForTesting( 69 void SSLClientSessionCacheOpenSSL::SetClockForTesting(
70 scoped_ptr<base::Clock> clock) { 70 scoped_ptr<base::Clock> clock) {
71 clock_ = clock.Pass(); 71 clock_ = std::move(clock);
72 } 72 }
73 73
74 SSLClientSessionCacheOpenSSL::CacheEntry::CacheEntry() { 74 SSLClientSessionCacheOpenSSL::CacheEntry::CacheEntry() {
75 } 75 }
76 76
77 SSLClientSessionCacheOpenSSL::CacheEntry::~CacheEntry() { 77 SSLClientSessionCacheOpenSSL::CacheEntry::~CacheEntry() {
78 } 78 }
79 79
80 bool SSLClientSessionCacheOpenSSL::IsExpired( 80 bool SSLClientSessionCacheOpenSSL::IsExpired(
81 SSLClientSessionCacheOpenSSL::CacheEntry* entry, 81 SSLClientSessionCacheOpenSSL::CacheEntry* entry,
82 const base::Time& now) { 82 const base::Time& now) {
83 return now < entry->creation_time || 83 return now < entry->creation_time ||
84 entry->creation_time + config_.timeout < now; 84 entry->creation_time + config_.timeout < now;
85 } 85 }
86 86
87 void SSLClientSessionCacheOpenSSL::FlushExpiredSessions() { 87 void SSLClientSessionCacheOpenSSL::FlushExpiredSessions() {
88 base::Time now = clock_->Now(); 88 base::Time now = clock_->Now();
89 CacheEntryMap::iterator iter = cache_.begin(); 89 CacheEntryMap::iterator iter = cache_.begin();
90 while (iter != cache_.end()) { 90 while (iter != cache_.end()) {
91 if (IsExpired(iter->second, now)) { 91 if (IsExpired(iter->second, now)) {
92 iter = cache_.Erase(iter); 92 iter = cache_.Erase(iter);
93 } else { 93 } else {
94 ++iter; 94 ++iter;
95 } 95 }
96 } 96 }
97 } 97 }
98 98
99 } // namespace net 99 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/openssl_ssl_util.cc ('k') | net/ssl/ssl_platform_key_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698