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

Issue 1345353004: Resize IPC input buffer to fit the next message. (Closed)

Created:
5 years, 3 months ago by Dmitry Skiba
Modified:
5 years, 2 months ago
Reviewers:
jam, Maria
CC:
chromium-reviews, darin-cc_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Resize IPC input buffer to fit the next message. Sometimes we can get IPC message size from its header. In those cases we resize IPC::ChannelReader' overflow buffer to fit the entire message to avoid growing / reallocating it as we receive message's data. BUG=529940 Committed: https://crrev.com/6f3790a15d0a5463e18dd7220e4f2028a6318389 Cr-Commit-Position: refs/heads/master@{#351586}

Patch Set 1 #

Patch Set 2 : Rework PeekNext() / add tests #

Patch Set 3 : Add ChannelReader test #

Patch Set 4 : Early max message size check; tests #

Patch Set 5 : Fix errors #

Patch Set 6 : MSVC fixes #

Patch Set 7 : 64-bit MSVC fix #

Patch Set 8 : Fix overflow test to actually overflow on 32-bit #

Total comments: 9

Patch Set 9 : Fix tests and address comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+360 lines, -24 lines) Patch
M base/pickle.h View 1 2 3 2 chunks +14 lines, -0 lines 0 comments Download
M base/pickle.cc View 1 2 3 2 chunks +29 lines, -4 lines 0 comments Download
M base/pickle_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +82 lines, -0 lines 0 comments Download
M ipc/ipc_channel_reader.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 2 comments Download
M ipc/ipc_channel_reader.cc View 1 2 3 4 5 6 7 8 4 chunks +26 lines, -5 lines 0 comments Download
M ipc/ipc_channel_reader_unittest.cc View 1 2 3 4 5 5 chunks +63 lines, -2 lines 0 comments Download
M ipc/ipc_message.h View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -1 line 0 comments Download
M ipc/ipc_message.cc View 1 2 3 4 chunks +31 lines, -10 lines 0 comments Download
M ipc/ipc_message_unittest.cc View 1 2 3 4 5 6 7 5 chunks +101 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 16 (2 generated)
Dmitry Skiba
5 years, 3 months ago (2015-09-21 22:13:40 UTC) #2
Maria
lgtm
5 years, 3 months ago (2015-09-21 23:24:20 UTC) #3
jam
there are test failures now?
5 years, 3 months ago (2015-09-22 15:45:59 UTC) #4
DmitrySkiba
On 2015/09/22 15:45:59, jam wrote: > there are test failures now? Yup, so I'm fixing ...
5 years, 3 months ago (2015-09-22 15:54:54 UTC) #5
Dmitry Skiba
Guys, I'm done with writing tests - please review.
5 years, 3 months ago (2015-09-24 20:15:49 UTC) #6
Maria
Looks like some bots are still failing the tests. Also added a few style comments. ...
5 years, 2 months ago (2015-09-25 22:23:01 UTC) #7
Dmitry Skiba
https://codereview.chromium.org/1345353004/diff/140001/ipc/ipc_channel_reader.cc File ipc/ipc_channel_reader.cc (right): https://codereview.chromium.org/1345353004/diff/140001/ipc/ipc_channel_reader.cc#newcode154 ipc/ipc_channel_reader.cc:154: bool ChannelReader::CheckMessageSize(size_t size) { On 2015/09/25 22:23:00, Maria wrote: ...
5 years, 2 months ago (2015-09-28 17:37:18 UTC) #8
Maria
lgtm
5 years, 2 months ago (2015-09-28 18:17:52 UTC) #9
Dmitry Skiba
jam@, are you OK with this change? Waiting for your review...
5 years, 2 months ago (2015-09-29 18:34:53 UTC) #10
jam
lgtm sorry for the delay, I missed the updates (ping me over IM in the ...
5 years, 2 months ago (2015-09-30 14:18:16 UTC) #11
Dmitry Skiba
https://codereview.chromium.org/1345353004/diff/160001/ipc/ipc_channel_reader.h File ipc/ipc_channel_reader.h (right): https://codereview.chromium.org/1345353004/diff/160001/ipc/ipc_channel_reader.h#newcode161 ipc/ipc_channel_reader.h:161: // Checks that |size| is a valid message size. ...
5 years, 2 months ago (2015-09-30 15:32:35 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1345353004/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1345353004/160001
5 years, 2 months ago (2015-09-30 15:55:31 UTC) #14
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 2 months ago (2015-09-30 17:24:40 UTC) #15
commit-bot: I haz the power
5 years, 2 months ago (2015-09-30 17:25:20 UTC) #16
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/6f3790a15d0a5463e18dd7220e4f2028a6318389
Cr-Commit-Position: refs/heads/master@{#351586}

Powered by Google App Engine
This is Rietveld 408576698