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

Side by Side Diff: base/files/file.cc

Issue 2171833002: Add some words of caution to File::Flush(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mark histogram as obsolete instead of removing it. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « base/files/file.h ('k') | base/files/file_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/files/file.h" 5 #include "base/files/file.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/files/file_tracing.h" 7 #include "base/files/file_tracing.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/timer/elapsed_timer.h" 9 #include "base/timer/elapsed_timer.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 case FILE_ERROR_IO: 131 case FILE_ERROR_IO:
132 return "FILE_ERROR_IO"; 132 return "FILE_ERROR_IO";
133 case FILE_ERROR_MAX: 133 case FILE_ERROR_MAX:
134 break; 134 break;
135 } 135 }
136 136
137 NOTREACHED(); 137 NOTREACHED();
138 return ""; 138 return "";
139 } 139 }
140 140
141 bool File::Flush() {
142 ElapsedTimer timer;
143 SCOPED_FILE_TRACE("Flush");
144 bool return_value = DoFlush();
145 UMA_HISTOGRAM_TIMES("PlatformFile.FlushTime", timer.Elapsed());
146 return return_value;
147 }
148
149 } // namespace base 141 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file.h ('k') | base/files/file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698