Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Side by Side Diff: ipc/ipc_platform_file_attachment_posix.cc

Issue 2494943002: Remove IPC::BrokerableAttachment. (Closed)
Patch Set: extra test output Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_platform_file_attachment_posix.h ('k') | ipc/ipc_send_fds_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 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 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_platform_file_attachment_posix.h" 5 #include "ipc/ipc_platform_file_attachment_posix.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 namespace IPC { 9 namespace IPC {
10 namespace internal { 10 namespace internal {
11 11
12 PlatformFileAttachment::PlatformFileAttachment(base::PlatformFile file) 12 PlatformFileAttachment::PlatformFileAttachment(base::PlatformFile file)
13 : file_(file) { 13 : file_(file) {
14 } 14 }
15 15
16 PlatformFileAttachment::PlatformFileAttachment(base::ScopedFD file) 16 PlatformFileAttachment::PlatformFileAttachment(base::ScopedFD file)
17 : file_(file.get()), owning_(std::move(file)) {} 17 : file_(file.get()), owning_(std::move(file)) {}
18 18
19 PlatformFileAttachment::~PlatformFileAttachment() { 19 PlatformFileAttachment::~PlatformFileAttachment() {
20 } 20 }
21 21
22 MessageAttachment::Type PlatformFileAttachment::GetType() const { 22 MessageAttachment::Type PlatformFileAttachment::GetType() const {
23 return TYPE_PLATFORM_FILE; 23 return Type::PLATFORM_FILE;
24 } 24 }
25 25
26 base::PlatformFile PlatformFileAttachment::TakePlatformFile() { 26 base::PlatformFile PlatformFileAttachment::TakePlatformFile() {
27 ignore_result(owning_.release()); 27 ignore_result(owning_.release());
28 return file_; 28 return file_;
29 } 29 }
30 30
31 base::PlatformFile GetPlatformFile( 31 base::PlatformFile GetPlatformFile(
32 scoped_refptr<MessageAttachment> attachment) { 32 scoped_refptr<MessageAttachment> attachment) {
33 DCHECK_EQ(attachment->GetType(), MessageAttachment::TYPE_PLATFORM_FILE); 33 DCHECK_EQ(attachment->GetType(), MessageAttachment::Type::PLATFORM_FILE);
34 return static_cast<PlatformFileAttachment*>(attachment.get())->file(); 34 return static_cast<PlatformFileAttachment*>(attachment.get())->file();
35 } 35 }
36 36
37 } // namespace internal 37 } // namespace internal
38 } // namespace IPC 38 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_platform_file_attachment_posix.h ('k') | ipc/ipc_send_fds_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698