blob: 79d8a426abdff2e6f1e754bd72a65e9149f04673 [file] [log] [blame]
Viet-Trung Luu451ed412015-03-09 11:11:11 -07001// Copyright 2015 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// Shared implementation of things common between |DirectoryImpl| and
6// |FileImpl|.
7
8#ifndef SERVICES_FILES_SHARED_IMPL_H_
9#define SERVICES_FILES_SHARED_IMPL_H_
10
11#include "mojo/public/cpp/bindings/callback.h"
Viet-Trung Luu08e339a2015-10-10 01:03:09 -070012#include "mojo/services/files/interfaces/types.mojom.h"
Viet-Trung Luu451ed412015-03-09 11:11:11 -070013
14namespace mojo {
15namespace files {
16
17// Stats the given FD (which must be valid), calling |callback| appropriately.
Viet-Trung Luu20728c72015-03-13 12:49:06 -070018// The type in the |FileInformation| given to the callback will be assigned from
19// |type|.
Viet-Trung Luu05806242015-04-03 10:17:37 -070020using StatFDCallback = Callback<void(Error, FileInformationPtr)>;
21void StatFD(int fd, FileType type, const StatFDCallback& callback);
Viet-Trung Luu451ed412015-03-09 11:11:11 -070022
23// Touches the given FD (which must be valid), calling |callback| appropriately.
Viet-Trung Luu05806242015-04-03 10:17:37 -070024using TouchFDCallback = Callback<void(Error)>;
Viet-Trung Luu451ed412015-03-09 11:11:11 -070025void TouchFD(int fd,
26 TimespecOrNowPtr atime,
27 TimespecOrNowPtr mtime,
Viet-Trung Luu05806242015-04-03 10:17:37 -070028 const TouchFDCallback& callback);
Viet-Trung Luu451ed412015-03-09 11:11:11 -070029
30} // namespace files
31} // namespace mojo
32
33#endif // SERVICES_FILES_SHARED_IMPL_H_