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

Issue 2096713002: Reduce SpdyHeaderBlock copies with move semantics. (Closed)

Created:
4 years, 6 months ago by Bence
Modified:
4 years, 6 months ago
Reviewers:
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

Reduce SpdyHeaderBlock copies with move semantics. In order to reduce SpdyHeaderBlock copies and to move SpdyHeaderBlock instances from heap to stack, * take SpdyHeaderBlock by value instead of const ref or unique_ptr, * std::move SpdyHeaderBlock at call sites if possible, * return SpdyHeaderBlock by value instead of unique_ptr. BUG=621905 Committed: https://crrev.com/086b39e1a81d29610ecc1fbb851c934ae7f9db07 Cr-Commit-Position: refs/heads/master@{#401854}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Do not clear |request_headers_|. #

Patch Set 3 : Rebase. #

Patch Set 4 : Revert removing |request_headers_.clear()|. #

Patch Set 5 : clear() does not work after all. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+446 lines, -454 lines) Patch
M net/http/bidirectional_stream_unittest.cc View 4 chunks +4 lines, -3 lines 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 2 3 chunks +6 lines, -6 lines 0 comments Download
M net/http/http_proxy_client_socket_pool_unittest.cc View 2 chunks +3 lines, -1 line 0 comments Download
M net/quic/bidirectional_stream_quic_impl.cc View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M net/quic/bidirectional_stream_quic_impl_unittest.cc View 18 chunks +38 lines, -33 lines 0 comments Download
M net/quic/quic_http_stream.cc View 1 2 3 4 2 chunks +5 lines, -3 lines 0 comments Download
M net/quic/quic_http_stream_test.cc View 1 2 6 chunks +14 lines, -14 lines 0 comments Download
M net/quic/quic_network_transaction_unittest.cc View 9 chunks +20 lines, -20 lines 0 comments Download
M net/quic/quic_stream_factory_test.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M net/quic/test_tools/quic_test_packet_maker.h View 7 chunks +7 lines, -7 lines 0 comments Download
M net/quic/test_tools/quic_test_packet_maker.cc View 8 chunks +23 lines, -28 lines 0 comments Download
M net/spdy/buffered_spdy_framer.h View 3 chunks +4 lines, -4 lines 0 comments Download
M net/spdy/buffered_spdy_framer.cc View 5 chunks +11 lines, -14 lines 0 comments Download
M net/spdy/buffered_spdy_framer_unittest.cc View 6 chunks +7 lines, -5 lines 0 comments Download
M net/spdy/spdy_network_transaction_unittest.cc View 30 chunks +82 lines, -78 lines 0 comments Download
M net/spdy/spdy_proxy_client_socket_unittest.cc View 6 chunks +10 lines, -7 lines 0 comments Download
M net/spdy/spdy_session.h View 1 chunk +4 lines, -5 lines 0 comments Download
M net/spdy/spdy_session.cc View 3 chunks +25 lines, -26 lines 0 comments Download
M net/spdy/spdy_session_pool_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/spdy/spdy_session_unittest.cc View 56 chunks +75 lines, -76 lines 0 comments Download
M net/spdy/spdy_stream_unittest.cc View 16 chunks +25 lines, -24 lines 0 comments Download
M net/spdy/spdy_test_util_common.h View 1 2 5 chunks +21 lines, -30 lines 0 comments Download
M net/spdy/spdy_test_util_common.cc View 1 2 16 chunks +49 lines, -62 lines 0 comments Download
M net/tools/flip_server/spdy_interface.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/tools/quic/quic_simple_client.cc View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 19 (8 generated)
Bence
Ryan: PTAL. Thank you.
4 years, 6 months ago (2016-06-23 17:22:10 UTC) #2
Ryan Hamilton
lgtm woot https://codereview.chromium.org/2096713002/diff/1/net/quic/quic_http_stream.cc File net/quic/quic_http_stream.cc (right): https://codereview.chromium.org/2096713002/diff/1/net/quic/quic_http_stream.cc#newcode687 net/quic/quic_http_stream.cc:687: request_headers_ = SpdyHeaderBlock(); Doesn't move do the ...
4 years, 6 months ago (2016-06-23 18:23:18 UTC) #3
Bence
Ryan: does my reasoning to remove request_headers_.clear() sound correct? https://codereview.chromium.org/2096713002/diff/1/net/quic/quic_http_stream.cc File net/quic/quic_http_stream.cc (right): https://codereview.chromium.org/2096713002/diff/1/net/quic/quic_http_stream.cc#newcode687 net/quic/quic_http_stream.cc:687: ...
4 years, 6 months ago (2016-06-23 23:36:16 UTC) #5
Ryan Hamilton
https://codereview.chromium.org/2096713002/diff/1/net/quic/quic_http_stream.cc File net/quic/quic_http_stream.cc (right): https://codereview.chromium.org/2096713002/diff/1/net/quic/quic_http_stream.cc#newcode687 net/quic/quic_http_stream.cc:687: request_headers_ = SpdyHeaderBlock(); On 2016/06/23 23:36:16, Bence wrote: > ...
4 years, 6 months ago (2016-06-24 00:24:08 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2096713002/80001
4 years, 6 months ago (2016-06-24 11:01:24 UTC) #9
Bence
Thank you. https://codereview.chromium.org/2096713002/diff/1/net/quic/quic_http_stream.cc File net/quic/quic_http_stream.cc (right): https://codereview.chromium.org/2096713002/diff/1/net/quic/quic_http_stream.cc#newcode687 net/quic/quic_http_stream.cc:687: request_headers_ = SpdyHeaderBlock(); On 2016/06/24 00:24:07, Ryan ...
4 years, 6 months ago (2016-06-24 11:01:42 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/181243)
4 years, 6 months ago (2016-06-24 11:25:21 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2096713002/100001
4 years, 6 months ago (2016-06-24 12:08:50 UTC) #15
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 6 months ago (2016-06-24 13:05:42 UTC) #16
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/086b39e1a81d29610ecc1fbb851c934ae7f9db07 Cr-Commit-Position: refs/heads/master@{#401854}
4 years, 6 months ago (2016-06-24 13:07:20 UTC) #18
Bence
4 years, 6 months ago (2016-06-24 13:13:10 UTC) #19
Message was sent while issue was closed.
I needed to copy from a newly created SpdyHeaderBlock after all, because clear()
crashes on a moved-from instance.  This is a bug in SpdyHeaderBlock
implementation that I will fix in a separate CL.  Craziness!

Powered by Google App Engine
This is Rietveld 408576698