Chromium Code Reviews| Index: net/quic/chromium/quic_chromium_client_session.h |
| diff --git a/net/quic/chromium/quic_chromium_client_session.h b/net/quic/chromium/quic_chromium_client_session.h |
| index 27405219a5d2a1d5ac833f6af111cfae6a852ed2..bf74b9cb98530c7461e4f7575e337885207a4a08 100644 |
| --- a/net/quic/chromium/quic_chromium_client_session.h |
| +++ b/net/quic/chromium/quic_chromium_client_session.h |
| @@ -32,6 +32,7 @@ |
| #include "net/quic/chromium/quic_chromium_packet_reader.h" |
| #include "net/quic/chromium/quic_chromium_packet_writer.h" |
| #include "net/quic/chromium/quic_connection_logger.h" |
| +#include "net/quic/core/quic_client_push_promise_index.h" |
| #include "net/quic/core/quic_client_session_base.h" |
| #include "net/quic/core/quic_crypto_client_stream.h" |
| #include "net/quic/core/quic_packets.h" |
| @@ -71,7 +72,9 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession |
| // Wrapper for interacting with the session in a restricted fashion which |
| // hides the details of the underlying session's lifetime. All methods of |
| // the Handle are safe to use even after the underlying session is destroyed. |
| - class NET_EXPORT_PRIVATE Handle : public MultiplexedSessionHandle { |
| + class NET_EXPORT_PRIVATE Handle |
| + : public MultiplexedSessionHandle, |
| + public QuicClientPushPromiseIndex::Delegate { |
| public: |
| explicit Handle(const base::WeakPtr<QuicChromiumClientSession>& session); |
| Handle(const Handle& other) = delete; |
| @@ -83,6 +86,13 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession |
| // Returns true if the handshake has been confirmed. |
| bool IsCryptoHandshakeConfirmed() const; |
| + // Starts a request to rendezvous with a promised a stream. If OK is |
| + // returned, then |push_stream_| will be updated with the promised |
| + // stream. If ERR_IO_PENDING is returned, then when the rendezvous is |
| + // eventuallly completed |callback| will be called. |
|
xunjieli
2017/06/21 20:55:28
nit: s/eventuallly/eventually
Ryan Hamilton
2017/06/21 22:24:51
Done.
|
| + int RendezvousWithPromised(const SpdyHeaderBlock& headers, |
| + const CompletionCallback& callback); |
| + |
| // Starts a request to create a stream. If OK is returned, then |
| // |stream_| will be updated with the newly created stream. If |
| // ERR_IO_PENDING is returned, then when the request is eventuallly |
| @@ -93,6 +103,9 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession |
| // Releases |stream_| to the caller. |
| std::unique_ptr<QuicChromiumClientStream::Handle> ReleaseStream(); |
| + // Releases |stream_| to the caller. |
|
xunjieli
2017/06/21 20:55:28
nit: s/stream_/push_stream_
Ryan Hamilton
2017/06/21 22:24:51
Done.
|
| + std::unique_ptr<QuicChromiumClientStream::Handle> ReleasePromisedStream(); |
| + |
| // Sends Rst for the stream, and makes sure that future calls to |
| // IsClosedStream(id) return true, which ensures that any subsequent |
| // frames related to this stream will be ignored (modulo flow |
| @@ -135,6 +148,12 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession |
| // Returns the session's net log. |
| const NetLogWithSource& net_log() const { return net_log_; } |
| + // QuicClientPushPromiseIndex::Delegate implementation |
| + bool CheckVary(const SpdyHeaderBlock& client_request, |
| + const SpdyHeaderBlock& promise_request, |
| + const SpdyHeaderBlock& promise_response) override; |
| + void OnRendezvousResult(QuicSpdyStream* stream) override; |
| + |
| private: |
| friend class QuicChromiumClientSession; |
| friend class QuicChromiumClientSession::StreamRequest; |
| @@ -177,6 +196,14 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession |
| QuicVersion quic_version_; |
| LoadTimingInfo::ConnectTiming connect_timing_; |
| QuicClientPushPromiseIndex* push_promise_index_; |
| + |
| + // |QuicClientPromisedInfo| owns this. It will be set when |Try()| |
| + // is asynchronous, i.e. it returned QUIC_PENDING, and remains valid |
| + // until |OnRendezvouResult()| fires or |push_handle_->Cancel()| is |
| + // invoked. |
| + QuicClientPushPromiseIndex::TryHandle* push_handle_; |
| + CompletionCallback push_callback_; |
| + std::unique_ptr<QuicChromiumClientStream::Handle> push_stream_; |
| }; |
| // A helper class used to manage a request to create a stream. |