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

Unified Diff: ipc/ipc_channel_reader.h

Issue 1345353004: Resize IPC input buffer to fit the next message. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests and address comments Created 5 years, 3 months 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 | « base/pickle_unittest.cc ('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 3f3fc457954492b05b2a001d460fccc423052444..46775226f9a13a4d2d49ba611c349e50506f98d9 100644
--- a/ipc/ipc_channel_reader.h
+++ b/ipc/ipc_channel_reader.h
@@ -127,6 +127,8 @@ class IPC_EXPORT ChannelReader : public SupportsAttachmentBrokering,
private:
FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentAlreadyBrokered);
FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, AttachmentNotYetBrokered);
+ FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, ResizeOverflowBuffer);
+ FRIEND_TEST_ALL_PREFIXES(ChannelReaderTest, InvalidMessageSize);
typedef std::set<BrokerableAttachment::AttachmentId> AttachmentIdSet;
@@ -156,6 +158,9 @@ class IPC_EXPORT ChannelReader : public SupportsAttachmentBrokering,
void StartObservingAttachmentBroker();
void StopObservingAttachmentBroker();
+ // Checks that |size| is a valid message size. Has side effects if it's not.
jam 2015/09/30 14:18:16 nit: why does it need to mention an internal impl'
Dmitry Skiba 2015/09/30 15:32:35 Well, the function is named 'Check', so personally
+ bool CheckMessageSize(size_t size);
+
Listener* listener_;
// We read from the pipe into this buffer. Managed by DispatchInputData, do
« no previous file with comments | « base/pickle_unittest.cc ('k') | ipc/ipc_channel_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698