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

Side by Side Diff: ipc/ipc_channel_reader.cc

Issue 1258323004: Reland #1: Clean up interface of attachment broker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « ipc/ipc_channel_reader.h ('k') | ipc/ipc_channel_reader_unittest.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 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ipc/ipc_listener.h" 9 #include "ipc/ipc_listener.h"
10 #include "ipc/ipc_logging.h" 10 #include "ipc/ipc_logging.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 std::string name; 156 std::string name;
157 Logging::GetInstance()->GetMessageText(m->type(), &name, m, NULL); 157 Logging::GetInstance()->GetMessageText(m->type(), &name, m, NULL);
158 TRACE_EVENT1("ipc,toplevel", "ChannelReader::DispatchInputData", "name", 158 TRACE_EVENT1("ipc,toplevel", "ChannelReader::DispatchInputData", "name",
159 name); 159 name);
160 #else 160 #else
161 TRACE_EVENT2("ipc,toplevel", "ChannelReader::DispatchInputData", "class", 161 TRACE_EVENT2("ipc,toplevel", "ChannelReader::DispatchInputData", "class",
162 IPC_MESSAGE_ID_CLASS(m->type()), "line", 162 IPC_MESSAGE_ID_CLASS(m->type()), "line",
163 IPC_MESSAGE_ID_LINE(m->type())); 163 IPC_MESSAGE_ID_LINE(m->type()));
164 #endif 164 #endif
165 m->TraceMessageEnd(); 165 m->TraceMessageEnd();
166 if (IsInternalMessage(*m)) 166
167 bool handled = false;
168 if (IsInternalMessage(*m)) {
167 HandleInternalMessage(*m); 169 HandleInternalMessage(*m);
168 else 170 handled = true;
171 }
172 #if USE_ATTACHMENT_BROKER
173 if (!handled && IsAttachmentBrokerEndpoint() && GetAttachmentBroker()) {
174 handled = GetAttachmentBroker()->OnMessageReceived(*m);
175 }
176 #endif // USE_ATTACHMENT_BROKER
177 if (!handled)
169 listener_->OnMessageReceived(*m); 178 listener_->OnMessageReceived(*m);
170 if (m->dispatch_error()) 179 if (m->dispatch_error())
171 listener_->OnBadMessageReceived(*m); 180 listener_->OnBadMessageReceived(*m);
172 } 181 }
173 182
174 ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments( 183 ChannelReader::AttachmentIdSet ChannelReader::GetBrokeredAttachments(
175 Message* msg) { 184 Message* msg) {
176 std::set<BrokerableAttachment::AttachmentId> blocked_ids; 185 std::set<BrokerableAttachment::AttachmentId> blocked_ids;
177 186
178 #if USE_ATTACHMENT_BROKER 187 #if USE_ATTACHMENT_BROKER
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 } 228 }
220 229
221 void ChannelReader::StopObservingAttachmentBroker() { 230 void ChannelReader::StopObservingAttachmentBroker() {
222 #if USE_ATTACHMENT_BROKER 231 #if USE_ATTACHMENT_BROKER
223 GetAttachmentBroker()->RemoveObserver(this); 232 GetAttachmentBroker()->RemoveObserver(this);
224 #endif // USE_ATTACHMENT_BROKER 233 #endif // USE_ATTACHMENT_BROKER
225 } 234 }
226 235
227 } // namespace internal 236 } // namespace internal
228 } // namespace IPC 237 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_reader.h ('k') | ipc/ipc_channel_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698