Chromium Code Reviews| Index: net/base/file_stream_metrics.h |
| diff --git a/net/base/file_stream_metrics.h b/net/base/file_stream_metrics.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7c3faa333b240f2010bdb8e197f2b0c43d566c5c |
| --- /dev/null |
| +++ b/net/base/file_stream_metrics.h |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// This file defines FileStream, a basic interface for reading and writing files |
|
cbentzel
2011/08/16 13:36:02
This comment is wrong.
|
| +// synchronously or asynchronously with support for seeking to an offset. |
| +// Note that even when used asynchronously, only one operation is supported at |
| +// a time. |
| + |
| +#ifndef NET_BASE_FILE_STREAM_METRICS_H_ |
| +#define NET_BASE_FILE_STREAM_METRICS_H_ |
| +#pragma once |
| + |
| +namespace net { |
| + |
| +enum FileErrorSource { |
| + FILE_ERROR_SOURCE_IS_NOT_OPEN = 0, |
| + FILE_ERROR_SOURCE_OPEN, |
| + FILE_ERROR_SOURCE_WRITE, |
| + FILE_ERROR_SOURCE_READ, |
| + FILE_ERROR_SOURCE_SEEK, |
| + FILE_ERROR_SOURCE_FLUSH, |
| + FILE_ERROR_SOURCE_SET_EOF, |
| + FILE_ERROR_SOURCE_GET_SIZE, |
| + FILE_ERROR_SOURCE_COUNT, |
| +}; |
| + |
| +// UMA error statistics gathering. |
| +int ReduceErrorRange(int error); |
| +int MaxError(); |
| +void RecordFileError(int error, FileErrorSource type); |
|
cbentzel
2011/08/16 13:36:02
After seeing this be used, may be easier to change
cbentzel
2011/08/16 13:36:02
In Win, this is actually a DWORD for error. DWORD
ahendrickson
2011/08/17 20:12:04
Done.
ahendrickson
2011/08/17 20:12:04
On Win, I mask out the 16 high bits anyway, so it
|
| + |
| +} // namespace net |
| + |
| +#endif // NET_BASE_FILE_STREAM_METRICS_H_ |