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

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 17333003: Pretty-print QUIC CONNECTION_CLOSE and RST_STREAM error codes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix enum/int conversion problems. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" 5 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 DictionaryValue* dict = new DictionaryValue(); 1922 DictionaryValue* dict = new DictionaryValue();
1923 1923
1924 #define NET_ERROR(label, value) \ 1924 #define NET_ERROR(label, value) \
1925 dict->SetInteger(# label, static_cast<int>(value)); 1925 dict->SetInteger(# label, static_cast<int>(value));
1926 #include "net/base/net_error_list.h" 1926 #include "net/base/net_error_list.h"
1927 #undef NET_ERROR 1927 #undef NET_ERROR
1928 1928
1929 constants_dict->Set("netError", dict); 1929 constants_dict->Set("netError", dict);
1930 } 1930 }
1931 1931
1932 // Add information on the relationship between QUIC error codes and their
1933 // symbolic names.
1934 {
1935 DictionaryValue* dict = new DictionaryValue();
1936
1937 for (net::QuicErrorCode error = net::QUIC_NO_ERROR;
1938 error < net::QUIC_LAST_ERROR;
1939 error = static_cast<net::QuicErrorCode>(error + 1)) {
1940 dict->SetInteger(net::QuicUtils::ErrorToString(error),
1941 static_cast<int>(error));
1942 }
1943
1944 constants_dict->Set("quicError", dict);
1945 }
1946
1947 // Add information on the relationship between QUIC RST_STREAM error codes
1948 // and their symbolic names.
1949 {
1950 DictionaryValue* dict = new DictionaryValue();
1951
1952 for (net::QuicRstStreamErrorCode error = net::QUIC_STREAM_NO_ERROR;
1953 error < net::QUIC_STREAM_LAST_ERROR;
1954 error = static_cast<net::QuicRstStreamErrorCode>(error + 1)) {
1955 dict->SetInteger(net::QuicUtils::StreamErrorToString(error),
1956 static_cast<int>(error));
1957 }
1958
1959 constants_dict->Set("quicRstStreamError", dict);
1960 }
1961
1932 // Information about the relationship between event phase enums and their 1962 // Information about the relationship between event phase enums and their
1933 // symbolic names. 1963 // symbolic names.
1934 { 1964 {
1935 DictionaryValue* dict = new DictionaryValue(); 1965 DictionaryValue* dict = new DictionaryValue();
1936 1966
1937 dict->SetInteger("PHASE_BEGIN", net::NetLog::PHASE_BEGIN); 1967 dict->SetInteger("PHASE_BEGIN", net::NetLog::PHASE_BEGIN);
1938 dict->SetInteger("PHASE_END", net::NetLog::PHASE_END); 1968 dict->SetInteger("PHASE_END", net::NetLog::PHASE_END);
1939 dict->SetInteger("PHASE_NONE", net::NetLog::PHASE_NONE); 1969 dict->SetInteger("PHASE_NONE", net::NetLog::PHASE_NONE);
1940 1970
1941 constants_dict->Set("logEventPhase", dict); 1971 constants_dict->Set("logEventPhase", dict);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 } 2029 }
2000 2030
2001 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 2031 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
2002 : WebUIController(web_ui) { 2032 : WebUIController(web_ui) {
2003 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 2033 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
2004 2034
2005 // Set up the chrome://net-internals/ source. 2035 // Set up the chrome://net-internals/ source.
2006 Profile* profile = Profile::FromWebUI(web_ui); 2036 Profile* profile = Profile::FromWebUI(web_ui);
2007 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 2037 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
2008 } 2038 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/net_internals/main.js ('k') | chrome/test/data/webui/net_internals/log_view_painter.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698