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

Unified Diff: storage/browser/database/vfs_backend.cc

Issue 1006423008: Add SetFileSize() IPC for WebSQL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary IPC_MESSAGE_HANDLER_DELAY_REPLYs, remove unnecessary scoped_refptrs. Created 5 years, 9 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 | « storage/browser/database/vfs_backend.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/database/vfs_backend.cc
diff --git a/storage/browser/database/vfs_backend.cc b/storage/browser/database/vfs_backend.cc
index 1f8c97bfc0022efd379adec80a8234f577394042..2cd0246daecdfa7853cb605f2400301b093171ba 100644
--- a/storage/browser/database/vfs_backend.cc
+++ b/storage/browser/database/vfs_backend.cc
@@ -155,4 +155,16 @@ int64 VfsBackend::GetFileSize(const base::FilePath& file_path) {
return (base::GetFileSize(file_path, &size) ? size : 0);
}
+// static
+bool VfsBackend::SetFileSize(const base::FilePath& file_path, int64 size) {
+ int flags = 0;
+ flags |= base::File::FLAG_READ;
+ flags |= base::File::FLAG_WRITE;
+ flags |= base::File::FLAG_OPEN;
+ base::File file = base::File(file_path, flags);
+ if (!file.IsValid())
+ return false;
+ return file.SetLength(size);
+}
+
} // namespace storage
« no previous file with comments | « storage/browser/database/vfs_backend.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698