Index: net/websockets/websocket_stream.cc |
diff --git a/net/websockets/websocket_stream.cc b/net/websockets/websocket_stream.cc |
index 9880ea800203e0fd48a9182da455476d8f3dc2f8..72e6482cc3b99c4d761ff79215c971ddc9116dad 100644 |
--- a/net/websockets/websocket_stream.cc |
+++ b/net/websockets/websocket_stream.cc |
@@ -7,6 +7,7 @@ |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/metrics/histogram.h" |
+#include "base/metrics/sparse_histogram.h" |
#include "net/base/load_flags.h" |
#include "net/http/http_request_headers.h" |
#include "net/http/http_status_code.h" |
@@ -178,14 +179,18 @@ class SSLErrorCallbacks : public WebSocketEventInterface::SSLErrorCallbacks { |
}; |
void Delegate::OnResponseStarted(URLRequest* request) { |
+ // All error codes, including OK and ABORTED, as with |
+ // Net.ErrorCodesForMainFrame3 |
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Net.WebSocket.ErrorCodes", |
+ -request->status().error()); |
if (!request->status().is_success()) { |
DVLOG(3) << "OnResponseStarted (request failed)"; |
owner_->ReportFailure(); |
return; |
} |
- DVLOG(3) << "OnResponseStarted (response code " << request->GetResponseCode() |
- << ")"; |
- switch (request->GetResponseCode()) { |
+ const int response_code = request->GetResponseCode(); |
+ DVLOG(3) << "OnResponseStarted (response code " << response_code << ")"; |
+ switch (response_code) { |
Alexei Svitkine (slow)
2014/06/18 16:50:41
Nit: Bad indent.
Adam Rice
2014/06/19 02:24:07
Done.
|
case HTTP_SWITCHING_PROTOCOLS: |
result_ = CONNECTED; |
owner_->PerformUpgrade(); |