Index: net/socket/ssl_client_socket_unittest.cc |
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc |
index 6e9f4b49afc47af7eb40c4611601d2156b80e186..e31a7512b2412ad907e9d24ad491a689b0e9af4c 100644 |
--- a/net/socket/ssl_client_socket_unittest.cc |
+++ b/net/socket/ssl_client_socket_unittest.cc |
@@ -38,8 +38,8 @@ |
#include "net/der/tag.h" |
#include "net/dns/host_resolver.h" |
#include "net/http/transport_security_state.h" |
-#include "net/log/net_log.h" |
#include "net/log/net_log_event_type.h" |
+#include "net/log/net_log_source.h" |
#include "net/log/test_net_log.h" |
#include "net/log/test_net_log_entry.h" |
#include "net/log/test_net_log_util.h" |
@@ -71,6 +71,8 @@ using testing::Truly; |
namespace net { |
+class NetLogWithSource; |
+ |
namespace { |
// WrappedStreamSocket is a base class that wraps an existing StreamSocket, |
@@ -808,7 +810,7 @@ class SSLClientSocketTest : public PlatformTest { |
bool CreateAndConnectSSLClientSocket(const SSLConfig& ssl_config, |
int* result) { |
std::unique_ptr<StreamSocket> transport( |
- new TCPClientSocket(addr_, NULL, &log_, NetLog::Source())); |
+ new TCPClientSocket(addr_, NULL, &log_, NetLogSource())); |
int rv = callback_.GetResult(transport->Connect(callback_.callback())); |
if (rv != OK) { |
LOG(ERROR) << "Could not connect to SpawnedTestServer"; |
@@ -873,7 +875,7 @@ class SSLClientSocketCertRequestInfoTest : public SSLClientSocketTest { |
TestCompletionCallback callback; |
TestNetLog log; |
std::unique_ptr<StreamSocket> transport( |
- new TCPClientSocket(addr, NULL, &log, NetLog::Source())); |
+ new TCPClientSocket(addr, NULL, &log, NetLogSource())); |
int rv = callback.GetResult(transport->Connect(callback.callback())); |
EXPECT_THAT(rv, IsOk()); |
@@ -919,7 +921,7 @@ class SSLClientSocketFalseStartTest : public SSLClientSocketTest { |
CHECK(spawned_test_server()); |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<FakeBlockingStreamSocket> transport( |
new FakeBlockingStreamSocket(std::move(real_transport))); |
int rv = callback->GetResult(transport->Connect(callback->callback())); |
@@ -1057,7 +1059,7 @@ TEST_F(SSLClientSocketTest, Connect) { |
TestCompletionCallback callback; |
TestNetLog log; |
std::unique_ptr<StreamSocket> transport( |
- new TCPClientSocket(addr(), NULL, &log, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, &log, NetLogSource())); |
int rv = callback.GetResult(transport->Connect(callback.callback())); |
EXPECT_THAT(rv, IsOk()); |
@@ -1203,7 +1205,7 @@ TEST_F(SSLClientSocketTest, Read) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
EXPECT_EQ(0, transport->GetTotalReceivedBytes()); |
int rv = callback.GetResult(transport->Connect(callback.callback())); |
@@ -1260,7 +1262,7 @@ TEST_F(SSLClientSocketTest, Connect_WithSynchronousError) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<SynchronousErrorStreamSocket> transport( |
new SynchronousErrorStreamSocket(std::move(real_transport))); |
int rv = callback.GetResult(transport->Connect(callback.callback())); |
@@ -1291,7 +1293,7 @@ TEST_F(SSLClientSocketTest, Read_WithSynchronousError) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<SynchronousErrorStreamSocket> transport( |
new SynchronousErrorStreamSocket(std::move(real_transport))); |
int rv = callback.GetResult(transport->Connect(callback.callback())); |
@@ -1341,7 +1343,7 @@ TEST_F(SSLClientSocketTest, Write_WithSynchronousError) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
// Note: |error_socket|'s ownership is handed to |transport|, but a pointer |
// is retained in order to configure additional errors. |
std::unique_ptr<SynchronousErrorStreamSocket> error_socket( |
@@ -1408,7 +1410,7 @@ TEST_F(SSLClientSocketTest, Write_WithSynchronousErrorNoRead) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
// Note: intermediate sockets' ownership are handed to |sock|, but a pointer |
// is retained in order to query them. |
std::unique_ptr<SynchronousErrorStreamSocket> error_socket( |
@@ -1508,7 +1510,7 @@ TEST_F(SSLClientSocketTest, Read_DeleteWhilePendingFullDuplex) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
// Note: |error_socket|'s ownership is handed to |transport|, but a pointer |
// is retained in order to configure additional errors. |
std::unique_ptr<SynchronousErrorStreamSocket> error_socket( |
@@ -1587,7 +1589,7 @@ TEST_F(SSLClientSocketTest, Read_WithWriteError) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
// Note: |error_socket|'s ownership is handed to |transport|, but a pointer |
// is retained in order to configure additional errors. |
std::unique_ptr<SynchronousErrorStreamSocket> error_socket( |
@@ -1677,7 +1679,7 @@ TEST_F(SSLClientSocketTest, Connect_WithZeroReturn) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<SynchronousErrorStreamSocket> transport( |
new SynchronousErrorStreamSocket(std::move(real_transport))); |
int rv = callback.GetResult(transport->Connect(callback.callback())); |
@@ -1703,7 +1705,7 @@ TEST_F(SSLClientSocketTest, Read_WithZeroReturn) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<SynchronousErrorStreamSocket> transport( |
new SynchronousErrorStreamSocket(std::move(real_transport))); |
int rv = callback.GetResult(transport->Connect(callback.callback())); |
@@ -1736,7 +1738,7 @@ TEST_F(SSLClientSocketTest, Read_WithAsyncZeroReturn) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<SynchronousErrorStreamSocket> error_socket( |
new SynchronousErrorStreamSocket(std::move(real_transport))); |
SynchronousErrorStreamSocket* raw_error_socket = error_socket.get(); |
@@ -1817,7 +1819,7 @@ TEST_F(SSLClientSocketTest, Read_ManySmallRecords) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<ReadBufferingStreamSocket> transport( |
new ReadBufferingStreamSocket(std::move(real_transport))); |
ReadBufferingStreamSocket* raw_transport = transport.get(); |
@@ -1888,7 +1890,7 @@ TEST_F(SSLClientSocketTest, Read_FullLogging) { |
TestNetLog log; |
log.SetCaptureMode(NetLogCaptureMode::IncludeSocketBytes()); |
std::unique_ptr<StreamSocket> transport( |
- new TCPClientSocket(addr(), NULL, &log, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, &log, NetLogSource())); |
int rv = callback.GetResult(transport->Connect(callback.callback())); |
EXPECT_THAT(rv, IsOk()); |
@@ -2001,7 +2003,7 @@ TEST_F(SSLClientSocketTest, ClientSocketHandleNotFromPool) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
int rv = callback.GetResult(transport->Connect(callback.callback())); |
EXPECT_THAT(rv, IsOk()); |
@@ -2523,7 +2525,7 @@ TEST_F(SSLClientSocketTest, ReusableAfterWrite) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<FakeBlockingStreamSocket> transport( |
new FakeBlockingStreamSocket(std::move(real_transport))); |
FakeBlockingStreamSocket* raw_transport = transport.get(); |
@@ -2580,7 +2582,7 @@ TEST_F(SSLClientSocketTest, SessionResumption) { |
// Using a different HostPortPair uses a different session cache key. |
std::unique_ptr<StreamSocket> transport( |
- new TCPClientSocket(addr(), NULL, &log_, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, &log_, NetLogSource())); |
TestCompletionCallback callback; |
ASSERT_THAT(callback.GetResult(transport->Connect(callback.callback())), |
IsOk()); |
@@ -3463,7 +3465,7 @@ TEST_F(SSLClientSocketTest, HandshakeFailureServerHello) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<FakeBlockingStreamSocket> transport( |
new FakeBlockingStreamSocket(std::move(real_transport))); |
FakeBlockingStreamSocket* raw_transport = transport.get(); |
@@ -3496,7 +3498,7 @@ TEST_F(SSLClientSocketTest, HandshakeFailureNoClientCerts) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<FakeBlockingStreamSocket> transport( |
new FakeBlockingStreamSocket(std::move(real_transport))); |
FakeBlockingStreamSocket* raw_transport = transport.get(); |
@@ -3544,7 +3546,7 @@ TEST_F(SSLClientSocketTest, LateHandshakeFailureMissingClientCerts) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<FakeBlockingStreamSocket> transport( |
new FakeBlockingStreamSocket(std::move(real_transport))); |
FakeBlockingStreamSocket* raw_transport = transport.get(); |
@@ -3593,7 +3595,7 @@ TEST_F(SSLClientSocketTest, LateHandshakeFailureSendClientCerts) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<FakeBlockingStreamSocket> transport( |
new FakeBlockingStreamSocket(std::move(real_transport))); |
FakeBlockingStreamSocket* raw_transport = transport.get(); |
@@ -3643,7 +3645,7 @@ TEST_F(SSLClientSocketTest, AccessDeniedNoClientCerts) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<FakeBlockingStreamSocket> transport( |
new FakeBlockingStreamSocket(std::move(real_transport))); |
FakeBlockingStreamSocket* raw_transport = transport.get(); |
@@ -3689,7 +3691,7 @@ TEST_F(SSLClientSocketTest, AccessDeniedClientCerts) { |
TestCompletionCallback callback; |
std::unique_ptr<StreamSocket> real_transport( |
- new TCPClientSocket(addr(), NULL, NULL, NetLog::Source())); |
+ new TCPClientSocket(addr(), NULL, NULL, NetLogSource())); |
std::unique_ptr<FakeBlockingStreamSocket> transport( |
new FakeBlockingStreamSocket(std::move(real_transport))); |
FakeBlockingStreamSocket* raw_transport = transport.get(); |