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

Unified Diff: mojo/services/files/public/c/lib/fd_impl.h

Issue 1388413005: Move //mojo/services/X/public/... to //mojo/services/X/... (part 1). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 months 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/services/files/public/c/lib/errno_impl.h ('k') | mojo/services/files/public/c/lib/fd_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/files/public/c/lib/fd_impl.h
diff --git a/mojo/services/files/public/c/lib/fd_impl.h b/mojo/services/files/public/c/lib/fd_impl.h
deleted file mode 100644
index 3884eee79eeed98d616c09c50e10466a0b55b2d5..0000000000000000000000000000000000000000
--- a/mojo/services/files/public/c/lib/fd_impl.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2015 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 SERVICES_FILES_C_LIB_FD_IMPL_H_
-#define SERVICES_FILES_C_LIB_FD_IMPL_H_
-
-#include <memory>
-
-#include "files/public/c/mojio_sys_stat.h"
-#include "files/public/c/mojio_sys_types.h"
-#include "mojo/public/cpp/system/macros.h"
-
-namespace mojio {
-
-class ErrnoImpl;
-
-// |FDImpl| is an interface for file-descriptor-like objects, on top of which
-// <unistd.h>-style (and also <stdio.h>-style) functions may be implemented.
-// (For <unistd.h>-style functions, one needs a file descriptor table, since FDs
-// are integers with a prescribed allocation scheme.)
-//
-// <unistd.h> functions with a "boolean" return value (0 on success, -1 on
-// failure) here return a |bool| instead (true on success, false on failure). On
-// failure, all methods set "errno" using the |ErrnoImpl| passed to the
-// constructor.
-class FDImpl {
- public:
- virtual ~FDImpl() {}
-
- // <unistd.h>:
- virtual bool Close() = 0; // May be called only at most once.
- virtual std::unique_ptr<FDImpl> Dup() = 0;
- virtual bool Ftruncate(mojio_off_t length) = 0;
- virtual mojio_off_t Lseek(mojio_off_t offset, int whence) = 0;
- virtual mojio_ssize_t Read(void* buf, size_t count) = 0;
- virtual mojio_ssize_t Write(const void* buf, size_t count) = 0;
-
- // <sys/stat.h>:
- virtual bool Fstat(struct mojio_stat* buf) = 0;
-
- protected:
- // The |ErrnoImpl| must outlive this object and all objects transitively
- // |Dup()|ed from it.
- explicit FDImpl(ErrnoImpl* errno_impl) : errno_impl_(errno_impl) {}
-
- ErrnoImpl* errno_impl() const { return errno_impl_; }
-
- private:
- ErrnoImpl* const errno_impl_;
-
- MOJO_DISALLOW_COPY_AND_ASSIGN(FDImpl);
-};
-
-} // namespace mojio
-
-#endif // SERVICES_FILES_C_LIB_FD_IMPL_H_
« no previous file with comments | « mojo/services/files/public/c/lib/errno_impl.h ('k') | mojo/services/files/public/c/lib/fd_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698