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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 8843: Add write and read/write support to FileStream (renamed from FileInputStream)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | « net/build/net_unittests.vcproj ('k') | net/disk_cache/block_files.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_impl.cc
===================================================================
--- net/disk_cache/backend_impl.cc (revision 4450)
+++ net/disk_cache/backend_impl.cc (working copy)
@@ -550,9 +550,12 @@
continue;
}
std::wstring name = GetFileName(file_address);
- scoped_refptr<disk_cache::File> file(
- new disk_cache::File(CreateOSFile(name.c_str(), OS_FILE_READ |
- OS_FILE_WRITE |OS_FILE_SHARE_READ | OS_FILE_CREATE, NULL)));
+ int flags = base::PLATFORM_FILE_READ |
+ base::PLATFORM_FILE_WRITE |
+ base::PLATFORM_FILE_CREATE |
+ base::PLATFORM_FILE_EXCLUSIVE_WRITE;
+ scoped_refptr<disk_cache::File> file(new disk_cache::File(
+ base::CreatePlatformFile(name.c_str(), flags, NULL)));
if (!file->IsValid())
continue;
@@ -748,9 +751,12 @@
std::wstring index_name(path_);
file_util::AppendToPath(&index_name, kIndexName);
+ int flags = base::PLATFORM_FILE_READ |
+ base::PLATFORM_FILE_WRITE |
+ base::PLATFORM_FILE_OPEN_ALWAYS |
+ base::PLATFORM_FILE_EXCLUSIVE_WRITE;
scoped_refptr<disk_cache::File> file(new disk_cache::File(
- CreateOSFile(index_name.c_str(), OS_FILE_READ | OS_FILE_WRITE |
- OS_FILE_SHARE_READ | OS_FILE_OPEN_ALWAYS, file_created)));
+ base::CreatePlatformFile(index_name.c_str(), flags, file_created)));
if (!file->IsValid())
return false;
« no previous file with comments | « net/build/net_unittests.vcproj ('k') | net/disk_cache/block_files.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698