summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_impl.cc
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-03 17:18:14 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-03 17:18:14 +0000
commit21da6eb1f8a9740de03cb1435bf935f5a3609a37 (patch)
tree47e6bdd8db72ee4b66f526bbe79cbca74ef85560 /net/disk_cache/backend_impl.cc
parent0a173a23af355f6b4eceeb18f28b453063e4287c (diff)
downloadchromium_src-21da6eb1f8a9740de03cb1435bf935f5a3609a37.zip
chromium_src-21da6eb1f8a9740de03cb1435bf935f5a3609a37.tar.gz
chromium_src-21da6eb1f8a9740de03cb1435bf935f5a3609a37.tar.bz2
* Add write and read/write support to FileStream (renamed from FileInputStream).
* Moved net/disk_cache/os_file to base/platform_file. Review URL: http://codereview.chromium.org/8843 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_impl.cc')
-rw-r--r--net/disk_cache/backend_impl.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index da11f98..20e6348 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -550,9 +550,12 @@ bool BackendImpl::CreateExternalFile(Addr* address) {
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 @@ bool BackendImpl::InitBackingStore(bool* file_created) {
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;