| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 void ClearCachedStatesInCryptoConfig(); | 219 void ClearCachedStatesInCryptoConfig(); |
| 220 | 220 |
| 221 // Helper method that configures a DatagramClientSocket. Socket is | 221 // Helper method that configures a DatagramClientSocket. Socket is |
| 222 // bound to the default network if the |network| param is | 222 // bound to the default network if the |network| param is |
| 223 // NetworkChangeNotifier::kInvalidNetworkHandle. | 223 // NetworkChangeNotifier::kInvalidNetworkHandle. |
| 224 // Returns net_error code. | 224 // Returns net_error code. |
| 225 int ConfigureSocket(DatagramClientSocket* socket, | 225 int ConfigureSocket(DatagramClientSocket* socket, |
| 226 IPEndPoint addr, | 226 IPEndPoint addr, |
| 227 NetworkChangeNotifier::NetworkHandle network); | 227 NetworkChangeNotifier::NetworkHandle network); |
| 228 | 228 |
| 229 // Helper method that initiates migration of active sessions | 229 // Finds an alternative to |old_network| from the platform's list of connected |
| 230 // networks. Returns NetworkChangeNotifier::kInvalidNetworkHandle if no |
| 231 // alternative is found. |
| 232 NetworkChangeNotifier::NetworkHandle FindAlternateNetwork( |
| 233 NetworkChangeNotifier::NetworkHandle old_network); |
| 234 |
| 235 // Method that initiates migration of active sessions |
| 230 // currently bound to |network| to an alternate network, if one | 236 // currently bound to |network| to an alternate network, if one |
| 231 // exists. Idle sessions bound to |network| are closed. If there is | 237 // exists. Idle sessions bound to |network| are closed. If there is |
| 232 // no alternate network to migrate active sessions onto, active | 238 // no alternate network to migrate active sessions onto, active |
| 233 // sessions are closed if |force_close| is true, and continue using | 239 // sessions are closed if |force_close| is true, and continue using |
| 234 // |network| otherwise. Sessions not bound to |network| are left unchanged. | 240 // |network| otherwise. Sessions not bound to |network| are left unchanged. |
| 235 void MaybeMigrateOrCloseSessions(NetworkChangeNotifier::NetworkHandle network, | 241 void MaybeMigrateOrCloseSessions(NetworkChangeNotifier::NetworkHandle network, |
| 236 bool force_close); | 242 bool force_close); |
| 237 | 243 |
| 244 // Method that initiates early migration of |session| if |session| is |
| 245 // active and if there is an alternate network than the one to which |
| 246 // |session| is currently bound. |
| 247 void MaybeMigrateSessionEarly(QuicChromiumClientSession* session); |
| 248 |
| 249 // Method that migrates |session| over to using |new_network|. |
| 250 void MigrateSessionToNetwork( |
| 251 QuicChromiumClientSession* session, |
| 252 NetworkChangeNotifier::NetworkHandle new_network); |
| 253 |
| 238 // NetworkChangeNotifier::IPAddressObserver methods: | 254 // NetworkChangeNotifier::IPAddressObserver methods: |
| 239 | 255 |
| 240 // Until the servers support roaming, close all connections when the local | 256 // Until the servers support roaming, close all connections when the local |
| 241 // IP address changes. | 257 // IP address changes. |
| 242 void OnIPAddressChanged() override; | 258 void OnIPAddressChanged() override; |
| 243 | 259 |
| 244 // NetworkChangeNotifier::NetworkObserver methods: | 260 // NetworkChangeNotifier::NetworkObserver methods: |
| 245 void OnNetworkConnected( | 261 void OnNetworkConnected( |
| 246 NetworkChangeNotifier::NetworkHandle network) override; | 262 NetworkChangeNotifier::NetworkHandle network) override; |
| 247 void OnNetworkDisconnected( | 263 void OnNetworkDisconnected( |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 base::TaskRunner* task_runner_; | 520 base::TaskRunner* task_runner_; |
| 505 | 521 |
| 506 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 522 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
| 507 | 523 |
| 508 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 524 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
| 509 }; | 525 }; |
| 510 | 526 |
| 511 } // namespace net | 527 } // namespace net |
| 512 | 528 |
| 513 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 529 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
| OLD | NEW |