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

Unified Diff: base/files/file.cc

Issue 676873004: Intercept file Open/Close (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month 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/base.gyp ('k') | base/files/file_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file.cc
diff --git a/base/files/file.cc b/base/files/file.cc
index ea8dbf27ac1770d88fc6ce933a4bdd331820d2d9..a997074bec4003b2474287d33785d844a354addb 100644
--- a/base/files/file.cc
+++ b/base/files/file.cc
@@ -5,6 +5,10 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
+#if defined(OS_POSIX)
+#include "base/files/file_posix_hooks_internal.h"
+#endif
+
namespace base {
File::Info::Info()
@@ -38,6 +42,8 @@ File::File(PlatformFile platform_file)
async_(false) {
#if defined(OS_POSIX)
DCHECK_GE(platform_file, -1);
+ if (IsValid())
+ ProtectFileDescriptor(platform_file);
#endif
}
@@ -52,6 +58,10 @@ File::File(RValue other)
error_details_(other.object->error_details()),
created_(other.object->created()),
async_(other.object->async_) {
+#if defined(OS_POSIX)
+ if (IsValid())
+ ProtectFileDescriptor(GetPlatformFile());
+#endif
}
File::~File() {
« no previous file with comments | « base/base.gyp ('k') | base/files/file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698