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

Unified Diff: net/base/net_log_util.cc

Issue 423813002: Sdch view for net-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix component linkage Created 6 years, 1 month 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 | « net/base/net_log_event_type_list.h ('k') | net/base/sdch_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_log_util.cc
diff --git a/net/base/net_log_util.cc b/net/base/net_log_util.cc
index b8816bad919441a12428d49f79ffb19ddb6027bc..a15e8998c4c86a583c6f637c768c1e86cd75f683 100644
--- a/net/base/net_log_util.cc
+++ b/net/base/net_log_util.cc
@@ -15,6 +15,7 @@
#include "net/base/load_states.h"
#include "net/base/net_errors.h"
#include "net/base/net_log.h"
+#include "net/base/sdch_manager.h"
#include "net/disk_cache/disk_cache.h"
#include "net/dns/host_cache.h"
#include "net/dns/host_resolver.h"
@@ -66,6 +67,14 @@ const short kNetErrors[] = {
#undef NET_ERROR
};
+const StringToConstant kSdchProblems[] = {
+#define SDCH_PROBLEM_CODE(label, value) \
+ { #label, value } \
+ ,
+#include "net/base/sdch_problem_code_list.h"
+#undef SDCH_PROBLEM_CODE
+};
+
const char* NetInfoSourceToString(NetInfoSource source) {
switch (source) {
#define NET_INFO_SOURCE(label, string, value) \
@@ -187,6 +196,17 @@ scoped_ptr<base::DictionaryValue> GetNetConstants() {
constants_dict->Set("quicRstStreamError", dict);
}
+ // Add information on the relationship between SDCH problem codes and their
+ // symbolic names.
+ {
+ base::DictionaryValue* dict = new base::DictionaryValue();
+
+ for (size_t i = 0; i < arraysize(kSdchProblems); i++)
+ dict->SetInteger(kSdchProblems[i].name, kSdchProblems[i].constant);
+
+ constants_dict->Set("sdchProblemCode", dict);
+ }
+
// Information about the relationship between event phase enums and their
// symbolic names.
{
@@ -455,6 +475,17 @@ NET_EXPORT scoped_ptr<base::DictionaryValue> GetNetInfo(
info_dict);
}
+ if (info_sources & NET_INFO_SDCH) {
+ base::Value* info_dict;
+ SdchManager* sdch_manager = context->sdch_manager();
+ if (sdch_manager) {
+ info_dict = sdch_manager->SdchInfoToValue();
+ } else {
+ info_dict = new base::DictionaryValue();
+ }
+ net_info_dict->Set(NetInfoSourceToString(NET_INFO_SDCH), info_dict);
+ }
+
return net_info_dict.Pass();
}
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/base/sdch_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698