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

Side by Side Diff: ipc/ipc_channel_reader.cc

Issue 10919023: Add async trace events to trace progress of IPC messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix SpellCheckProviderTest.MultiLineText Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | ipc/ipc_channel_win.cc » ('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 namespace IPC { 7 namespace IPC {
8 namespace internal { 8 namespace internal {
9 9
10 ChannelReader::ChannelReader(Listener* listener) : listener_(listener) { 10 ChannelReader::ChannelReader(Listener* listener) : listener_(listener) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // Dispatch all complete messages in the data buffer. 63 // Dispatch all complete messages in the data buffer.
64 while (p < end) { 64 while (p < end) {
65 const char* message_tail = Message::FindNext(p, end); 65 const char* message_tail = Message::FindNext(p, end);
66 if (message_tail) { 66 if (message_tail) {
67 int len = static_cast<int>(message_tail - p); 67 int len = static_cast<int>(message_tail - p);
68 Message m(p, len); 68 Message m(p, len);
69 if (!WillDispatchInputMessage(&m)) 69 if (!WillDispatchInputMessage(&m))
70 return false; 70 return false;
71 71
72 m.TraceMessageStep();
72 if (IsHelloMessage(m)) 73 if (IsHelloMessage(m))
73 HandleHelloMessage(m); 74 HandleHelloMessage(m);
74 else 75 else
75 listener_->OnMessageReceived(m); 76 listener_->OnMessageReceived(m);
76 p = message_tail; 77 p = message_tail;
77 } else { 78 } else {
78 // Last message is partial. 79 // Last message is partial.
79 break; 80 break;
80 } 81 }
81 } 82 }
82 83
83 // Save any partial data in the overflow buffer. 84 // Save any partial data in the overflow buffer.
84 input_overflow_buf_.assign(p, end - p); 85 input_overflow_buf_.assign(p, end - p);
85 86
86 if (input_overflow_buf_.empty() && !DidEmptyInputBuffers()) 87 if (input_overflow_buf_.empty() && !DidEmptyInputBuffers())
87 return false; 88 return false;
88 return true; 89 return true;
89 } 90 }
90 91
91 92
92 } // namespace internal 93 } // namespace internal
93 } // namespace IPC 94 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | ipc/ipc_channel_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698