summaryrefslogtreecommitdiffstats
path: root/base/file_util.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-19 11:07:55 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-19 11:07:55 +0000
commit4e074bae766e9e560da4227468689508b9cd96eb (patch)
tree60fe030b9e106b10e16b829097f06d9fb47225cd /base/file_util.cc
parenta841c35f2c3ca42558c76ff48ac4ae61f907d63e (diff)
downloadchromium_src-4e074bae766e9e560da4227468689508b9cd96eb.zip
chromium_src-4e074bae766e9e560da4227468689508b9cd96eb.tar.gz
chromium_src-4e074bae766e9e560da4227468689508b9cd96eb.tar.bz2
page cycler: Use buffer-cache priming code on all systems.
I noticed that the first time I run the page cycler the test numbers are worse, probably because the test pages are not in cache. We already have this code on Mac and I don't see why it shouldn't apply to all systems. Review URL: http://codereview.chromium.org/2096005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util.cc')
-rw-r--r--base/file_util.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/base/file_util.cc b/base/file_util.cc
index 79921ff..5bc73ce 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -186,7 +186,8 @@ bool ReadFileToString(const FilePath& path, std::string* contents) {
char buf[1 << 16];
size_t len;
while ((len = fread(buf, 1, sizeof(buf), file)) > 0) {
- contents->append(buf, len);
+ if (contents)
+ contents->append(buf, len);
}
CloseFile(file);