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

Side by Side Diff: net/quic/chromium/quic_chromium_client_session.h

Issue 2329853002: Introduces ability for session to wait on a migration trigger for a new (Closed)
Patch Set: comments addressed Created 4 years, 3 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
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 // A client specific QuicSession subclass. This class owns the underlying 5 // A client specific QuicSession subclass. This class owns the underlying
6 // QuicConnection and QuicConnectionHelper objects. The connection stores 6 // QuicConnection and QuicConnectionHelper objects. The connection stores
7 // a non-owning pointer to the helper so this session needs to ensure that 7 // a non-owning pointer to the helper so this session needs to ensure that
8 // the helper outlives the connection. 8 // the helper outlives the connection.
9 9
10 #ifndef NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ 10 #ifndef NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // to be the new default writer. Returns true if socket was 266 // to be the new default writer. Returns true if socket was
267 // successfully added to the session and the session was 267 // successfully added to the session and the session was
268 // successfully migrated to using the new socket. Returns true on 268 // successfully migrated to using the new socket. Returns true on
269 // successful migration, or false if number of migrations exceeds 269 // successful migration, or false if number of migrations exceeds
270 // kMaxReadersPerQuicSession. Takes ownership of |socket|, |reader|, 270 // kMaxReadersPerQuicSession. Takes ownership of |socket|, |reader|,
271 // and |writer|. 271 // and |writer|.
272 bool MigrateToSocket(std::unique_ptr<DatagramClientSocket> socket, 272 bool MigrateToSocket(std::unique_ptr<DatagramClientSocket> socket,
273 std::unique_ptr<QuicChromiumPacketReader> reader, 273 std::unique_ptr<QuicChromiumPacketReader> reader,
274 std::unique_ptr<QuicChromiumPacketWriter> writer); 274 std::unique_ptr<QuicChromiumPacketWriter> writer);
275 275
276 // Called when NetworkChangeNotifier notifies observers of a newly
277 // connected network. Migrates this session to the newly connected
278 // network if the session has a pending migration.
279 void OnNetworkConnected(NetworkChangeNotifier::NetworkHandle network,
280 const BoundNetLog& bound_net_log);
281
282 // Schedules a migration alarm to wait for a new network.
283 void OnNoNewNetwork();
284
285 // Called when migration alarm fires. If migration has not occurred
286 // since alarm was set, closes session with error.
287 void OnMigrationTimeout(size_t num_sockets);
288
276 // Populates network error details for this session. 289 // Populates network error details for this session.
277 void PopulateNetErrorDetails(NetErrorDetails* details); 290 void PopulateNetErrorDetails(NetErrorDetails* details);
278 291
279 // Returns current default socket. This is the socket over which all 292 // Returns current default socket. This is the socket over which all
280 // QUIC packets are sent. This default socket can change, so do not store the 293 // QUIC packets are sent. This default socket can change, so do not store the
281 // returned socket. 294 // returned socket.
282 const DatagramClientSocket* GetDefaultSocket() const; 295 const DatagramClientSocket* GetDefaultSocket() const;
283 296
284 bool IsAuthorized(const std::string& hostname) override; 297 bool IsAuthorized(const std::string& hostname) override;
285 298
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 // the current sockets_.size() == the passed in value. 393 // the current sockets_.size() == the passed in value.
381 bool migration_pending_; // True while migration is underway. 394 bool migration_pending_; // True while migration is underway.
382 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; 395 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_;
383 396
384 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); 397 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession);
385 }; 398 };
386 399
387 } // namespace net 400 } // namespace net
388 401
389 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ 402 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_
OLDNEW
« no previous file with comments | « net/quic/chromium/mock_network_change_notifier.cc ('k') | net/quic/chromium/quic_chromium_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698