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

Unified Diff: components/nacl/loader/nonsfi/irt_util.h

Issue 1409633002: Non-SFI mode: Remove old Non-SFI code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | « components/nacl/loader/nonsfi/irt_thread.cc ('k') | components/nacl/loader/nonsfi/nonsfi_listener.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/loader/nonsfi/irt_util.h
diff --git a/components/nacl/loader/nonsfi/irt_util.h b/components/nacl/loader/nonsfi/irt_util.h
deleted file mode 100644
index 81a8e9256665df51429b4e418a02873bb32f21d7..0000000000000000000000000000000000000000
--- a/components/nacl/loader/nonsfi/irt_util.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2014 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 COMPONENTS_NACL_LOADER_NONSFI_IRT_UTIL_H_
-#define COMPONENTS_NACL_LOADER_NONSFI_IRT_UTIL_H_
-
-#include <errno.h>
-
-namespace nacl {
-namespace nonsfi {
-
-// For IRT implementation, the following simple pattern is commonly used.
-//
-// if (syscall(...) < 0)
-// return errno;
-// return 0;
-//
-// This function is a utility to write it in a line as follows:
-//
-// return CheckError(syscall(...));
-inline int CheckError(int result) {
- return result < 0 ? errno : 0;
-}
-
-// For IRT implementation, another but a similar pattern is also commonly used.
-//
-// T result = syscall(...);
-// if (result < 0)
-// return errno;
-// *output = result;
-// return 0;
-//
-// This function is a utility to write it in a line as follows:
-//
-// retrun CheckErrorWithResult(syscall(...), output);
-//
-// Here, T1 must be a signed integer value, and T2 must be convertible from
-// T1.
-template<typename T1, typename T2>
-int CheckErrorWithResult(const T1& result, T2* out) {
- if (result < 0)
- return errno;
-
- *out = result;
- return 0;
-}
-
-} // namespace nonsfi
-} // namespace nacl
-
-#endif // COMPONENTS_NACL_LOADER_NONSFI_IRT_UTIL_H_
« no previous file with comments | « components/nacl/loader/nonsfi/irt_thread.cc ('k') | components/nacl/loader/nonsfi/nonsfi_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698