summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/mapped_file_win.cc
diff options
context:
space:
mode:
authorhusky@chromium.org <husky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-26 13:38:02 +0000
committerhusky@chromium.org <husky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-26 13:38:02 +0000
commit9e079cb3fc680c2d6eb45ed2c073cbf9a95ff64e (patch)
tree78ad4516274b6c626fe4c5628b7034b47d11fef2 /net/disk_cache/mapped_file_win.cc
parent470cc4c60b55fc95f3638ff7b4c443300c60dfdd (diff)
downloadchromium_src-9e079cb3fc680c2d6eb45ed2c073cbf9a95ff64e.zip
chromium_src-9e079cb3fc680c2d6eb45ed2c073cbf9a95ff64e.tar.gz
chromium_src-9e079cb3fc680c2d6eb45ed2c073cbf9a95ff64e.tar.bz2
Optionally disable mmap() in the disk cache.
The disk cache mmaps the headers of certain important files (the main index file, plus block files). Unfortunately on some Android devices mmap performs badly on flash storage, and it's actually better to write the data manually. This patch adds the macro USE_MMAP_FOR_DISK_CACHE macro and the method disk_cache::MappedFile::FlushHeader(). By default, the macro is defined, the new method is a no-op, and there's no change in behavior. TEST=DiskCacheTest BUG= Review URL: https://chromiumcodereview.appspot.com/10573032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144166 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/mapped_file_win.cc')
-rw-r--r--net/disk_cache/mapped_file_win.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/disk_cache/mapped_file_win.cc b/net/disk_cache/mapped_file_win.cc
index 9931e3e..f7575ef 100644
--- a/net/disk_cache/mapped_file_win.cc
+++ b/net/disk_cache/mapped_file_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -59,4 +59,7 @@ bool MappedFile::Store(const FileBlock* block) {
return Write(block->buffer(), block->size(), offset);
}
+void MappedFile::Flush() {
+}
+
} // namespace disk_cache