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

Unified Diff: net/websockets/websocket_stream.cc

Issue 2950343002: Break down Net.WebSocket.ErrorCodes by localhost (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_stream.cc
diff --git a/net/websockets/websocket_stream.cc b/net/websockets/websocket_stream.cc
index 7487ef4fd04cde7d1fb63f1aa2bdc9c26daf6887..aa65f0f69bfe1a982a6e43751b8fabc4653d9ceb 100644
--- a/net/websockets/websocket_stream.cc
+++ b/net/websockets/websocket_stream.cc
@@ -14,6 +14,7 @@
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "net/base/load_flags.h"
+#include "net/base/url_util.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
@@ -315,6 +316,14 @@ void Delegate::OnResponseStarted(URLRequest* request, int net_error) {
// All error codes, including OK and ABORTED, as with
// Net.ErrorCodesForMainFrame3
UMA_HISTOGRAM_SPARSE_SLOWLY("Net.WebSocket.ErrorCodes", -net_error);
+ if (net::IsLocalhost(request->url().HostNoBrackets())) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.WebSocket.ErrorCodes_Localhost",
+ -net_error);
+ } else {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.WebSocket.ErrorCodes_NotLocalhost",
+ -net_error);
+ }
+
if (net_error != OK) {
DVLOG(3) << "OnResponseStarted (request failed)";
owner_->ReportFailure(net_error);
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698