forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify SpdyStream::url_ and SpdyStream::url_from_header_block_.
SpdyStream::url_ used to be set to the raw URL; this CL changes that to SimplifyUrlForRequest(url) (to remove username, password, and ref). The way this member is set is that SpdyStreamRequest::StartRequest() is called with the URL, then SpdySession::TryCreateStream() is called, which calls SpdySession::CreateStream(), which passes this URL to the SpdyStream constructor, which initializes the const SpdyStream::url_ member. SpdyStream::url_from_header_block_ used to be set to the URL passed in to CreateSpdyHeadersFromHttpRequest() or CreateSpdyHeadersFromHttpRequestForWebSocket(), then the URL extracted using GetUrlFromHeaderBlock() (these two steps only keep host, port, scheme, and path, and might do something else with CONNECT method requests); this CL removes this member. This member was set in SpdyStream::SendRequestHeaders() and SpdyStream::OnPushPromiseHeadersReceived(). Other than tests and fuzzers, SpdyStreamRequest::StartRequest() and SpdyStream::SendRequestHeaders() are called in four places. In SpdyHttpStream and BidirectionalStreamSpdyImpl, SpdyStreamRequest::StartRequest() is called with request_info_.url, and later, CreateSpdyHeadersFromHttpRequest() is called with the same URL, and the resulting SpdyHeaderBlock is passed in to SpdyStream::SendRequestHeaders(). WebSocketHttp2HandshakeStream has a similar pattern except it calls CreateSpdyHeadersFromHttpRequestForWebSocket() instead of CreateSpdyHeadersFromHttpRequest(). The final path is HttpProxyClientSocketWrapper calling SpdyStreamRequest::StartRequest(), then it creates a SpdyProxyClientSocket instance with endpoint_, which passes the exact same URL to CreateSpdyHeadersFromHttpRequest() and calls SpdyStream::SendRequestHeaders() with the resulting SpdyHeaderBlock. So this is the exact same dance but performed by two classes instead of one. For these four paths, this CL introduces some change: SpdyStream::url_ will have username, password, and ref (anchor) stripped off, but keep scheme, host, port, path, query. SpdyStream::url_from_header_block_ used to be scheme, host, port, path only, now url_ is used instead, which has query in addition. SpdyStream::url_from_header_block_ used to be set in SpdyStream::OnPushPromiseHeadersReceived() as well. There is absolutely no change on this code path: this is called only in SpdySession::TryCreatePushedStream(). Now the same method calls SpdyUtils::GetPromisedUrlFromHeaders() on the headers and passes the resulting URL to the SpdyStream constructor. Later it calls OnPushPromiseHeadersReceived() on this stream and passes in the exact same headers, and OnPushPromiseHeadersReceived() used to call GetPromisedUrlFromHeaders() on these headers and set url_from_header_block_. The result of this was identical values in SpdyStream::url_ and SpdyStream::url_from_header_block_. It is worth noting that the URL used as a key for pushed streams does not change. This CL results in only one remaining call site for GetUrlFromHeaderBlock(), in QuicChromiumClientSession. This will be addressed in a follow-up CL. Change-Id: I82369d94f573ff68b35e472aa06258aab8623a8e Reviewed-on: https://chromium-review.googlesource.com/945188 Commit-Queue: Bence Béky <bnc@chromium.org> Commit-Queue: Ryan Hamilton <rch@chromium.org> Reviewed-by: Ryan Hamilton <rch@chromium.org> Cr-Commit-Position: refs/heads/master@{#540445}
- Loading branch information
Bence Béky
authored and
Commit Bot
committed
Mar 2, 2018
1 parent
b3d867f
commit 39d7429
Showing
7 changed files
with
47 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.