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

Unified Diff: base/file_util.cc

Issue 2096005: page cycler: Use buffer-cache priming code on all systems. (Closed)
Patch Set: simpler Created 10 years, 7 months 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 | « base/file_util.h ('k') | chrome/test/page_cycler/page_cycler_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.cc
diff --git a/base/file_util.cc b/base/file_util.cc
index 79921ff3fc1a1839a378bb76eec16276e12ff72e..5bc73cef08161eb9576dfad8aa73c2dad000196a 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)
jorlow 2010/05/19 10:41:50 This feels dirty to me. I understand what you're
Mark Mentovai 2010/05/19 14:00:27 This does not feel dirty to me at all.
+ contents->append(buf, len);
}
CloseFile(file);
« no previous file with comments | « base/file_util.h ('k') | chrome/test/page_cycler/page_cycler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698