Include the proper animated gif for thread_times.key_idle_power_cases
[chromium-blink-merge.git] / ipc / ipc_platform_file_attachment_posix.cc
blobb704750c15625cf2ce1889f3d51b48f42acaf81d
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ipc/ipc_platform_file_attachment_posix.h"
7 namespace IPC {
8 namespace internal {
10 PlatformFileAttachment::PlatformFileAttachment(base::PlatformFile file)
11 : file_(file) {
14 PlatformFileAttachment::PlatformFileAttachment(base::ScopedFD file)
15 : file_(file.get()), owning_(file.Pass()) {
18 PlatformFileAttachment::~PlatformFileAttachment() {
21 MessageAttachment::Type PlatformFileAttachment::GetType() const {
22 return TYPE_PLATFORM_FILE;
25 base::PlatformFile PlatformFileAttachment::TakePlatformFile() {
26 ignore_result(owning_.release());
27 return file_;
30 base::PlatformFile GetPlatformFile(
31 scoped_refptr<MessageAttachment> attachment) {
32 DCHECK_EQ(attachment->GetType(), MessageAttachment::TYPE_PLATFORM_FILE);
33 return static_cast<PlatformFileAttachment*>(attachment.get())->file();
36 } // namespace internal
37 } // namespace IPC