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 #ifndef NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
6 #define NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 6 #define NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "net/quic/chromium/quic_http_stream.h" | 36 #include "net/quic/chromium/quic_http_stream.h" |
37 #include "net/quic/core/quic_client_push_promise_index.h" | 37 #include "net/quic/core/quic_client_push_promise_index.h" |
38 #include "net/quic/core/quic_config.h" | 38 #include "net/quic/core/quic_config.h" |
39 #include "net/quic/core/quic_crypto_stream.h" | 39 #include "net/quic/core/quic_crypto_stream.h" |
40 #include "net/quic/core/quic_packets.h" | 40 #include "net/quic/core/quic_packets.h" |
41 #include "net/quic/core/quic_server_id.h" | 41 #include "net/quic/core/quic_server_id.h" |
42 #include "net/ssl/ssl_config_service.h" | 42 #include "net/ssl/ssl_config_service.h" |
43 | 43 |
44 namespace base { | 44 namespace base { |
45 class Value; | 45 class Value; |
| 46 namespace trace_event { |
| 47 class ProcessMemoryDump; |
| 48 } |
46 } | 49 } |
47 | 50 |
48 namespace net { | 51 namespace net { |
49 | 52 |
50 class CTPolicyEnforcer; | 53 class CTPolicyEnforcer; |
51 class CertVerifier; | 54 class CertVerifier; |
52 class ChannelIDService; | 55 class ChannelIDService; |
53 class ClientSocketFactory; | 56 class ClientSocketFactory; |
54 class CTVerifier; | 57 class CTVerifier; |
55 class HostResolver; | 58 class HostResolver; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 const QuicServerId& server_id); | 171 const QuicServerId& server_id); |
169 ~QuicSessionKey() = default; | 172 ~QuicSessionKey() = default; |
170 | 173 |
171 // Needed to be an element of std::set. | 174 // Needed to be an element of std::set. |
172 bool operator<(const QuicSessionKey& other) const; | 175 bool operator<(const QuicSessionKey& other) const; |
173 bool operator==(const QuicSessionKey& other) const; | 176 bool operator==(const QuicSessionKey& other) const; |
174 | 177 |
175 const HostPortPair& destination() const { return destination_; } | 178 const HostPortPair& destination() const { return destination_; } |
176 const QuicServerId& server_id() const { return server_id_; } | 179 const QuicServerId& server_id() const { return server_id_; } |
177 | 180 |
| 181 // Returns estimated memory usage in bytes. |
| 182 size_t EstimateMemoryUsage() const; |
| 183 |
178 private: | 184 private: |
179 HostPortPair destination_; | 185 HostPortPair destination_; |
180 QuicServerId server_id_; | 186 QuicServerId server_id_; |
181 }; | 187 }; |
182 | 188 |
183 QuicStreamFactory( | 189 QuicStreamFactory( |
184 NetLog* net_log, | 190 NetLog* net_log, |
185 HostResolver* host_resolver, | 191 HostResolver* host_resolver, |
186 SSLConfigService* ssl_config_service, | 192 SSLConfigService* ssl_config_service, |
187 ClientSocketFactory* client_socket_factory, | 193 ClientSocketFactory* client_socket_factory, |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 } | 391 } |
386 | 392 |
387 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } | 393 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } |
388 | 394 |
389 bool delay_tcp_race() const { return delay_tcp_race_; } | 395 bool delay_tcp_race() const { return delay_tcp_race_; } |
390 | 396 |
391 bool migrate_sessions_on_network_change() const { | 397 bool migrate_sessions_on_network_change() const { |
392 return migrate_sessions_on_network_change_; | 398 return migrate_sessions_on_network_change_; |
393 } | 399 } |
394 | 400 |
| 401 // Dumps memory allocation stats. |parent_dump_absolute_name| is the name |
| 402 // used by the parent MemoryAllocatorDump in the memory dump hierarchy. |
| 403 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, |
| 404 const std::string& parent_absolute_name) const; |
| 405 |
395 private: | 406 private: |
396 class Job; | 407 class Job; |
397 class CertVerifierJob; | 408 class CertVerifierJob; |
398 friend class test::QuicStreamFactoryPeer; | 409 friend class test::QuicStreamFactoryPeer; |
399 | 410 |
400 typedef std::map<QuicServerId, QuicChromiumClientSession*> SessionMap; | 411 typedef std::map<QuicServerId, QuicChromiumClientSession*> SessionMap; |
401 typedef std::map<QuicChromiumClientSession*, QuicSessionKey> SessionIdMap; | 412 typedef std::map<QuicChromiumClientSession*, QuicSessionKey> SessionIdMap; |
402 typedef std::set<QuicSessionKey> AliasSet; | 413 typedef std::set<QuicSessionKey> AliasSet; |
403 typedef std::map<QuicChromiumClientSession*, AliasSet> SessionAliasMap; | 414 typedef std::map<QuicChromiumClientSession*, AliasSet> SessionAliasMap; |
404 typedef std::set<QuicChromiumClientSession*> SessionSet; | 415 typedef std::set<QuicChromiumClientSession*> SessionSet; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 const scoped_refptr<SSLConfigService> ssl_config_service_; | 657 const scoped_refptr<SSLConfigService> ssl_config_service_; |
647 | 658 |
648 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 659 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
649 | 660 |
650 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 661 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
651 }; | 662 }; |
652 | 663 |
653 } // namespace net | 664 } // namespace net |
654 | 665 |
655 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ | 666 #endif // NET_QUIC_CHROMIUM_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |