diff options
author | dskiba <dskiba@google.com> | 2015-11-03 17:24:59 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-04 01:26:32 +0000 |
commit | 06a2e65a4f3610ec17dbc5988c0b16a95825240a (patch) | |
tree | 832c8987239fa85a667266716726847e8912db25 /ipc/ipc_channel.h | |
parent | 3c56b94daaf6513891e7da3094ab5054ffbd6262 (diff) | |
download | chromium_src-06a2e65a4f3610ec17dbc5988c0b16a95825240a.zip chromium_src-06a2e65a4f3610ec17dbc5988c0b16a95825240a.tar.gz chromium_src-06a2e65a4f3610ec17dbc5988c0b16a95825240a.tar.bz2 |
Trim IPC ChannelReader's buffer after processing large messages.
Most IPC messages are small, but there are few ones that can be quite large.
With this change ChannelReader trims its input buffer after processing large
messages.
BUG=529940
Review URL: https://codereview.chromium.org/1377483003
Cr-Commit-Position: refs/heads/master@{#357708}
Diffstat (limited to 'ipc/ipc_channel.h')
-rw-r--r-- | ipc/ipc_channel.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h index 142f3d5..5345112 100644 --- a/ipc/ipc_channel.h +++ b/ipc/ipc_channel.h @@ -97,6 +97,11 @@ class IPC_EXPORT Channel : public Endpoint { // Amount of data to read at once from the pipe. static const size_t kReadBufferSize = 4 * 1024; + // Maximum persistent read buffer size. Read buffer can grow larger to + // accommodate large messages, but it's recommended to shrink back to this + // value because it fits 99.9% of all messages (see issue 529940 for data). + static const size_t kMaximumReadBufferSize = 64 * 1024; + // Initialize a Channel. // // |channel_handle| identifies the communication Channel. For POSIX, if |