| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "ipc/ipc_channel_proxy.h" | 7 #include "ipc/ipc_channel_proxy.h" |
| 8 #include "ipc/ipc_logging.h" | 8 #include "ipc/ipc_logging.h" |
| 9 #include "ipc/ipc_message_utils.h" | 9 #include "ipc/ipc_message_utils.h" |
| 10 | 10 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 make_scoped_refptr(filter))); | 369 make_scoped_refptr(filter))); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void ChannelProxy::ClearIPCMessageLoop() { | 372 void ChannelProxy::ClearIPCMessageLoop() { |
| 373 context()->ClearIPCMessageLoop(); | 373 context()->ClearIPCMessageLoop(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 #if defined(OS_POSIX) && !defined(OS_NACL) | 376 #if defined(OS_POSIX) && !defined(OS_NACL) |
| 377 // See the TODO regarding lazy initialization of the channel in | 377 // See the TODO regarding lazy initialization of the channel in |
| 378 // ChannelProxy::Init(). | 378 // ChannelProxy::Init(). |
| 379 // We assume that IPC::Channel::GetClientFileDescriptorMapping() is thread-safe. | 379 int ChannelProxy::GetClientFileDescriptor() { |
| 380 int ChannelProxy::GetClientFileDescriptor() const { | 380 Channel* channel = context_.get()->channel_.get(); |
| 381 Channel *channel = context_.get()->channel_.get(); | |
| 382 // Channel must have been created first. | 381 // Channel must have been created first. |
| 383 DCHECK(channel) << context_.get()->channel_id_; | 382 DCHECK(channel) << context_.get()->channel_id_; |
| 384 return channel->GetClientFileDescriptor(); | 383 return channel->GetClientFileDescriptor(); |
| 385 } | 384 } |
| 386 | 385 |
| 386 int ChannelProxy::TakeClientFileDescriptor() { |
| 387 Channel* channel = context_.get()->channel_.get(); |
| 388 // Channel must have been created first. |
| 389 DCHECK(channel) << context_.get()->channel_id_; |
| 390 return channel->TakeClientFileDescriptor(); |
| 391 } |
| 392 |
| 387 bool ChannelProxy::GetClientEuid(uid_t* client_euid) const { | 393 bool ChannelProxy::GetClientEuid(uid_t* client_euid) const { |
| 388 Channel *channel = context_.get()->channel_.get(); | 394 Channel* channel = context_.get()->channel_.get(); |
| 389 // Channel must have been created first. | 395 // Channel must have been created first. |
| 390 DCHECK(channel) << context_.get()->channel_id_; | 396 DCHECK(channel) << context_.get()->channel_id_; |
| 391 return channel->GetClientEuid(client_euid); | 397 return channel->GetClientEuid(client_euid); |
| 392 } | 398 } |
| 393 #endif | 399 #endif |
| 394 | 400 |
| 395 //----------------------------------------------------------------------------- | 401 //----------------------------------------------------------------------------- |
| 396 | 402 |
| 397 } // namespace IPC | 403 } // namespace IPC |
| OLD | NEW |