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

Unified Diff: ipc/ipc_channel_reader.h

Issue 1377483003: Trim IPC ChannelReader's buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reserve-buffer
Patch Set: Fix USE_ATTACHMENT_BROKER && defined(OS_MACOSX) && !defined(OS_IOS) case Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_reader.h
diff --git a/ipc/ipc_channel_reader.h b/ipc/ipc_channel_reader.h
index 8e2fcba82c903655710f28ad052019f8aeb3a477..352bfa521e90071393e9fbc66022b9dd40eb6978 100644
--- a/ipc/ipc_channel_reader.h
+++ b/ipc/ipc_channel_reader.h
@@ -129,6 +129,7 @@ class IPC_EXPORT ChannelReader : public SupportsAttachmentBrokering,
FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentNotYetBrokered);
FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, ResizeOverflowBuffer);
FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, InvalidMessageSize);
+ FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, TrimBuffer);
using AttachmentIdSet = std::set<BrokerableAttachment::AttachmentId>;
using AttachmentIdVector = std::vector<BrokerableAttachment::AttachmentId>;
@@ -195,6 +196,11 @@ class IPC_EXPORT ChannelReader : public SupportsAttachmentBrokering,
// this buffer.
std::string input_overflow_buf_;
+ // Maximum overflow buffer size, see Channel::kMaximumReadBufferSize.
+ // This is not a constant because we update it to reflect the reality
+ // of std::string::reserve() implementation.
+ size_t max_input_buffer_size_;
+
// These messages are waiting to be dispatched. If this vector is non-empty,
// then the front Message must be blocked on receiving an attachment from the
// AttachmentBroker.
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698