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

Unified Diff: ppapi/native_client/src/trusted/plugin/temporary_file.cc

Issue 10823167: Revert "Add an IPC for PNaCl to check if the session is incognito," (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « ppapi/native_client/src/trusted/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: ppapi/native_client/src/trusted/plugin/temporary_file.cc
diff --git a/ppapi/native_client/src/trusted/plugin/temporary_file.cc b/ppapi/native_client/src/trusted/plugin/temporary_file.cc
index 7e84c47eb1d47b750635e9d15826bf90525760ff..4cdd04daee3558d5c978891ebda5bb02b889b497 100644
--- a/ppapi/native_client/src/trusted/plugin/temporary_file.cc
+++ b/ppapi/native_client/src/trusted/plugin/temporary_file.cc
@@ -69,31 +69,16 @@ void TempFile::Open(const pp::CompletionCallback& cb) {
return;
}
- // dup the fd to make allow making a non-Quota-based wrapper.
- // sel_ldr currently does not allow loading from Quota-backed descs,
- // only plain host descs. It's probably good hygiene to separate the
- // read wrapper from the write wrapper anyway.
- int32_t read_fd = DUP(fd);
- if (read_fd == NACL_NO_FILE_DESC) {
- PLUGIN_PRINTF(("TempFile::Open DUP failed\n"));
- core->CallOnMainThread(0, cb, PP_ERROR_FAILED);
- return;
- }
-
// The descriptor for a writeable file needs to have quota management.
- write_wrapper_.reset(
- plugin_->wrapper_factory()->MakeFileDescQuota(fd, O_RDWR, identifier_));
- read_wrapper_.reset(
- plugin_->wrapper_factory()->MakeFileDesc(fd, O_RDONLY));
+ wrapper_.reset(
+ plugin_->wrapper_factory()->MakeFileDescQuota(fd, O_RDWR, identifier_));
core->CallOnMainThread(0, cb, PP_OK);
}
bool TempFile::Reset() {
PLUGIN_PRINTF(("TempFile::Reset\n"));
- // Use the write_wrapper_ to reset the file pos. The read_wrapper_ is also
- // backed by the same file, so it should also reset.
- CHECK(write_wrapper_.get() != NULL);
- nacl_off64_t newpos = write_wrapper_->Seek(0, SEEK_SET);
+ CHECK(wrapper_.get() != NULL);
+ nacl_off64_t newpos = wrapper_->Seek(0, SEEK_SET);
return newpos >= 0;
}
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/temporary_file.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698