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

Unified Diff: net/socket/ssl_client_socket_impl.cc

Issue 2414883005: TEMP DO NOT LAND (Closed)
Patch Set: tmp Created 4 years, 1 month 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_impl.h ('k') | net/socket/ssl_client_socket_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_impl.cc
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc
index bb76bf8c46d6d84f7d5ad7d48eacfe751204d151..ae1eb4bfc1e75b8011a37762228c1f217f358bfb 100644
--- a/net/socket/ssl_client_socket_impl.cc
+++ b/net/socket/ssl_client_socket_impl.cc
@@ -53,6 +53,9 @@
#include "third_party/boringssl/src/include/openssl/mem.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
+#include "base/trace_event/memory_dump_manager.h"
+#include "base/strings/stringprintf.h"
+
#if !defined(OS_NACL)
#include "net/ssl/ssl_key_logger.h"
#endif
@@ -267,7 +270,6 @@ class SSLClientSocketImpl::SSLContext {
SSL_CTX_set_session_cache_mode(
ssl_ctx_.get(), SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_NO_INTERNAL);
SSL_CTX_sess_set_new_cb(ssl_ctx_.get(), NewSessionCallback);
- SSL_CTX_set_timeout(ssl_ctx_.get(), 1 * 60 * 60 /* one hour */);
SSL_CTX_set_grease_enabled(ssl_ctx_.get(), 1);
@@ -524,6 +526,7 @@ SSLClientSocketImpl::SSLClientSocketImpl(
CHECK(transport_security_state_);
CHECK(cert_transparency_verifier_);
CHECK(policy_enforcer_);
+
}
SSLClientSocketImpl::~SSLClientSocketImpl() {
@@ -786,6 +789,52 @@ int64_t SSLClientSocketImpl::GetTotalReceivedBytes() const {
return transport_->socket()->GetTotalReceivedBytes();
}
+void SSLClientSocketImpl::PopulateAllocatorDump(
+ base::trace_event::MemoryAllocatorDump* dump) const {
+ size_t total_size = 0;
+ base::trace_event::MemoryAllocatorDump* socket_dump =
+ dump->process_memory_dump()->CreateAllocatorDump(base::StringPrintf(
+ "%s/ssl_socket_%p", dump->absolute_name().c_str(), this));
+ if (transport_adapter_) {
+ size_t bio_buffers_size = transport_adapter_->GetEffectiveSize();
+ socket_dump->AddScalar("buffer_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ bio_buffers_size);
+ total_size+= bio_buffers_size;
+ }
+ size_t total_cert_size = 0;
+ size_t certs_count = 0;
+ if (server_cert_chain_) {
+ certs_count = server_cert_chain_->size();
+ for (size_t i = 0; i < certs_count; ++i) {
+ X509* cert = server_cert_chain_->Get(i);
+ total_cert_size += i2d_X509(cert, nullptr);
+ }
+ }
+ socket_dump->AddScalar("cert_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ total_cert_size);
+ socket_dump->AddScalar("cert_count",
+ base::trace_event::MemoryAllocatorDump::kUnitsObjects,
+ certs_count);
+ // FIXME
+ socket_dump->AddString(
+ "host and port", "",
+ base::StringPrintf("%s:%d", host_and_port_.host().c_str(),
+ host_and_port_.port()));
+ total_size += total_cert_size;
+ socket_dump->AddScalar(
+ base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ total_size);
+}
+
+// static
+void SSLClientSocketImpl::PopulateSSLClientSessionAllocatorDump(
+ base::trace_event::MemoryAllocatorDump* dump) {
+ SSLContext::GetInstance()->session_cache()->PopulateAllocatorDump(dump);
+}
+
int SSLClientSocketImpl::Read(IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) {
@@ -1311,6 +1360,8 @@ void SSLClientSocketImpl::OnHandshakeIOComplete(int result) {
}
int SSLClientSocketImpl::DoHandshakeLoop(int last_io_result) {
+ TRACE_HEAP_PROFILER_API_SCOPED_TASK_EXECUTION a("net/do_hand_shake");
+
TRACE_EVENT0("net", "SSLClientSocketImpl::DoHandshakeLoop");
int rv = last_io_result;
do {
« no previous file with comments | « net/socket/ssl_client_socket_impl.h ('k') | net/socket/ssl_client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698