xref: /aosp_15_r20/external/cronet/base/memory/platform_shared_memory_handle.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2018 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "base/memory/platform_shared_memory_handle.h"
6 
7 namespace base::subtle {
8 
9 #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_ANDROID)
10 ScopedFDPair::ScopedFDPair() = default;
11 
12 ScopedFDPair::ScopedFDPair(ScopedFDPair&&) = default;
13 
14 ScopedFDPair& ScopedFDPair::operator=(ScopedFDPair&&) = default;
15 
16 ScopedFDPair::~ScopedFDPair() = default;
17 
ScopedFDPair(ScopedFD in_fd,ScopedFD in_readonly_fd)18 ScopedFDPair::ScopedFDPair(ScopedFD in_fd, ScopedFD in_readonly_fd)
19     : fd(std::move(in_fd)), readonly_fd(std::move(in_readonly_fd)) {}
20 
get() const21 FDPair ScopedFDPair::get() const {
22   return {fd.get(), readonly_fd.get()};
23 }
24 #endif
25 
26 }  // namespace base::subtle
27