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

Unified Diff: base/files/file.h

Issue 1127713004: Revert of Add granular base::File tracing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@do-initialize
Patch Set: Created 5 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 | « base/base.gypi ('k') | base/files/file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file.h
diff --git a/base/files/file.h b/base/files/file.h
index 589403d8dbf9efbd0dbc00a18278df9ea7e035a4..89077b41c1d8d03a9aa1e33ea822b9fb9454f807 100644
--- a/base/files/file.h
+++ b/base/files/file.h
@@ -18,7 +18,6 @@
#include "base/base_export.h"
#include "base/basictypes.h"
-#include "base/files/file_path.h"
#include "base/files/scoped_file.h"
#include "base/gtest_prod_util.h"
#include "base/move.h"
@@ -31,6 +30,8 @@
FORWARD_DECLARE_TEST(FileTest, MemoryCorruption);
namespace base {
+
+class FilePath;
#if defined(OS_WIN)
typedef HANDLE PlatformFile;
@@ -161,8 +162,8 @@
File();
// Creates or opens the given file. This will fail with 'access denied' if the
- // |path| contains path traversal ('..') components.
- File(const FilePath& path, uint32 flags);
+ // |name| contains path traversal ('..') components.
+ File(const FilePath& name, uint32 flags);
// Takes ownership of |platform_file|.
explicit File(PlatformFile platform_file);
@@ -179,7 +180,7 @@
File& operator=(RValue other);
// Creates or opens the given file.
- void Initialize(const FilePath& path, uint32 flags);
+ void Initialize(const FilePath& name, uint32 flags);
bool IsValid() const;
@@ -190,7 +191,7 @@
// Returns the OS result of opening this file. Note that the way to verify
// the success of the operation is to use IsValid(), not this method:
- // File file(path, flags);
+ // File file(name, flags);
// if (!file.IsValid())
// return;
Error error_details() const { return error_details_; }
@@ -304,8 +305,6 @@
private:
FRIEND_TEST_ALL_PREFIXES(::FileTest, MemoryCorruption);
- friend class ScopedFileTrace;
-
#if defined(OS_POSIX)
// Encloses a single ScopedFD, saving a cheap tamper resistent memory checksum
// alongside it. This checksum is validated at every access, allowing early
@@ -351,9 +350,9 @@
};
#endif
- // Creates or opens the given file. Only called if |path_| has no
- // traversal ('..') components.
- void DoInitialize(uint32 flags);
+ // Creates or opens the given file. Only called if |name| has no traversal
+ // ('..') components.
+ void DoInitialize(const FilePath& name, uint32 flags);
// TODO(tnagel): Reintegrate into Flush() once histogram isn't needed anymore,
// cf. issue 473337.
@@ -366,18 +365,6 @@
#elif defined(OS_POSIX)
MemoryCheckingScopedFD file_;
#endif
-
- // Path that |Initialize()| was called with. Only set if safe (i.e. no '..').
- FilePath path_;
-
- class TraceEnabler {
- public:
- TraceEnabler();
- ~TraceEnabler();
- };
-
- // Object tied to the lifetime of this File that enables/disables tracing.
- TraceEnabler trace_enabler_;
Error error_details_;
bool created_;
« no previous file with comments | « base/base.gypi ('k') | base/files/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698