Index: base/file_util_win.cc |
diff --git a/base/file_util_win.cc b/base/file_util_win.cc |
index e7aadc218c4a765ad921f70e0b47f7aa71296328..4dbcb6d5eeb3148ac606a89552bf2fafc19b61d8 100644 |
--- a/base/file_util_win.cc |
+++ b/base/file_util_win.cc |
@@ -599,23 +599,8 @@ int ReadFile(const FilePath& filename, char* data, int size) { |
return -1; |
} |
-} // namespace base |
- |
-// ----------------------------------------------------------------------------- |
- |
-namespace file_util { |
- |
-using base::DirectoryExists; |
-using base::FilePath; |
-using base::kFileShareAll; |
- |
-FILE* OpenFile(const std::string& filename, const char* mode) { |
- base::ThreadRestrictions::AssertIOAllowed(); |
- return _fsopen(filename.c_str(), mode, _SH_DENYNO); |
-} |
- |
int WriteFile(const FilePath& filename, const char* data, int size) { |
- base::ThreadRestrictions::AssertIOAllowed(); |
+ ThreadRestrictions::AssertIOAllowed(); |
base::win::ScopedHandle file(CreateFile(filename.value().c_str(), |
GENERIC_WRITE, |
0, |
@@ -646,6 +631,21 @@ int WriteFile(const FilePath& filename, const char* data, int size) { |
return -1; |
} |
+} // namespace base |
+ |
+// ----------------------------------------------------------------------------- |
+ |
+namespace file_util { |
+ |
+using base::DirectoryExists; |
+using base::FilePath; |
+using base::kFileShareAll; |
+ |
+FILE* OpenFile(const std::string& filename, const char* mode) { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
+ return _fsopen(filename.c_str(), mode, _SH_DENYNO); |
+} |
+ |
int AppendToFile(const FilePath& filename, const char* data, int size) { |
base::ThreadRestrictions::AssertIOAllowed(); |
base::win::ScopedHandle file(CreateFile(filename.value().c_str(), |