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

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

Issue 2458793002: Server push cancellation: add PushPromiseHelper which reflects information on the push promise. (Closed)
Patch Set: sync and fix tests Created 4 years, 1 month 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 | « net/net.gypi ('k') | net/quic/chromium/quic_chromium_client_session.cc » ('j') | no next file with comments »
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 // 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 20 matching lines...) Expand all
31 #include "net/quic/chromium/quic_chromium_client_stream.h" 31 #include "net/quic/chromium/quic_chromium_client_stream.h"
32 #include "net/quic/chromium/quic_chromium_packet_reader.h" 32 #include "net/quic/chromium/quic_chromium_packet_reader.h"
33 #include "net/quic/chromium/quic_chromium_packet_writer.h" 33 #include "net/quic/chromium/quic_chromium_packet_writer.h"
34 #include "net/quic/chromium/quic_connection_logger.h" 34 #include "net/quic/chromium/quic_connection_logger.h"
35 #include "net/quic/core/quic_client_session_base.h" 35 #include "net/quic/core/quic_client_session_base.h"
36 #include "net/quic/core/quic_crypto_client_stream.h" 36 #include "net/quic/core/quic_crypto_client_stream.h"
37 #include "net/quic/core/quic_protocol.h" 37 #include "net/quic/core/quic_protocol.h"
38 #include "net/quic/core/quic_server_id.h" 38 #include "net/quic/core/quic_server_id.h"
39 #include "net/quic/core/quic_time.h" 39 #include "net/quic/core/quic_time.h"
40 #include "net/socket/socket_performance_watcher.h" 40 #include "net/socket/socket_performance_watcher.h"
41 #include "net/spdy/server_push_delegate.h"
41 42
42 namespace net { 43 namespace net {
43 44
44 class CertVerifyResult; 45 class CertVerifyResult;
45 class DatagramClientSocket; 46 class DatagramClientSocket;
46 class NetLog; 47 class NetLog;
47 class QuicCryptoClientStreamFactory; 48 class QuicCryptoClientStreamFactory;
48 class QuicServerInfo; 49 class QuicServerInfo;
49 class QuicStreamFactory; 50 class QuicStreamFactory;
50 class SSLInfo; 51 class SSLInfo;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // Returns current default socket. This is the socket over which all 292 // Returns current default socket. This is the socket over which all
292 // 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
293 // returned socket. 294 // returned socket.
294 const DatagramClientSocket* GetDefaultSocket() const; 295 const DatagramClientSocket* GetDefaultSocket() const;
295 296
296 bool IsAuthorized(const std::string& hostname) override; 297 bool IsAuthorized(const std::string& hostname) override;
297 298
298 // Returns true if session has one ore more streams marked as non-migratable. 299 // Returns true if session has one ore more streams marked as non-migratable.
299 bool HasNonMigratableStreams() const; 300 bool HasNonMigratableStreams() const;
300 301
301 void HandlePromised(QuicStreamId associated_id, 302 bool HandlePromised(QuicStreamId associated_id,
302 QuicStreamId promised_id, 303 QuicStreamId promised_id,
303 const SpdyHeaderBlock& headers) override; 304 const SpdyHeaderBlock& headers) override;
304 305
305 void DeletePromised(QuicClientPromisedInfo* promised) override; 306 void DeletePromised(QuicClientPromisedInfo* promised) override;
306 307
307 void OnPushStreamTimedOut(QuicStreamId stream_id) override; 308 void OnPushStreamTimedOut(QuicStreamId stream_id) override;
308 309
310 void set_push_delegte(ServerPushDelegate* push_delegate) {
311 push_delegate_ = push_delegate;
312 }
313
309 // Cancels the push if the push stream for |url| has not been claimed and is 314 // Cancels the push if the push stream for |url| has not been claimed and is
310 // still active. Otherwise, no-op. 315 // still active. Otherwise, no-op.
311 void CancelPush(const GURL& url); 316 void CancelPush(const GURL& url);
312 317
313 const LoadTimingInfo::ConnectTiming& GetConnectTiming(); 318 const LoadTimingInfo::ConnectTiming& GetConnectTiming();
314 319
315 QuicVersion GetQuicVersion() const; 320 QuicVersion GetQuicVersion() const;
316 321
317 protected: 322 protected:
318 // QuicSession methods: 323 // QuicSession methods:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 NetLogWithSource net_log_; 386 NetLogWithSource net_log_;
382 std::vector<std::unique_ptr<QuicChromiumPacketReader>> packet_readers_; 387 std::vector<std::unique_ptr<QuicChromiumPacketReader>> packet_readers_;
383 LoadTimingInfo::ConnectTiming connect_timing_; 388 LoadTimingInfo::ConnectTiming connect_timing_;
384 std::unique_ptr<QuicConnectionLogger> logger_; 389 std::unique_ptr<QuicConnectionLogger> logger_;
385 // True when the session is going away, and streams may no longer be created 390 // True when the session is going away, and streams may no longer be created
386 // on this session. Existing stream will continue to be processed. 391 // on this session. Existing stream will continue to be processed.
387 bool going_away_; 392 bool going_away_;
388 // True when the session receives a go away from server due to port migration. 393 // True when the session receives a go away from server due to port migration.
389 bool port_migration_detected_; 394 bool port_migration_detected_;
390 TokenBindingSignatureMap token_binding_signatures_; 395 TokenBindingSignatureMap token_binding_signatures_;
396 // Not owned. |push_delegate_| outlives the session and handles server pushes
397 // received by session.
398 ServerPushDelegate* push_delegate_;
391 // UMA histogram counters for streams pushed to this session. 399 // UMA histogram counters for streams pushed to this session.
392 int streams_pushed_count_; 400 int streams_pushed_count_;
393 int streams_pushed_and_claimed_count_; 401 int streams_pushed_and_claimed_count_;
394 uint64_t bytes_pushed_count_; 402 uint64_t bytes_pushed_count_;
395 uint64_t bytes_pushed_and_unclaimed_count_; 403 uint64_t bytes_pushed_and_unclaimed_count_;
396 // Stores packet that witnesses socket write error. This packet is 404 // Stores packet that witnesses socket write error. This packet is
397 // written to a new socket after migration completes. 405 // written to a new socket after migration completes.
398 scoped_refptr<StringIOBuffer> packet_; 406 scoped_refptr<StringIOBuffer> packet_;
399 // TODO(jri): Replace use of migration_pending_ sockets_.size(). 407 // TODO(jri): Replace use of migration_pending_ sockets_.size().
400 // When a task is posted for MigrateSessionOnError, pass in 408 // When a task is posted for MigrateSessionOnError, pass in
401 // sockets_.size(). Then in MigrateSessionOnError, check to see if 409 // sockets_.size(). Then in MigrateSessionOnError, check to see if
402 // the current sockets_.size() == the passed in value. 410 // the current sockets_.size() == the passed in value.
403 bool migration_pending_; // True while migration is underway. 411 bool migration_pending_; // True while migration is underway.
404 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; 412 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_;
405 413
406 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); 414 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession);
407 }; 415 };
408 416
409 } // namespace net 417 } // namespace net
410 418
411 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ 419 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_
OLDNEW
« no previous file with comments | « net/net.gypi ('k') | net/quic/chromium/quic_chromium_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698