Index: base/files/file_win.cc |
diff --git a/base/files/file_win.cc b/base/files/file_win.cc |
index 94f4d7f59c9431b073619ec71b37a1de780799fe..fab7a393ab01eb411b8d6720e65df8d64b582e93 100644 |
--- a/base/files/file_win.cc |
+++ b/base/files/file_win.cc |
@@ -13,7 +13,7 @@ |
namespace base { |
-void File::CreateBaseFileUnsafe(const FilePath& name, uint32 flags) { |
+void File::InitializeUnsafe(const FilePath& name, uint32 flags) { |
base::ThreadRestrictions::AssertIOAllowed(); |
DCHECK(!IsValid()); |
@@ -197,7 +197,17 @@ int File::WriteAtCurrentPosNoBestEffort(const char* data, int size) { |
return WriteAtCurrentPos(data, size); |
} |
-bool File::Truncate(int64 length) { |
+int64 File::GetLength() { |
+ base::ThreadRestrictions::AssertIOAllowed(); |
+ DCHECK(IsValid()); |
+ LARGE_INTEGER size; |
+ if (!::GetFileSizeEx(file_.Get(), &size)) |
+ return -1; |
+ |
+ return static_cast<int64>(size.QuadPart); |
+} |
+ |
+bool File::SetLength(int64 length) { |
base::ThreadRestrictions::AssertIOAllowed(); |
DCHECK(IsValid()); |