| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/thread.h" | 6 #include "base/thread.h" |
| 7 #include "chrome/common/ipc_channel_proxy.h" | 7 #include "chrome/common/ipc_channel_proxy.h" |
| 8 #include "chrome/common/ipc_logging.h" | 8 #include "chrome/common/ipc_logging.h" |
| 9 #include "chrome/common/ipc_message_utils.h" | 9 #include "chrome/common/ipc_message_utils.h" |
| 10 | 10 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 filter->AddRef(); | 265 filter->AddRef(); |
| 266 context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 266 context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
| 267 context_.get(), &Context::OnAddFilter, filter)); | 267 context_.get(), &Context::OnAddFilter, filter)); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void ChannelProxy::RemoveFilter(MessageFilter* filter) { | 270 void ChannelProxy::RemoveFilter(MessageFilter* filter) { |
| 271 context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( | 271 context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod( |
| 272 context_.get(), &Context::OnRemoveFilter, filter)); | 272 context_.get(), &Context::OnRemoveFilter, filter)); |
| 273 } | 273 } |
| 274 | 274 |
| 275 void ChannelProxy::ClearIPCMessageLoop() { | |
| 276 context()->ClearIPCMessageLoop(); | |
| 277 } | |
| 278 | |
| 279 #if defined(OS_POSIX) | 275 #if defined(OS_POSIX) |
| 280 // See the TODO regarding lazy initialization of the channel in | 276 // See the TODO regarding lazy initialization of the channel in |
| 281 // ChannelProxy::Init(). | 277 // ChannelProxy::Init(). |
| 282 // We assume that IPC::Channel::GetClientFileDescriptorMapping() is thread-safe. | 278 // We assume that IPC::Channel::GetClientFileDescriptorMapping() is thread-safe. |
| 283 int ChannelProxy::GetClientFileDescriptor() const { | 279 int ChannelProxy::GetClientFileDescriptor() const { |
| 284 Channel *channel = context_.get()->channel_; | 280 Channel *channel = context_.get()->channel_; |
| 285 DCHECK(channel); // Channel must have been created first. | 281 DCHECK(channel); // Channel must have been created first. |
| 286 return channel->GetClientFileDescriptor(); | 282 return channel->GetClientFileDescriptor(); |
| 287 } | 283 } |
| 288 #endif | 284 #endif |
| 289 | 285 |
| 290 //----------------------------------------------------------------------------- | 286 //----------------------------------------------------------------------------- |
| 291 | 287 |
| 292 } // namespace IPC | 288 } // namespace IPC |
| OLD | NEW |