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

Unified Diff: mojo/services/files/public/c/lib/errno_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/directory_wrapper.cc ('k') | mojo/services/files/public/c/lib/fd_impl.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/errno_impl.h
diff --git a/mojo/services/files/public/c/lib/errno_impl.h b/mojo/services/files/public/c/lib/errno_impl.h
deleted file mode 100644
index dac10316b273571cc9e988f480b6c4935a036928..0000000000000000000000000000000000000000
--- a/mojo/services/files/public/c/lib/errno_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_ERRNO_IMPL_H_
-#define SERVICES_FILES_C_LIB_ERRNO_IMPL_H_
-
-#include "mojo/public/cpp/system/macros.h"
-
-namespace mojio {
-
-// |ErrnoImpl| is an interface for getting/setting errno values.
-class ErrnoImpl {
- public:
- // When destroyed, this class either preserves the errno value at creation or
- // sets it to an explicit value. (Without this, internal calls may set errno
- // to a value that shouldn't be visible to the caller.)
- class Setter {
- public:
- explicit Setter(ErrnoImpl* errno_impl)
- : errno_impl_(errno_impl), error_(errno_impl_->Get()) {}
- ~Setter() { errno_impl_->Set(error_); }
-
- // If |error| is 0, this does nothing and returns true. Otherwise, this will
- // arrange for the |ErrnoImpl|'s |Set()| to be called with the value of
- // |error| (which should be a valid errno code) on destruction, and returns
- // false.
- bool Set(int error) {
- if (error == 0)
- return true;
- error_ = error;
- return false;
- }
-
- private:
- ErrnoImpl* const errno_impl_;
- int error_;
-
- MOJO_DISALLOW_COPY_AND_ASSIGN(Setter);
- };
-
- virtual int Get() const = 0;
- virtual void Set(int error) = 0;
-
- protected:
- ErrnoImpl() {}
- // Important: Destructors should not modify (the "real") errno (or any global
- // state that may affect implementations of |ErrnoImpl|).
- virtual ~ErrnoImpl() {}
-
- private:
- MOJO_DISALLOW_COPY_AND_ASSIGN(ErrnoImpl);
-};
-
-} // namespace mojio
-
-#endif // SERVICES_FILES_C_LIB_ERRNO_IMPL_H_
« no previous file with comments | « mojo/services/files/public/c/lib/directory_wrapper.cc ('k') | mojo/services/files/public/c/lib/fd_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698