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

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: Cleaned up AsyncContext interface. 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..4dc0576325f3a312704d787ac85bfc80baa14986 100644
--- a/net/base/file_stream_metrics.cc
+++ b/net/base/file_stream_metrics.cc
@@ -1,9 +1,10 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
#include "net/base/file_stream_metrics.h"
+#include "base/basictypes.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
@@ -11,6 +12,20 @@ namespace net {
namespace {
+const char* FileErrorSourceStrings[] = {
+ "OPEN",
+ "WRITE",
+ "READ",
+ "SEEK",
+ "FLUSH",
+ "SET_EOF",
+ "GET_SIZE"
+};
+
+COMPILE_ASSERT(ARRAYSIZE_UNSAFE(FileErrorSourceStrings) ==
+ FILE_ERROR_SOURCE_COUNT,
+ file_error_source_enum_has_changed);
+
void RecordFileErrorTypeCount(FileErrorSource source) {
UMA_HISTOGRAM_ENUMERATION(
"Net.FileErrorType_Counts", source, FILE_ERROR_SOURCE_COUNT);
@@ -78,4 +93,9 @@ void RecordFileError(int error, FileErrorSource source, bool record) {
}
}
+const char* GetFileErrorSourceName(FileErrorSource source) {
+ DCHECK_NE(FILE_ERROR_SOURCE_COUNT, source);
+ return FileErrorSourceStrings[source];
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698