OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/dns/dns_session.h" | 5 #include "net/dns/dns_session.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "net/base/ip_address.h" | 14 #include "net/base/ip_address.h" |
| 15 #include "net/base/socket_performance_watcher.h" |
15 #include "net/dns/dns_protocol.h" | 16 #include "net/dns/dns_protocol.h" |
16 #include "net/dns/dns_socket_pool.h" | 17 #include "net/dns/dns_socket_pool.h" |
17 #include "net/log/net_log.h" | 18 #include "net/log/net_log.h" |
18 #include "net/socket/socket_test_util.h" | 19 #include "net/socket/socket_test_util.h" |
19 #include "net/socket/ssl_client_socket.h" | 20 #include "net/socket/ssl_client_socket.h" |
20 #include "net/socket/stream_socket.h" | 21 #include "net/socket/stream_socket.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
22 | 23 |
23 namespace net { | 24 namespace net { |
24 | 25 |
25 namespace { | 26 namespace { |
26 | 27 |
27 class TestClientSocketFactory : public ClientSocketFactory { | 28 class TestClientSocketFactory : public ClientSocketFactory { |
28 public: | 29 public: |
29 ~TestClientSocketFactory() override; | 30 ~TestClientSocketFactory() override; |
30 | 31 |
31 scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket( | 32 scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket( |
32 DatagramSocket::BindType bind_type, | 33 DatagramSocket::BindType bind_type, |
33 const RandIntCallback& rand_int_cb, | 34 const RandIntCallback& rand_int_cb, |
34 NetLog* net_log, | 35 NetLog* net_log, |
35 const NetLog::Source& source) override; | 36 const NetLog::Source& source) override; |
36 | 37 |
37 scoped_ptr<StreamSocket> CreateTransportClientSocket( | 38 scoped_ptr<StreamSocket> CreateTransportClientSocket( |
38 const AddressList& addresses, | 39 const AddressList& addresses, |
| 40 scoped_ptr<SocketPerformanceWatcher>, |
39 NetLog*, | 41 NetLog*, |
40 const NetLog::Source&) override { | 42 const NetLog::Source&) override { |
41 NOTIMPLEMENTED(); | 43 NOTIMPLEMENTED(); |
42 return scoped_ptr<StreamSocket>(); | 44 return scoped_ptr<StreamSocket>(); |
43 } | 45 } |
44 | 46 |
45 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( | 47 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( |
46 scoped_ptr<ClientSocketHandle> transport_socket, | 48 scoped_ptr<ClientSocketHandle> transport_socket, |
47 const HostPortPair& host_and_port, | 49 const HostPortPair& host_and_port, |
48 const SSLConfig& ssl_config, | 50 const SSLConfig& ssl_config, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 TEST_F(DnsSessionTest, HistogramTimeoutLong) { | 242 TEST_F(DnsSessionTest, HistogramTimeoutLong) { |
241 config_.timeout = base::TimeDelta::FromSeconds(15); | 243 config_.timeout = base::TimeDelta::FromSeconds(15); |
242 Initialize(2); | 244 Initialize(2); |
243 base::TimeDelta timeout = session_->NextTimeout(0, 0); | 245 base::TimeDelta timeout = session_->NextTimeout(0, 0); |
244 EXPECT_EQ(timeout.InMilliseconds(), config_.timeout.InMilliseconds()); | 246 EXPECT_EQ(timeout.InMilliseconds(), config_.timeout.InMilliseconds()); |
245 } | 247 } |
246 | 248 |
247 } // namespace | 249 } // namespace |
248 | 250 |
249 } // namespace net | 251 } // namespace net |
OLD | NEW |