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

Unified Diff: ppapi/native_client/src/trusted/plugin/file_utils.h

Issue 15697019: Parametrize names of llc and ld nexes by reading them from the resource info JSON file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweak comments some more, following Jan's review Created 7 years, 7 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 | « no previous file | ppapi/native_client/src/trusted/plugin/file_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/file_utils.h
diff --git a/ppapi/native_client/src/trusted/plugin/file_utils.h b/ppapi/native_client/src/trusted/plugin/file_utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..223bf66edacecc93cfb54877a3073c819182d388
--- /dev/null
+++ b/ppapi/native_client/src/trusted/plugin/file_utils.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2013 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.
+
+// Some common file utilities for plugin code.
+
+#ifndef NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_FILE_UTILS_H_
+#define NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_FILE_UTILS_H_
+
+#include "native_client/src/include/nacl_string.h"
+#include "native_client/src/include/portability_io.h"
+#include "ppapi/c/pp_stdint.h"
+
+namespace plugin {
+namespace file_utils {
+
+enum StatusCode {
+ PLUGIN_FILE_SUCCESS = 0,
+ PLUGIN_FILE_ERROR_MEM_ALLOC = 1,
+ PLUGIN_FILE_ERROR_OPEN = 2,
+ PLUGIN_FILE_ERROR_FILE_TOO_LARGE = 3,
+ PLUGIN_FILE_ERROR_STAT = 4,
+ PLUGIN_FILE_ERROR_READ = 5
+};
+
+// Slurp the whole contents of the given file (|fd| - open file descriptor) into
+// |out_buf|. |max_size_to_read| is the maximal allowed size of the file.
+// If the file turns out to be larger, an error is returned. In any case,
+// |fd| is closed.
+StatusCode SlurpFile(int32_t fd,
+ nacl::string& out_buf,
+ size_t max_size_to_read = (1 << 20));
+
+} // namespace file_utils
+} // namespace plugin
+
+#endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_FILE_UTILS_H_
+
« no previous file with comments | « no previous file | ppapi/native_client/src/trusted/plugin/file_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698