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

Unified Diff: net/disk_cache/file_win.cc

Issue 15203004: Disk cache: Reference CL for the implementation of file format version 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: IndexTable review Created 7 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/disk_cache/file_lock.h ('k') | net/disk_cache/in_flight_backend_io.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/file_win.cc
===================================================================
--- net/disk_cache/file_win.cc (revision 199883)
+++ net/disk_cache/file_win.cc (working copy)
@@ -44,7 +44,6 @@
if (error) {
DCHECK(!actual_bytes);
actual_bytes = static_cast<DWORD>(net::ERR_CACHE_READ_FAILURE);
- NOTREACHED();
}
if (data->callback_)
@@ -67,7 +66,10 @@
namespace disk_cache {
File::File(base::PlatformFile file)
- : init_(true), mixed_(true), platform_file_(INVALID_HANDLE_VALUE),
+ : init_(true),
+ mixed_(true),
+ force_creation_(false),
+ platform_file_(INVALID_HANDLE_VALUE),
sync_platform_file_(file) {
}
@@ -78,8 +80,9 @@
DWORD sharing = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
DWORD access = GENERIC_READ | GENERIC_WRITE | DELETE;
+ DWORD mode = force_creation_ ? OPEN_ALWAYS : OPEN_EXISTING;
platform_file_ = CreateFile(name.value().c_str(), access, sharing, NULL,
- OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
+ mode, FILE_FLAG_OVERLAPPED, NULL);
if (INVALID_HANDLE_VALUE == platform_file_)
return false;
« no previous file with comments | « net/disk_cache/file_lock.h ('k') | net/disk_cache/in_flight_backend_io.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698