platform_shared_memory_handle.cc 779 B

1234567891011121314151617181920212223242526
  1. // Copyright 2018 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.
  4. #include "base/memory/platform_shared_memory_handle.h"
  5. namespace base::subtle {
  6. #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_ANDROID)
  7. ScopedFDPair::ScopedFDPair() = default;
  8. ScopedFDPair::ScopedFDPair(ScopedFDPair&&) = default;
  9. ScopedFDPair& ScopedFDPair::operator=(ScopedFDPair&&) = default;
  10. ScopedFDPair::~ScopedFDPair() = default;
  11. ScopedFDPair::ScopedFDPair(ScopedFD in_fd, ScopedFD in_readonly_fd)
  12. : fd(std::move(in_fd)), readonly_fd(std::move(in_readonly_fd)) {}
  13. FDPair ScopedFDPair::get() const {
  14. return {fd.get(), readonly_fd.get()};
  15. }
  16. #endif
  17. } // namespace base::subtle