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

Unified Diff: chrome/browser/visitedlink/visitedlink_master.cc

Issue 10826297: Fix error checking in VisitedLinkMaster. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/visitedlink/visitedlink_master.cc
===================================================================
--- chrome/browser/visitedlink/visitedlink_master.cc (revision 151422)
+++ chrome/browser/visitedlink/visitedlink_master.cc (working copy)
@@ -94,21 +94,24 @@
// is used because file may still not be opened by the time of scheduling
// the task for execution.
void AsyncWrite(FILE** file, int32 offset, const std::string& data) {
- WriteToFile(*file, offset, data.data(), data.size());
+ if (*file)
+ WriteToFile(*file, offset, data.data(), data.size());
}
// Truncates the file to the current position asynchronously on a background
// thread. Double pointer to FILE is used because file may still not be opened
// by the time of scheduling the task for execution.
void AsyncTruncate(FILE** file) {
- base::IgnoreResult(TruncateFile(*file));
+ if (*file)
+ base::IgnoreResult(TruncateFile(*file));
}
// Closes the file on a background thread and releases memory used for storage
// of FILE* value. Double pointer to FILE is used because file may still not
// be opened by the time of scheduling the task for execution.
void AsyncClose(FILE** file) {
- base::IgnoreResult(fclose(*file));
+ if (*file)
+ base::IgnoreResult(fclose(*file));
free(file);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698