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

Unified Diff: base/files/file_posix.cc

Issue 1101723004: Revert "Intercept base::File Open/Close" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « base/files/file.cc ('k') | base/files/file_posix_hooks_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_posix.cc
diff --git a/base/files/file_posix.cc b/base/files/file_posix.cc
index dab9cc25704fcebd4aa7d200ea3ebe5024597adb..4c790571e8d6aeb732c6abfa038e51a7191edaa1 100644
--- a/base/files/file_posix.cc
+++ b/base/files/file_posix.cc
@@ -10,7 +10,6 @@
#include <unistd.h>
#include "base/files/file_path.h"
-#include "base/files/file_posix_hooks_internal.h"
#include "base/logging.h"
#include "base/metrics/sparse_histogram.h"
#include "base/posix/eintr_wrapper.h"
@@ -158,14 +157,6 @@ void File::Info::FromStat(const stat_wrapper_t& stat_info) {
Time::kNanosecondsPerMicrosecond);
}
-// Default implementations of Protect/Unprotect hooks defined as weak symbols
-// where possible.
-void ProtectFileDescriptor(int fd) {
-}
-
-void UnprotectFileDescriptor(int fd) {
-}
-
bool File::IsValid() const {
return file_.is_valid();
}
@@ -175,8 +166,6 @@ PlatformFile File::GetPlatformFile() const {
}
PlatformFile File::TakePlatformFile() {
- if (IsValid())
- UnprotectFileDescriptor(GetPlatformFile());
return file_.release();
}
@@ -185,7 +174,6 @@ void File::Close() {
return;
ThreadRestrictions::AssertIOAllowed();
- UnprotectFileDescriptor(GetPlatformFile());
file_.reset();
}
@@ -537,7 +525,6 @@ void File::DoInitialize(const FilePath& name, uint32 flags) {
async_ = ((flags & FLAG_ASYNC) == FLAG_ASYNC);
error_details_ = FILE_OK;
file_.reset(descriptor);
- ProtectFileDescriptor(descriptor);
}
#endif // !defined(OS_NACL)
@@ -555,10 +542,8 @@ bool File::DoFlush() {
}
void File::SetPlatformFile(PlatformFile file) {
- CHECK(!file_.is_valid());
+ DCHECK(!file_.is_valid());
file_.reset(file);
- if (file_.is_valid())
- ProtectFileDescriptor(GetPlatformFile());
}
} // namespace base
« no previous file with comments | « base/files/file.cc ('k') | base/files/file_posix_hooks_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698