Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(990)

Side by Side Diff: net/quic/quic_stream_factory.h

Issue 1614573002: Minor refactor of MaybeMigrateOrCloseSessions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/quic_stream_factory.cc » ('j') | net/quic/quic_stream_factory.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 |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 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 migrates |session| over to using |new_network|.
245 void MigrateSessionToNetwork(
246 QuicChromiumClientSession* session,
247 NetworkChangeNotifier::NetworkHandle new_network);
248
238 // NetworkChangeNotifier::IPAddressObserver methods: 249 // NetworkChangeNotifier::IPAddressObserver methods:
239 250
240 // Until the servers support roaming, close all connections when the local 251 // Until the servers support roaming, close all connections when the local
241 // IP address changes. 252 // IP address changes.
242 void OnIPAddressChanged() override; 253 void OnIPAddressChanged() override;
243 254
244 // NetworkChangeNotifier::NetworkObserver methods: 255 // NetworkChangeNotifier::NetworkObserver methods:
245 void OnNetworkConnected( 256 void OnNetworkConnected(
246 NetworkChangeNotifier::NetworkHandle network) override; 257 NetworkChangeNotifier::NetworkHandle network) override;
247 void OnNetworkDisconnected( 258 void OnNetworkDisconnected(
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 base::TaskRunner* task_runner_; 515 base::TaskRunner* task_runner_;
505 516
506 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; 517 base::WeakPtrFactory<QuicStreamFactory> weak_factory_;
507 518
508 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); 519 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
509 }; 520 };
510 521
511 } // namespace net 522 } // namespace net
512 523
513 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ 524 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_stream_factory.cc » ('j') | net/quic/quic_stream_factory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698