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

Unified Diff: components/nacl/renderer/plugin/temporary_file.cc

Issue 1575573002: PNaCl: Remove now-unneeded use of nacl::DescWrapper in TempFile (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 4 years, 11 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/renderer/plugin/temporary_file.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/plugin/temporary_file.cc
diff --git a/components/nacl/renderer/plugin/temporary_file.cc b/components/nacl/renderer/plugin/temporary_file.cc
index 579352d58f7c24b90d762913efb495f786aeb925..ad79862e63608b8de8e10a8c82cf43dedc7b8c49 100644
--- a/components/nacl/renderer/plugin/temporary_file.cc
+++ b/components/nacl/renderer/plugin/temporary_file.cc
@@ -8,8 +8,6 @@
#include "build/build_config.h"
#include "components/nacl/renderer/plugin/plugin.h"
#include "components/nacl/renderer/plugin/utility.h"
-#include "native_client/src/include/portability_io.h"
-#include "native_client/src/trusted/service_runtime/include/sys/stat.h"
#include "ppapi/c/private/pp_file_handle.h"
#include "ppapi/cpp/core.h"
#include "ppapi/cpp/instance.h"
@@ -23,33 +21,9 @@ TempFile::TempFile(Plugin* plugin, PP_FileHandle handle)
TempFile::~TempFile() { }
-nacl::DescWrapper* TempFile::MakeDescWrapper(int nacl_file_flags) {
- base::File file_dup = file_handle_.Duplicate();
- if (!file_dup.IsValid())
- return NULL;
-#if defined(OS_WIN)
- int fd = _open_osfhandle(
- reinterpret_cast<intptr_t>(file_dup.TakePlatformFile()),
- _O_RDWR | _O_BINARY | _O_TEMPORARY | _O_SHORT_LIVED);
- if (fd < 0)
- return NULL;
-#else
- int fd = file_dup.TakePlatformFile();
-#endif
- return plugin_->wrapper_factory()->MakeFileDesc(fd, nacl_file_flags);
-}
-
-int32_t TempFile::Open(bool writeable) {
- read_wrapper_.reset(MakeDescWrapper(O_RDONLY));
- if (!read_wrapper_)
+int32_t TempFile::CheckValidity() {
+ if (!file_handle_.IsValid())
return PP_ERROR_FAILED;
-
- if (writeable) {
- write_wrapper_.reset(MakeDescWrapper(O_RDWR));
- if (!write_wrapper_)
- return PP_ERROR_FAILED;
- }
-
return PP_OK;
bbudge 2016/01/08 21:37:06 nit: you can simplify this a bit by using PP_FromB
Mark Seaborn 2016/01/08 22:02:27 Doesn't that convert to a PP_Bool rather than to a
}
« no previous file with comments | « components/nacl/renderer/plugin/temporary_file.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698