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_QUIC_STREAM_FACTORY_H_ | 5 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_ |
6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ | 6 #define NET_QUIC_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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 int ConfigureSocket(DatagramClientSocket* socket, | 276 int ConfigureSocket(DatagramClientSocket* socket, |
277 IPEndPoint addr, | 277 IPEndPoint addr, |
278 NetworkChangeNotifier::NetworkHandle network); | 278 NetworkChangeNotifier::NetworkHandle network); |
279 | 279 |
280 // Finds an alternative to |old_network| from the platform's list of connected | 280 // Finds an alternative to |old_network| from the platform's list of connected |
281 // networks. Returns NetworkChangeNotifier::kInvalidNetworkHandle if no | 281 // networks. Returns NetworkChangeNotifier::kInvalidNetworkHandle if no |
282 // alternative is found. | 282 // alternative is found. |
283 NetworkChangeNotifier::NetworkHandle FindAlternateNetwork( | 283 NetworkChangeNotifier::NetworkHandle FindAlternateNetwork( |
284 NetworkChangeNotifier::NetworkHandle old_network); | 284 NetworkChangeNotifier::NetworkHandle old_network); |
285 | 285 |
286 // Method that initiates migration of active sessions | 286 // Method that initiates migration of active sessions to |new_network|. |
287 // currently bound to |network| to an alternate network, if one | 287 // If |new_network| is a valid network, sessions that can migrate are |
288 // exists. Idle sessions bound to |network| are closed. If there is | 288 // migrated to |new_network|, and sessions not bound to |new_network| |
289 // no alternate network to migrate active sessions onto, active | 289 // are left unchanged. Sessions with non-migratable streams are closed |
290 // sessions are closed if |force_close| is true, and continue using | 290 // if |close_if_cannot_migrate| is true, and continue using their current |
291 // |network| otherwise. Sessions not bound to |network| are left unchanged. | 291 // network otherwise. |
292 void MaybeMigrateOrCloseSessions(NetworkChangeNotifier::NetworkHandle network, | 292 // |
293 bool force_close, | 293 // If |new_network| is NetworkChangeNotifier::kInvalidNetworkHandle, |
294 const BoundNetLog& bound_net_log); | 294 // there is no new network to migrate sessions onto, and all sessions are |
| 295 // closed. |
| 296 void MaybeMigrateOrCloseSessions( |
| 297 NetworkChangeNotifier::NetworkHandle new_network, |
| 298 bool close_if_cannot_migrate, |
| 299 const BoundNetLog& bound_net_log); |
295 | 300 |
296 // Method that initiates migration of |session| if |session| is | 301 // Method that initiates migration of |session| if |session| is |
297 // active and if there is an alternate network than the one to which | 302 // active and if there is an alternate network than the one to which |
298 // |session| is currently bound. If not null, |packet| is sent on | 303 // |session| is currently bound. If not null, |packet| is sent on |
299 // the new network, else a PING frame is sent. | 304 // the new network, else a PING frame is sent. |
300 void MaybeMigrateSingleSession(QuicChromiumClientSession* session, | 305 void MaybeMigrateSingleSession(QuicChromiumClientSession* session, |
301 MigrationCause migration_cause, | 306 MigrationCause migration_cause, |
302 scoped_refptr<StringIOBuffer> packet); | 307 scoped_refptr<StringIOBuffer> packet); |
303 | 308 |
304 // Migrates |session| over to using |network|. If |network| is | 309 // Migrates |session| over to using |network|. If |network| is |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 const scoped_refptr<SSLConfigService> ssl_config_service_; | 650 const scoped_refptr<SSLConfigService> ssl_config_service_; |
646 | 651 |
647 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 652 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
648 | 653 |
649 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 654 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
650 }; | 655 }; |
651 | 656 |
652 } // namespace net | 657 } // namespace net |
653 | 658 |
654 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 659 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
OLD | NEW |