| OLD | NEW |
| 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_proxy.h" | 5 #include "ipc/ipc_channel_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 if (logger->Enabled()) | 79 if (logger->Enabled()) |
| 80 logger->OnPostDispatchMessage(message, channel_id_); | 80 logger->OnPostDispatchMessage(message, channel_id_); |
| 81 #endif | 81 #endif |
| 82 return true; | 82 return true; |
| 83 } | 83 } |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Called on the IPC::Channel thread | 87 // Called on the IPC::Channel thread |
| 88 bool ChannelProxy::Context::OnMessageReceived(const Message& message) { | 88 bool ChannelProxy::Context::OnMessageReceived(const Message& message) { |
| 89 |
| 90 if (listener_task_runner_->BelongsToCurrentThread()) { |
| 91 OnDispatchMessage(message); |
| 92 return true; |
| 93 } |
| 94 |
| 95 |
| 96 |
| 89 // First give a chance to the filters to process this message. | 97 // First give a chance to the filters to process this message. |
| 90 if (!TryFilters(message)) | 98 if (!TryFilters(message)) |
| 91 OnMessageReceivedNoFilter(message); | 99 OnMessageReceivedNoFilter(message); |
| 92 return true; | 100 return true; |
| 93 } | 101 } |
| 94 | 102 |
| 95 // Called on the IPC::Channel thread | 103 // Called on the IPC::Channel thread |
| 96 bool ChannelProxy::Context::OnMessageReceivedNoFilter(const Message& message) { | 104 bool ChannelProxy::Context::OnMessageReceivedNoFilter(const Message& message) { |
| 97 listener_task_runner_->PostTask( | 105 listener_task_runner_->PostTask( |
| 98 FROM_HERE, base::Bind(&Context::OnDispatchMessage, this, message)); | 106 FROM_HERE, base::Bind(&Context::OnDispatchMessage, this, message)); |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 return channel->TakeClientFileDescriptor(); | 524 return channel->TakeClientFileDescriptor(); |
| 517 } | 525 } |
| 518 #endif | 526 #endif |
| 519 | 527 |
| 520 void ChannelProxy::OnChannelInit() { | 528 void ChannelProxy::OnChannelInit() { |
| 521 } | 529 } |
| 522 | 530 |
| 523 //----------------------------------------------------------------------------- | 531 //----------------------------------------------------------------------------- |
| 524 | 532 |
| 525 } // namespace IPC | 533 } // namespace IPC |
| OLD | NEW |