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

Unified Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 423813002: Sdch view for net-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes. Lots. Created 6 years, 3 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: chrome/browser/ui/webui/net_internals/net_internals_ui.cc
diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
index 5c65c2d9ab71409d08216e723a5054bbea0f69dc..7375be5fd99c275d7065ce20941b6a7a5eda8562 100644
--- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
+++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
@@ -57,6 +57,7 @@
#include "net/base/net_errors.h"
#include "net/base/net_log_logger.h"
#include "net/base/net_util.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"
@@ -404,6 +405,7 @@ class NetInternalsMessageHandler::IOThreadImpl
void OnGetSpdyStatus(const base::ListValue* list);
void OnGetSpdyAlternateProtocolMappings(const base::ListValue* list);
void OnGetQuicInfo(const base::ListValue* list);
+ void OnGetSdchInfo(const base::ListValue* list);
#if defined(OS_WIN)
void OnGetServiceProviders(const base::ListValue* list);
#endif
@@ -611,6 +613,10 @@ void NetInternalsMessageHandler::RegisterMessages() {
"getQuicInfo",
base::Bind(&IOThreadImpl::CallbackHelper,
&IOThreadImpl::OnGetQuicInfo, proxy_));
+ web_ui()->RegisterMessageCallback(
+ "getSdchInfo",
+ base::Bind(
+ &IOThreadImpl::CallbackHelper, &IOThreadImpl::OnGetSdchInfo, proxy_));
#if defined(OS_WIN)
web_ui()->RegisterMessageCallback(
"getServiceProviders",
@@ -1352,6 +1358,16 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetQuicInfo(
SendJavascriptCommand("receivedQuicInfo", quic_info);
}
+void NetInternalsMessageHandler::IOThreadImpl::OnGetSdchInfo(
+ const base::ListValue* list) {
+ DCHECK(!list);
+ net::SdchManager* sdch_manager = GetMainContext()->sdch_manager();
+
+ base::Value* sdch_info =
+ sdch_manager ? sdch_manager->SdchInfoToValue() : NULL;
+ SendJavascriptCommand("receivedSdchInfo", sdch_info);
+}
+
#if defined(OS_WIN)
void NetInternalsMessageHandler::IOThreadImpl::OnGetServiceProviders(
const base::ListValue* list) {

Powered by Google App Engine
This is Rietveld 408576698