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

Unified Diff: net/base/file_stream_metrics.h

Issue 7583049: Record UMA statistics for file_stream operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplified the UMA error statistics gathering. Created 9 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
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_

Powered by Google App Engine
This is Rietveld 408576698