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

Issue 1357953002: Replace the existing SpdyHeaderBlock typedef with a class. (Closed)

Created:
5 years, 3 months ago by Bence
Modified:
5 years, 2 months ago
Reviewers:
dgozman, Ryan Hamilton
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace the existing SpdyHeaderBlock typedef with a class. SpdyHeaderBlock is currently a map<string, string>. This change replaces the typedef with a class that * behaves like a linked_hash_map<StringPiece, StringPiece>, that is, preserves insertion order, * and also manages memory containing the header names and values, resulting in much fewer allocations. String construction and destruction showed up in the CPU profile under heavy loads, and this class addresses this performance issue. This CL includes server change 100829267 by rjshade (for net/spdy/hpack/hpack_{en,de}coder_test.cc), which changed SpdyHeaderBlock to a linked_hash_map, thus preserving order. That change was not merged separately because Chromium's linked_hash_map implementation does not support copy. This CL also includes server changed 103293205 by birenroy, which introduces SpdyHeaderBlock class managing large chunks of memory. This CL also updates a large number of unittests and a small amount of production code to account for header order being preserved. BUG=443287 Committed: https://crrev.com/7ecc11208382bf462982af29d1680ee5eba2ded3 Cr-Commit-Position: refs/heads/master@{#351062}

Patch Set 1 #

Patch Set 2 : Remove unique_ptr. Use NET_EXPORT right. #

Patch Set 3 : Rebase. #

Patch Set 4 : Use the right namespace qualifier for scoped_ptr<>. #

Patch Set 5 : Add .as_string() in devtools. #

Patch Set 6 : Remove yet another occurrence of unique_ptr<>. #

Patch Set 7 : Update SpdySMServerTest and quic_simple_client_bin.cc. #

Patch Set 8 : Do not use scoped_ptr<> in vector<> because move semantics are not supported yet. #

Patch Set 9 : Add ~Storage() to free memory. #

Patch Set 10 : Avoid C++11 initializer list. #

Patch Set 11 : Change test values to StringPiece. #

Patch Set 12 : Rebase. #

Patch Set 13 : Adopt QuicSpdyStreamServerTest to the new interface. #

Patch Set 14 : Nit. #

Patch Set 15 : Add some includes. #

Total comments: 10

Patch Set 16 : Do not use using directive at file level in header file. #

Patch Set 17 : Include spdy_test_utils.h in tests for StringPieceProxy comparison operator. #

Total comments: 2

Patch Set 18 : Rebase. #

Patch Set 19 : s/typedef/using/g #

Patch Set 20 : Add NET_EXPORT to fix compile error on win_chromium_compile_dbg_ng. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+641 lines, -290 lines) Patch
M content/browser/devtools/devtools_netlog_observer.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -4 lines 0 comments Download
M net/net.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -1 line 0 comments Download
M net/quic/spdy_utils.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M net/quic/test_tools/quic_test_packet_maker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +5 lines, -5 lines 0 comments Download
M net/spdy/hpack/hpack_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -10 lines 0 comments Download
M net/spdy/hpack/hpack_decoder_test.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +15 lines, -14 lines 0 comments Download
M net/spdy/hpack/hpack_encoder_test.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +12 lines, -13 lines 0 comments Download
M net/spdy/spdy_framer.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/spdy/spdy_framer_test.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -3 lines 0 comments Download
M net/spdy/spdy_header_block.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +106 lines, -3 lines 0 comments Download
M net/spdy/spdy_header_block.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +203 lines, -3 lines 0 comments Download
A net/spdy/spdy_header_block_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +90 lines, -0 lines 0 comments Download
D net/spdy/spdy_header_block_unittest.cc View 1 chunk +0 lines, -31 lines 0 comments Download
M net/spdy/spdy_http_utils.cc View 9 chunks +24 lines, -21 lines 0 comments Download
M net/spdy/spdy_http_utils_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +3 lines, -2 lines 0 comments Download
M net/spdy/spdy_network_transaction_unittest.cc View 7 chunks +60 lines, -92 lines 0 comments Download
M net/spdy/spdy_protocol.h View 1 2 3 chunks +2 lines, -5 lines 0 comments Download
M net/spdy/spdy_proxy_client_socket_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/spdy/spdy_session.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M net/spdy/spdy_session_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/spdy/spdy_stream.cc View 1 chunk +9 lines, -7 lines 0 comments Download
M net/spdy/spdy_stream_test_util.cc View 1 chunk +2 lines, -1 line 0 comments Download
M net/spdy/spdy_test_util_common.cc View 10 chunks +15 lines, -16 lines 0 comments Download
M net/spdy/spdy_test_utils.h View 2 chunks +6 lines, -0 lines 0 comments Download
M net/tools/flip_server/spdy_interface.cc View 4 chunks +12 lines, -13 lines 0 comments Download
M net/tools/flip_server/spdy_interface_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M net/tools/quic/quic_client_bin.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -1 line 0 comments Download
M net/tools/quic/quic_simple_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M net/tools/quic/quic_simple_client_bin.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -1 line 0 comments Download
M net/tools/quic/quic_spdy_client_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -2 lines 0 comments Download
M net/tools/quic/quic_spdy_server_stream_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +7 lines, -9 lines 0 comments Download
M net/tools/quic/spdy_balsa_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 10 chunks +35 lines, -24 lines 0 comments Download

Messages

Total messages: 28 (13 generated)
Bence
Ryan: PTAL. Thanks.
5 years, 3 months ago (2015-09-24 13:14:01 UTC) #4
Ryan Hamilton
Couple small questions. https://codereview.chromium.org/1357953002/diff/320001/net/spdy/spdy_framer_test.cc File net/spdy/spdy_framer_test.cc (right): https://codereview.chromium.org/1357953002/diff/320001/net/spdy/spdy_framer_test.cc#newcode1066 net/spdy/spdy_framer_test.cc:1066: EXPECT_EQ(99u, compressed_size4); Why did this change? ...
5 years, 3 months ago (2015-09-24 17:54:06 UTC) #5
Bence
PTAL, thanks. https://codereview.chromium.org/1357953002/diff/320001/net/spdy/spdy_framer_test.cc File net/spdy/spdy_framer_test.cc (right): https://codereview.chromium.org/1357953002/diff/320001/net/spdy/spdy_framer_test.cc#newcode1066 net/spdy/spdy_framer_test.cc:1066: EXPECT_EQ(99u, compressed_size4); On 2015/09/24 17:54:06, Ryan Hamilton ...
5 years, 3 months ago (2015-09-24 21:14:52 UTC) #6
Ryan Hamilton
lgtm https://codereview.chromium.org/1357953002/diff/320001/net/spdy/spdy_test_utils.h File net/spdy/spdy_test_utils.h (right): https://codereview.chromium.org/1357953002/diff/320001/net/spdy/spdy_test_utils.h#newcode23 net/spdy/spdy_test_utils.h:23: } On 2015/09/24 21:14:51, Bence wrote: > On ...
5 years, 3 months ago (2015-09-24 22:25:55 UTC) #7
Bence
dgozman: PTAL at content/browser/devtools/devtools_netlog_observer.cc. Thank you. Ryan: Thanks.
5 years, 2 months ago (2015-09-25 11:32:45 UTC) #11
dgozman
devtools lgtm https://codereview.chromium.org/1357953002/diff/360001/net/spdy/spdy_header_block.h File net/spdy/spdy_header_block.h (right): https://codereview.chromium.org/1357953002/diff/360001/net/spdy/spdy_header_block.h#newcode36 net/spdy/spdy_header_block.h:36: typedef linked_hash_map<base::StringPiece, base::StringPiece> MapType; Style guide suggests ...
5 years, 2 months ago (2015-09-25 18:10:42 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1357953002/360001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1357953002/360001
5 years, 2 months ago (2015-09-25 18:36:36 UTC) #14
Bence
Thanks. https://codereview.chromium.org/1357953002/diff/360001/net/spdy/spdy_header_block.h File net/spdy/spdy_header_block.h (right): https://codereview.chromium.org/1357953002/diff/360001/net/spdy/spdy_header_block.h#newcode36 net/spdy/spdy_header_block.h:36: typedef linked_hash_map<base::StringPiece, base::StringPiece> MapType; On 2015/09/25 18:10:42, dgozman ...
5 years, 2 months ago (2015-09-25 18:37:46 UTC) #15
dgozman
On 2015/09/25 18:37:46, Bence wrote: > Thanks. > > https://codereview.chromium.org/1357953002/diff/360001/net/spdy/spdy_header_block.h > File net/spdy/spdy_header_block.h (right): > ...
5 years, 2 months ago (2015-09-25 18:42:47 UTC) #16
Bence
On 2015/09/25 18:42:47, dgozman wrote: > On 2015/09/25 18:37:46, Bence wrote: > > Thanks. > ...
5 years, 2 months ago (2015-09-25 18:47:46 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1357953002/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1357953002/400001
5 years, 2 months ago (2015-09-25 21:50:19 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/87907)
5 years, 2 months ago (2015-09-25 23:03:19 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1357953002/420001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1357953002/420001
5 years, 2 months ago (2015-09-28 12:15:23 UTC) #26
commit-bot: I haz the power
Committed patchset #20 (id:420001)
5 years, 2 months ago (2015-09-28 13:23:00 UTC) #27
commit-bot: I haz the power
5 years, 2 months ago (2015-09-28 13:23:44 UTC) #28
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/7ecc11208382bf462982af29d1680ee5eba2ded3
Cr-Commit-Position: refs/heads/master@{#351062}

Powered by Google App Engine
This is Rietveld 408576698