| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 void ChannelProxy::RemoveFilter(MessageFilter* filter) { | 380 void ChannelProxy::RemoveFilter(MessageFilter* filter) { |
| 381 context_->ipc_message_loop()->PostTask( | 381 context_->ipc_message_loop()->PostTask( |
| 382 FROM_HERE, base::Bind(&Context::OnRemoveFilter, context_.get(), | 382 FROM_HERE, base::Bind(&Context::OnRemoveFilter, context_.get(), |
| 383 make_scoped_refptr(filter))); | 383 make_scoped_refptr(filter))); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void ChannelProxy::ClearIPCMessageLoop() { | 386 void ChannelProxy::ClearIPCMessageLoop() { |
| 387 context()->ClearIPCMessageLoop(); | 387 context()->ClearIPCMessageLoop(); |
| 388 } | 388 } |
| 389 | 389 |
| 390 #if defined(OS_POSIX) && !defined(OS_NACL) | 390 #if defined(OS_POSIX) |
| 391 // See the TODO regarding lazy initialization of the channel in | 391 // See the TODO regarding lazy initialization of the channel in |
| 392 // ChannelProxy::Init(). | 392 // ChannelProxy::Init(). |
| 393 int ChannelProxy::GetClientFileDescriptor() { | 393 int ChannelProxy::GetClientFileDescriptor() { |
| 394 Channel* channel = context_.get()->channel_.get(); | 394 Channel* channel = context_.get()->channel_.get(); |
| 395 // Channel must have been created first. | 395 // Channel must have been created first. |
| 396 DCHECK(channel) << context_.get()->channel_id_; | 396 DCHECK(channel) << context_.get()->channel_id_; |
| 397 return channel->GetClientFileDescriptor(); | 397 return channel->GetClientFileDescriptor(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 int ChannelProxy::TakeClientFileDescriptor() { | 400 int ChannelProxy::TakeClientFileDescriptor() { |
| 401 Channel* channel = context_.get()->channel_.get(); | 401 Channel* channel = context_.get()->channel_.get(); |
| 402 // Channel must have been created first. | 402 // Channel must have been created first. |
| 403 DCHECK(channel) << context_.get()->channel_id_; | 403 DCHECK(channel) << context_.get()->channel_id_; |
| 404 return channel->TakeClientFileDescriptor(); | 404 return channel->TakeClientFileDescriptor(); |
| 405 } | 405 } |
| 406 | 406 |
| 407 bool ChannelProxy::GetClientEuid(uid_t* client_euid) const { | 407 bool ChannelProxy::GetClientEuid(uid_t* client_euid) const { |
| 408 Channel* channel = context_.get()->channel_.get(); | 408 Channel* channel = context_.get()->channel_.get(); |
| 409 // Channel must have been created first. | 409 // Channel must have been created first. |
| 410 DCHECK(channel) << context_.get()->channel_id_; | 410 DCHECK(channel) << context_.get()->channel_id_; |
| 411 return channel->GetClientEuid(client_euid); | 411 return channel->GetClientEuid(client_euid); |
| 412 } | 412 } |
| 413 #endif | 413 #endif |
| 414 | 414 |
| 415 //----------------------------------------------------------------------------- | 415 //----------------------------------------------------------------------------- |
| 416 | 416 |
| 417 } // namespace IPC | 417 } // namespace IPC |
| OLD | NEW |