Upload upstream chromium 71.0.3578.0
[platform/framework/web/chromium-efl.git] / base / fuchsia / file_utils.h
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
5 #ifndef BASE_FUCHSIA_FILE_UTILS_H_
6 #define BASE_FUCHSIA_FILE_UTILS_H_
7
8 #include <lib/zx/handle.h>
9
10 #include "base/base_export.h"
11
12 namespace base {
13
14 class File;
15
16 namespace fuchsia {
17
18 // Gets a Zircon handle from a file or directory |path| in the process'
19 // namespace.
20 BASE_EXPORT zx::handle GetHandleFromFile(base::File file);
21
22 // Makes a File object from a Zircon handle.
23 // Returns an empty File if |handle| is invalid or not a valid PA_FDIO_REMOTE
24 // descriptor.
25 BASE_EXPORT base::File GetFileFromHandle(zx::handle handle);
26
27 }  // namespace fuchsia
28 }  // namespace base
29
30 #endif  // BASE_FUCHSIA_FILE_UTILS_H_