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

Side by Side Diff: ipc/ipc_channel_reader.cc

Issue 283313002: Ensure that any IPC sent from a child process that couldn't be deserialized causes that p… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: switch to histograms Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | ipc/ipc_listener.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/ipc_channel_reader.h" 5 #include "ipc/ipc_channel_reader.h"
6 6
7 #include "ipc/ipc_listener.h" 7 #include "ipc/ipc_listener.h"
8 #include "ipc/ipc_logging.h" 8 #include "ipc/ipc_logging.h"
9 #include "ipc/ipc_message_macros.h" 9 #include "ipc/ipc_message_macros.h"
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 #else 88 #else
89 TRACE_EVENT2("ipc,toplevel", "ChannelReader::DispatchInputData", 89 TRACE_EVENT2("ipc,toplevel", "ChannelReader::DispatchInputData",
90 "class", IPC_MESSAGE_ID_CLASS(m.type()), 90 "class", IPC_MESSAGE_ID_CLASS(m.type()),
91 "line", IPC_MESSAGE_ID_LINE(m.type())); 91 "line", IPC_MESSAGE_ID_LINE(m.type()));
92 #endif 92 #endif
93 m.TraceMessageEnd(); 93 m.TraceMessageEnd();
94 if (IsInternalMessage(m)) 94 if (IsInternalMessage(m))
95 HandleInternalMessage(m); 95 HandleInternalMessage(m);
96 else 96 else
97 listener_->OnMessageReceived(m); 97 listener_->OnMessageReceived(m);
98 if (m.dispatch_error())
99 listener_->OnBadMessageReceived(m);
98 p = message_tail; 100 p = message_tail;
99 } else { 101 } else {
100 // Last message is partial. 102 // Last message is partial.
101 break; 103 break;
102 } 104 }
103 } 105 }
104 106
105 // Save any partial data in the overflow buffer. 107 // Save any partial data in the overflow buffer.
106 input_overflow_buf_.assign(p, end - p); 108 input_overflow_buf_.assign(p, end - p);
107 109
108 if (input_overflow_buf_.empty() && !DidEmptyInputBuffers()) 110 if (input_overflow_buf_.empty() && !DidEmptyInputBuffers())
109 return false; 111 return false;
110 return true; 112 return true;
111 } 113 }
112 114
113 115
114 } // namespace internal 116 } // namespace internal
115 } // namespace IPC 117 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | ipc/ipc_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698