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

Unified Diff: net/socket/ssl_session_cache_openssl.cc

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | net/socket/transport_client_socket_pool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_session_cache_openssl.cc
diff --git a/net/socket/ssl_session_cache_openssl.cc b/net/socket/ssl_session_cache_openssl.cc
index 92ae44b9ac526a1e9b84137e04de0923c461d7ba..c77790f1a622146a1266bd3016c041d02f0c61be 100644
--- a/net/socket/ssl_session_cache_openssl.cc
+++ b/net/socket/ssl_session_cache_openssl.cc
@@ -13,6 +13,7 @@
#include "base/containers/hash_tables.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/profiler/scoped_tracker.h"
#include "base/synchronization/lock.h"
namespace net {
@@ -156,6 +157,11 @@ class SSLSessionCacheOpenSSLImpl {
SSLSessionCacheOpenSSLImpl(SSL_CTX* ctx,
const SSLSessionCacheOpenSSL::Config& config)
: ctx_(ctx), config_(config), expiration_check_(0) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 SSLSessionCacheOpenSSLImpl::SSLSessionCacheOpenSSLImpl"));
+
DCHECK(ctx);
// NO_INTERNAL_STORE disables OpenSSL's builtin cache, and
@@ -196,6 +202,11 @@ class SSLSessionCacheOpenSSLImpl {
//
// Return true if a cached session ID was found, false otherwise.
bool SetSSLSession(SSL* ssl) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 SSLSessionCacheOpenSSLImpl::SetSSLSession"));
+
std::string cache_key = config_.key_func(ssl);
if (cache_key.empty())
return false;
@@ -206,6 +217,11 @@ class SSLSessionCacheOpenSSLImpl {
// Variant of SetSSLSession to be used when the client already has computed
// the cache key. Avoid a call to the configuration's |key_func| function.
bool SetSSLSessionWithKey(SSL* ssl, const std::string& cache_key) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 SSLSessionCacheOpenSSLImpl::SetSSLSessionWithKey"));
+
base::AutoLock locked(lock_);
DCHECK_EQ(config_.key_func(ssl), cache_key);
@@ -239,6 +255,11 @@ class SSLSessionCacheOpenSSLImpl {
// Return true iff a cached session was associated with the given |cache_key|.
bool SSLSessionIsInCache(const std::string& cache_key) const {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 SSLSessionCacheOpenSSLImpl::SSLSessionIsInCache"));
+
base::AutoLock locked(lock_);
KeyIndex::const_iterator it = key_index_.find(cache_key);
if (it == key_index_.end())
@@ -254,6 +275,11 @@ class SSLSessionCacheOpenSSLImpl {
}
void MarkSSLSessionAsGood(SSL* ssl) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 SSLSessionCacheOpenSSLImpl::MarkSSLSessionAsGood"));
+
SSL_SESSION* session = SSL_get_session(ssl);
CHECK(session);
@@ -264,6 +290,11 @@ class SSLSessionCacheOpenSSLImpl {
// Flush all entries from the cache.
void Flush() {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 SSLSessionCacheOpenSSLImpl::Flush"));
+
base::AutoLock lock(lock_);
id_index_.clear();
key_index_.clear();
@@ -358,6 +389,11 @@ class SSLSessionCacheOpenSSLImpl {
// to indicate that it took ownership of the session, i.e. that the caller
// should not decrement its reference count after completion.
static int NewSessionCallbackStatic(SSL* ssl, SSL_SESSION* session) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 SSLSessionCacheOpenSSLImpl::NewSessionCallbackStatic"));
+
SSLSessionCacheOpenSSLImpl* cache = GetCache(ssl->ctx);
cache->OnSessionAdded(ssl, session);
return 1;
@@ -366,6 +402,11 @@ class SSLSessionCacheOpenSSLImpl {
// Called by OpenSSL to indicate that a session must be removed from the
// cache. This happens when SSL_CTX is destroyed.
static void RemoveSessionCallbackStatic(SSL_CTX* ctx, SSL_SESSION* session) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 SSLSessionCacheOpenSSLImpl::RemoveSessionCallbackStatic"));
+
GetCache(ctx)->OnSessionRemoved(session);
}
@@ -387,6 +428,11 @@ class SSLSessionCacheOpenSSLImpl {
static int GenerateSessionIdStatic(const SSL* ssl,
unsigned char* id,
unsigned* id_len) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 SSLSessionCacheOpenSSLImpl::GenerateSessionIdStatic"));
+
if (!GetCache(ssl->ctx)->OnGenerateSessionId(id, *id_len))
return 0;
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | net/socket/transport_client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698