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 // TODO(mmenke) DCHECK in CreateNetLogEntriesForActiveObjects in |
| 709 // net_log_util.cc fails on Android (https://www.crbug.com/453088) |
| 710 #if !defined(OS_ANDROID) |
708 PrePopulateEventList(); | 711 PrePopulateEventList(); |
| 712 #endif |
709 | 713 |
710 // Register with network stack to observe events. | 714 // Register with network stack to observe events. |
711 io_thread_->net_log()->AddThreadSafeObserver(this, | 715 io_thread_->net_log()->AddThreadSafeObserver(this, |
712 net::NetLog::LOG_ALL_BUT_BYTES); | 716 net::NetLog::LOG_ALL_BUT_BYTES); |
713 } | 717 } |
714 | 718 |
715 void NetInternalsMessageHandler::IOThreadImpl::OnGetNetInfo( | 719 void NetInternalsMessageHandler::IOThreadImpl::OnGetNetInfo( |
716 const base::ListValue* list) { | 720 const base::ListValue* list) { |
717 DCHECK(list); | 721 DCHECK(list); |
718 int info_sources; | 722 int info_sources; |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 } | 1279 } |
1276 | 1280 |
1277 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1281 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
1278 : WebUIController(web_ui) { | 1282 : WebUIController(web_ui) { |
1279 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1283 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
1280 | 1284 |
1281 // Set up the chrome://net-internals/ source. | 1285 // Set up the chrome://net-internals/ source. |
1282 Profile* profile = Profile::FromWebUI(web_ui); | 1286 Profile* profile = Profile::FromWebUI(web_ui); |
1283 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); | 1287 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); |
1284 } | 1288 } |
OLD | NEW |