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

Unified Diff: mojo/common/platform_handle.h

Issue 2561003002: Add mojo structs for ScopedFD and ScopedHandle. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/common/invalid_typemapped_type.h ('k') | mojo/common/platform_handle.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/platform_handle.h
diff --git a/mojo/common/platform_handle.h b/mojo/common/platform_handle.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3b68fccf3eef8f990405be9932dd18fa6a61f05
--- /dev/null
+++ b/mojo/common/platform_handle.h
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_COMMON_PLATFORM_HANDLE_H_
+#define MOJO_COMMON_PLATFORM_HANDLE_H_
+
+#include "build/build_config.h"
+#include "mojo/common/invalid_typemapped_type.h"
+
+#if defined(OS_POSIX)
+#include "base/files/scoped_file.h"
+#endif
+
+#if defined(OS_WIN)
+#include "base/win/scoped_handle.h"
+#endif
+
+namespace mojo {
+namespace common {
+
+#if defined(OS_POSIX)
+using ScopedFDForwarder = base::ScopedFD;
+#else
+using ScopedFDForwarder = InvalidTypemappedType;
+#endif
+
+#if defined(OS_WIN)
+using ScopedHandleForwarder = base::win::ScopedHandle;
+#else
+using ScopedHandleForwarder = InvalidTypemappedType;
+#endif
+
+} // namespace common
+} // namespace mojo
+
+#endif // MOJO_COMMON_PLATFORM_HANDLE_H_
« no previous file with comments | « mojo/common/invalid_typemapped_type.h ('k') | mojo/common/platform_handle.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698