| Index: net/quic/quic_http_stream.h
|
| diff --git a/net/quic/quic_http_stream.h b/net/quic/quic_http_stream.h
|
| index 751729cc97915ab1cc63d0c19c9126868cd2edd4..659474129c6dfa29720f5f7f34eef451e2e38215 100644
|
| --- a/net/quic/quic_http_stream.h
|
| +++ b/net/quic/quic_http_stream.h
|
| @@ -16,6 +16,7 @@
|
| #include "net/http/http_stream.h"
|
| #include "net/quic/quic_chromium_client_session.h"
|
| #include "net/quic/quic_chromium_client_stream.h"
|
| +#include "net/quic/quic_client_push_promise_index.h"
|
|
|
| namespace net {
|
|
|
| @@ -29,6 +30,7 @@ class QuicHttpStreamPeer;
|
| class NET_EXPORT_PRIVATE QuicHttpStream
|
| : public QuicChromiumClientSession::Observer,
|
| public QuicChromiumClientStream::Delegate,
|
| + public QuicClientPushPromiseIndex::Delegate,
|
| public HttpStream {
|
| public:
|
| explicit QuicHttpStream(
|
| @@ -79,11 +81,19 @@ class NET_EXPORT_PRIVATE QuicHttpStream
|
| void OnCryptoHandshakeConfirmed() override;
|
| void OnSessionClosed(int error) override;
|
|
|
| + // 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 test::QuicHttpStreamPeer;
|
|
|
| enum State {
|
| STATE_NONE,
|
| + STATE_REQUEST_STREAM,
|
| + STATE_SET_REQUEST_PRIORITY,
|
| STATE_SEND_HEADERS,
|
| STATE_SEND_HEADERS_COMPLETE,
|
| STATE_READ_REQUEST_BODY,
|
| @@ -98,6 +108,8 @@ class NET_EXPORT_PRIVATE QuicHttpStream
|
| void DoCallback(int rv);
|
|
|
| int DoLoop(int);
|
| + int DoStreamRequest();
|
| + int DoSetRequestPriority();
|
| int DoSendHeaders();
|
| int DoSendHeadersComplete(int rv);
|
| int DoReadRequestBody();
|
| @@ -110,8 +122,11 @@ class NET_EXPORT_PRIVATE QuicHttpStream
|
| int ProcessResponseHeaders(const SpdyHeaderBlock& headers);
|
|
|
| int ReadAvailableData(IOBuffer* buf, int buf_len);
|
| + void EnterStateSendHeaders();
|
| + int HandlePromise();
|
|
|
| void ResetStream();
|
| + bool CancelPromiseIfHasBody();
|
|
|
| State next_state_;
|
|
|
| @@ -181,6 +196,13 @@ class NET_EXPORT_PRIVATE QuicHttpStream
|
| // TODO(rtenneti): Temporary until crbug.com/585591 is solved.
|
| bool read_in_progress_ = false;
|
|
|
| + bool found_promise_;
|
| + // |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_;
|
| +
|
| base::WeakPtrFactory<QuicHttpStream> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(QuicHttpStream);
|
|
|