Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 698 // If currently watching the NetLog, temporarily stop watching it and flush | 698 // If currently watching the NetLog, temporarily stop watching it and flush |
| 699 // pending events, so they won't appear before the status events created for | 699 // pending events, so they won't appear before the status events created for |
| 700 // currently active network objects below. | 700 // currently active network objects below. |
| 701 if (net_log()) { | 701 if (net_log()) { |
| 702 net_log()->RemoveThreadSafeObserver(this); | 702 net_log()->RemoveThreadSafeObserver(this); |
| 703 PostPendingEntries(); | 703 PostPendingEntries(); |
| 704 } | 704 } |
| 705 | 705 |
| 706 SendJavascriptCommand("receivedConstants", NetInternalsUI::GetConstants()); | 706 SendJavascriptCommand("receivedConstants", NetInternalsUI::GetConstants()); |
| 707 | 707 |
| 708 #if !defined(OS_ANDROID) | |
|
mmenke
2015/01/30 15:49:44
Please add a TODO(mmenke) with link to the bug, an
jeremyim
2015/01/30 16:23:00
Done.
| |
| 708 PrePopulateEventList(); | 709 PrePopulateEventList(); |
| 710 #endif | |
| 709 | 711 |
| 710 // Register with network stack to observe events. | 712 // Register with network stack to observe events. |
| 711 io_thread_->net_log()->AddThreadSafeObserver(this, | 713 io_thread_->net_log()->AddThreadSafeObserver(this, |
| 712 net::NetLog::LOG_ALL_BUT_BYTES); | 714 net::NetLog::LOG_ALL_BUT_BYTES); |
| 713 } | 715 } |
| 714 | 716 |
| 715 void NetInternalsMessageHandler::IOThreadImpl::OnGetNetInfo( | 717 void NetInternalsMessageHandler::IOThreadImpl::OnGetNetInfo( |
| 716 const base::ListValue* list) { | 718 const base::ListValue* list) { |
| 717 DCHECK(list); | 719 DCHECK(list); |
| 718 int info_sources; | 720 int info_sources; |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1275 } | 1277 } |
| 1276 | 1278 |
| 1277 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1279 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
| 1278 : WebUIController(web_ui) { | 1280 : WebUIController(web_ui) { |
| 1279 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1281 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
| 1280 | 1282 |
| 1281 // Set up the chrome://net-internals/ source. | 1283 // Set up the chrome://net-internals/ source. |
| 1282 Profile* profile = Profile::FromWebUI(web_ui); | 1284 Profile* profile = Profile::FromWebUI(web_ui); |
| 1283 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1285 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
| 1284 } | 1286 } |
| OLD | NEW |