Chromium Code Reviews| 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 // This file defines FileStream, a basic interface for reading and writing files | 5 // This file defines FileStream, a basic interface for reading and writing files |
| 6 // synchronously or asynchronously with support for seeking to an offset. | 6 // synchronously or asynchronously with support for seeking to an offset. |
| 7 // Note that even when used asynchronously, only one operation is supported at | 7 // Note that even when used asynchronously, only one operation is supported at |
| 8 // a time. | 8 // a time. |
| 9 | 9 |
| 10 #ifndef NET_BASE_FILE_STREAM_H_ | 10 #ifndef NET_BASE_FILE_STREAM_H_ |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 // Forces out a filesystem sync on this file to make sure that the file was | 125 // Forces out a filesystem sync on this file to make sure that the file was |
| 126 // written out to disk and is not currently sitting in the buffer. This does | 126 // written out to disk and is not currently sitting in the buffer. This does |
| 127 // not have to be called, it just forces one to happen at the time of | 127 // not have to be called, it just forces one to happen at the time of |
| 128 // calling. | 128 // calling. |
| 129 // | 129 // |
| 130 /// Returns an error code if the operation could not be performed. | 130 /// Returns an error code if the operation could not be performed. |
| 131 // | 131 // |
| 132 // This method should not be called if the stream was opened READ_ONLY. | 132 // This method should not be called if the stream was opened READ_ONLY. |
| 133 int Flush(); | 133 int Flush(); |
| 134 | 134 |
| 135 // Turns on UMA error statistics gathering. | |
| 136 void EnableRecording(); | |
|
cbentzel
2011/08/16 13:36:02
Nit: EnableErrorRecording? or EnableErrorReporting
ahendrickson
2011/08/17 20:12:04
EnableErrorStatistics.
| |
| 137 | |
| 135 private: | 138 private: |
| 136 class AsyncContext; | 139 class AsyncContext; |
| 137 friend class AsyncContext; | 140 friend class AsyncContext; |
| 138 | 141 |
| 139 // This member is used to support asynchronous reads. It is non-null when | 142 // This member is used to support asynchronous reads. It is non-null when |
| 140 // the FileStream was opened with PLATFORM_FILE_ASYNC. | 143 // the FileStream was opened with PLATFORM_FILE_ASYNC. |
| 141 scoped_ptr<AsyncContext> async_context_; | 144 scoped_ptr<AsyncContext> async_context_; |
| 142 | 145 |
| 143 base::PlatformFile file_; | 146 base::PlatformFile file_; |
| 144 int open_flags_; | 147 int open_flags_; |
| 145 bool auto_closed_; | 148 bool auto_closed_; |
| 149 bool record_uma_; | |
| 146 | 150 |
| 147 DISALLOW_COPY_AND_ASSIGN(FileStream); | 151 DISALLOW_COPY_AND_ASSIGN(FileStream); |
| 148 }; | 152 }; |
| 149 | 153 |
| 150 } // namespace net | 154 } // namespace net |
| 151 | 155 |
| 152 #endif // NET_BASE_FILE_STREAM_H_ | 156 #endif // NET_BASE_FILE_STREAM_H_ |
| OLD | NEW |