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

Unified Diff: net/base/file_stream_metrics.cc

Issue 9288084: Added Net logging to FileStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarified comments Created 8 years, 11 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.cc
diff --git a/net/base/file_stream_metrics.cc b/net/base/file_stream_metrics.cc
index 7ffa96d66d6a6c1131f2a8aa5f1b325cfe0347ab..a167d6d90bc33f1687134dead8128d36748c3330 100644
--- a/net/base/file_stream_metrics.cc
+++ b/net/base/file_stream_metrics.cc
@@ -4,6 +4,7 @@
#include "net/base/file_stream_metrics.h"
+#include "base/basictypes.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
@@ -11,6 +12,21 @@ namespace net {
namespace {
+const char* FileErrorSourceStrings[] = {
+ "OPEN",
+ "WRITE",
+ "READ",
+ "SEEK",
+ "FLUSH",
+ "SET_EOF",
+ "GET_SIZE",
+ "COUNT",
+};
+
+COMPILE_ASSERT(ARRAYSIZE_UNSAFE(FileErrorSourceStrings) ==
+ FILE_ERROR_SOURCE_COUNT + 1,
+ file_error_source_enum_has_changed);
+
void RecordFileErrorTypeCount(FileErrorSource source) {
UMA_HISTOGRAM_ENUMERATION(
"Net.FileErrorType_Counts", source, FILE_ERROR_SOURCE_COUNT);
@@ -78,4 +94,8 @@ void RecordFileError(int error, FileErrorSource source, bool record) {
}
}
+const char* GetFileErrorSourceName(FileErrorSource source) {
+ return FileErrorSourceStrings[source];
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698