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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/socket/ssl_client_socket_openssl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_openssl.cc
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index 10e9d0c0e4663a01a91cdc81f2b9135aac7cac5c..a78a7cf4ed3a486d1cdc650dd6cb9f8444f7129a 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -20,6 +20,7 @@
#include "base/profiler/scoped_tracker.h"
#include "base/strings/string_piece.h"
#include "base/synchronization/lock.h"
+#include "base/threading/thread_local.h"
#include "crypto/ec_private_key.h"
#include "crypto/openssl_util.h"
#include "crypto/scoped_openssl_types.h"
@@ -930,6 +931,11 @@ bool SSLClientSocketOpenSSL::DoTransportIO() {
return network_moved;
}
+// TODO(vadimt): Remove including "base/threading/thread_local.h" and
+// g_first_run_completed once crbug.com/424386 is fixed.
+base::LazyInstance<base::ThreadLocalBoolean>::Leaky g_first_run_completed =
+ LAZY_INSTANCE_INITIALIZER;
+
int SSLClientSocketOpenSSL::DoHandshake() {
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
int net_error = OK;
@@ -945,11 +951,25 @@ int SSLClientSocketOpenSSL::DoHandshake() {
rv = SSL_do_handshake(ssl_);
} else {
- // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is fixed.
- tracked_objects::ScopedTracker tracking_profile1(
- FROM_HERE_WITH_EXPLICIT_FUNCTION("424386 DoHandshake_WithoutCert"));
+ if (g_first_run_completed.Get().Get()) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is
+ // fixed.
+ tracked_objects::ScopedTracker tracking_profile1(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 DoHandshake_WithoutCert Not First"));
- rv = SSL_do_handshake(ssl_);
+ rv = SSL_do_handshake(ssl_);
+ } else {
+ g_first_run_completed.Get().Set(true);
+
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/424386 is
+ // fixed.
+ tracked_objects::ScopedTracker tracking_profile1(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "424386 DoHandshake_WithoutCert First"));
+
+ rv = SSL_do_handshake(ssl_);
+ }
}
if (client_auth_cert_needed_) {
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/socket/ssl_client_socket_openssl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698