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

Issue 337093003: QuicServer: Use Chrome's header parsing rather than Balsa (Closed)

Created:
6 years, 6 months ago by dmz
Modified:
6 years, 5 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@quic_server_3
Project:
chromium
Visibility:
Public.

Description

QuicServer: Use Chrome's header parsing rather than Balsa It used to be that the QuicInMemoryCache mapped Balsa request headers to Balsa responses, initializing the cache by using Balsa to parse responses out of files in a specified directory. Then, QuicSpdyServerStream would use Balsa to parse the incoming request headers to pass of to the QuicInMemoryCache. Now, instead of BalsaHeaders, I've made the QuicInMemoryCache be keyed by GURL, since it was ignoring all the other parts of the request headers anyway. Thus, QuicSpdyServerStream now constructs GURLs by converting them from SPDY headers that are parsed out of the request, and converts the resulting HttpResponseHeaders from the QuicInMemoryCache into writable SPDY headers by using a new helper function SpdyHttpUtils::CreateSpdyHeadersFromHttpResponse. I removed the dependency on Balsa and tested the code by running the quic_server binary. R=wtc,rch@chromium.org BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=280901

Patch Set 1 #

Patch Set 2 : (mark StringPieceUtils as copied, not added) #

Total comments: 16

Patch Set 3 : Address review comments #

Total comments: 2

Patch Set 4 : Reorder parameters in spdy_http_utils; cleanup #

Patch Set 5 : Rebase onto previous CL and update GN build #

Patch Set 6 : Rebase onto newest changes and restore QuicSpdyServerStream::body_ #

Patch Set 7 : Lowercase SPDY header #

Total comments: 76

Patch Set 8 : Address review comments #

Patch Set 9 : Small cleanup #

Total comments: 29

Patch Set 10 : Address review comments #

Patch Set 11 : One missing review comment #

Total comments: 8

Patch Set 12 : Fix C++03 & 64-bit Windows build #

Patch Set 13 : Fix build on many platforms #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+214 lines, -221 lines) Patch
M net/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M net/quic/quic_http_stream.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/quic/quic_in_memory_cache.h View 1 2 3 4 5 6 7 8 4 chunks +15 lines, -20 lines 0 comments Download
M net/quic/quic_in_memory_cache.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +79 lines, -139 lines 2 comments Download
M net/quic/quic_spdy_server_stream.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -4 lines 0 comments Download
M net/quic/quic_spdy_server_stream.cc View 1 2 3 4 5 6 7 8 9 4 chunks +48 lines, -32 lines 0 comments Download
M net/quic/spdy_utils.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M net/quic/spdy_utils.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -3 lines 0 comments Download
M net/spdy/hpack_huffman_aggregator.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/spdy/spdy_http_stream.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/spdy/spdy_http_utils.h View 1 2 3 4 5 6 7 2 chunks +11 lines, -5 lines 0 comments Download
M net/spdy/spdy_http_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +42 lines, -10 lines 2 comments Download
M net/spdy/spdy_proxy_client_socket.cc View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
dmz
Please review https://codereview.chromium.org/340433002/ first -- this CL depends on it.
6 years, 6 months ago (2014-06-18 23:09:30 UTC) #1
Ryan Hamilton
https://codereview.chromium.org/337093003/diff/20001/net/quic/http_request_line.cc File net/quic/http_request_line.cc (right): https://codereview.chromium.org/337093003/diff/20001/net/quic/http_request_line.cc#newcode13 net/quic/http_request_line.cc:13: HttpRequestLine::HttpRequestLine(StringPiece method, I agree that HttpRequestInfo does not add ...
6 years, 6 months ago (2014-06-19 00:15:44 UTC) #2
dmz
PTAL https://codereview.chromium.org/337093003/diff/20001/net/quic/http_request_line.cc File net/quic/http_request_line.cc (right): https://codereview.chromium.org/337093003/diff/20001/net/quic/http_request_line.cc#newcode13 net/quic/http_request_line.cc:13: HttpRequestLine::HttpRequestLine(StringPiece method, On 2014/06/19 00:15:44, Ryan Hamilton wrote: ...
6 years, 6 months ago (2014-06-19 21:17:03 UTC) #3
dmz
On 2014/06/19 21:17:03, dmz wrote: > PTAL > > https://codereview.chromium.org/337093003/diff/20001/net/quic/http_request_line.cc > File net/quic/http_request_line.cc (right): > ...
6 years, 6 months ago (2014-06-19 21:22:16 UTC) #4
Ryan Hamilton
Looks good, modulo two small comments. https://codereview.chromium.org/337093003/diff/20001/net/spdy/spdy_http_utils.h File net/spdy/spdy_http_utils.h (right): https://codereview.chromium.org/337093003/diff/20001/net/spdy/spdy_http_utils.h#newcode36 net/spdy/spdy_http_utils.h:36: SpdyMajorVersion protocol_version); On ...
6 years, 6 months ago (2014-06-20 00:24:09 UTC) #5
dmziegler
Wan-Teh, do you want to take a look? It's not urgent since my previous CL ...
6 years, 6 months ago (2014-06-20 01:16:40 UTC) #6
wtc
Patch set 7 LGTM. https://codereview.chromium.org/337093003/diff/120001/net/quic/quic_in_memory_cache.cc File net/quic/quic_in_memory_cache.cc (right): https://codereview.chromium.org/337093003/diff/120001/net/quic/quic_in_memory_cache.cc#newcode38 net/quic/quic_in_memory_cache.cc:38: ResponseMap::const_iterator it = responses_.find(url.spec()); The ...
6 years, 6 months ago (2014-06-25 22:22:25 UTC) #7
wtc
Additional review comments on patch set 7: https://codereview.chromium.org/337093003/diff/120001/net/quic/quic_in_memory_cache.cc File net/quic/quic_in_memory_cache.cc (left): https://codereview.chromium.org/337093003/diff/120001/net/quic/quic_in_memory_cache.cc#oldcode206 net/quic/quic_in_memory_cache.cc:206: path.remove_suffix(1); Should ...
6 years, 6 months ago (2014-06-25 23:17:32 UTC) #8
dmziegler
PTAL https://codereview.chromium.org/337093003/diff/120001/net/quic/quic_in_memory_cache.cc File net/quic/quic_in_memory_cache.cc (left): https://codereview.chromium.org/337093003/diff/120001/net/quic/quic_in_memory_cache.cc#oldcode206 net/quic/quic_in_memory_cache.cc:206: path.remove_suffix(1); On 2014/06/25 23:17:32, wtc wrote: > > ...
6 years, 6 months ago (2014-06-26 01:23:30 UTC) #9
wtc
Patch set 9 LGTM. I didn't review quic_spdy_server_stream.cc completely. I'll do that in the next ...
6 years, 6 months ago (2014-06-26 21:23:17 UTC) #10
dmziegler
PTAL https://codereview.chromium.org/337093003/diff/160001/net/net.gyp File net/net.gyp (right): https://codereview.chromium.org/337093003/diff/160001/net/net.gyp#newcode1119 net/net.gyp:1119: # dependency on balsa is eliminated and the ...
6 years, 6 months ago (2014-06-27 01:11:38 UTC) #11
wtc
Patch set 11 LGTM. I still need to review quic_spdy_server_stream.*, but I think it is ...
6 years, 5 months ago (2014-06-27 21:00:38 UTC) #12
wtc
Patch set 11 LGTM. I reviewed quic_spdy_server_stream.*. You may address these minor issues in a ...
6 years, 5 months ago (2014-06-27 21:57:13 UTC) #13
wtc
https://codereview.chromium.org/337093003/diff/160001/net/quic/quic_in_memory_cache.cc File net/quic/quic_in_memory_cache.cc (right): https://codereview.chromium.org/337093003/diff/160001/net/quic/quic_in_memory_cache.cc#newcode85 net/quic/quic_in_memory_cache.cc:85: AddResponse(url, NULL, string()); On 2014/06/27 01:11:37, dmziegler wrote: > ...
6 years, 5 months ago (2014-06-27 22:08:04 UTC) #14
dmziegler
The CQ bit was checked by dmziegler@google.com
6 years, 5 months ago (2014-07-01 18:11:15 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmziegler@chromium.org/337093003/200001
6 years, 5 months ago (2014-07-01 18:13:59 UTC) #16
dmziegler
I'm going to try to commit now (although it looks like I need to fix ...
6 years, 5 months ago (2014-07-01 18:23:39 UTC) #17
dmziegler
The CQ bit was checked by dmziegler@google.com
6 years, 5 months ago (2014-07-01 18:51:50 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmziegler@chromium.org/337093003/220001
6 years, 5 months ago (2014-07-01 18:52:49 UTC) #19
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_clang_dbg on tryserver.chromium ...
6 years, 5 months ago (2014-07-01 19:56:30 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-01 20:00:29 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/ios_dbg_simulator/builds/166561)
6 years, 5 months ago (2014-07-01 20:00:30 UTC) #22
dmziegler
The CQ bit was checked by dmziegler@google.com
6 years, 5 months ago (2014-07-01 20:01:18 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmziegler@chromium.org/337093003/240001
6 years, 5 months ago (2014-07-01 20:02:47 UTC) #24
commit-bot: I haz the power
Change committed as 280901
6 years, 5 months ago (2014-07-01 22:21:29 UTC) #25
wtc
Patch set 13 LGTM. https://codereview.chromium.org/337093003/diff/240001/net/quic/quic_in_memory_cache.cc File net/quic/quic_in_memory_cache.cc (right): https://codereview.chromium.org/337093003/diff/240001/net/quic/quic_in_memory_cache.cc#newcode131 net/quic/quic_in_memory_cache.cc:131: file_len); I think it would ...
6 years, 5 months ago (2014-07-08 17:54:42 UTC) #26
dmz
6 years, 5 months ago (2014-07-08 18:07:36 UTC) #27
Message was sent while issue was closed.
https://codereview.chromium.org/337093003/diff/240001/net/quic/quic_in_memory...
File net/quic/quic_in_memory_cache.cc (right):

https://codereview.chromium.org/337093003/diff/240001/net/quic/quic_in_memory...
net/quic/quic_in_memory_cache.cc:131: file_len);
On 2014/07/08 17:54:41, wtc wrote:
> 
> I think it would be better to change these HttpUtil::* functions to declare
> their |buf_len| parameter as size_t instead of int. This could be a lot of
work
> though.

You're right. If you want, I can make a CL for this, although the functions are
used in dozens of places, so it would be quite a bit of work.

https://codereview.chromium.org/337093003/diff/240001/net/spdy/spdy_http_util...
File net/spdy/spdy_http_utils.cc (right):

https://codereview.chromium.org/337093003/diff/240001/net/spdy/spdy_http_util...
net/spdy/spdy_http_utils.cc:153: (*headers)[status_key] =
std::string(after_version + 1, status_line.end());
On 2014/07/08 17:54:42, wtc wrote:
> 
> Can you explain this change? Is it because cbegin and cend are not available
on
> some platforms? (They seem to be C++11 new features.)

Yes, that's exactly right. I just made |status_line| const instead, which has
the same effect.

Powered by Google App Engine
This is Rietveld 408576698