OLD | NEW |
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 Loading... |
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 |
OLD | NEW |