OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/net_internals_ui.h" | 5 #include "chrome/browser/dom_ui/net_internals_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <sstream> | 8 #include <sstream> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 | 748 |
749 CallJavascriptFunction(L"g_browser.receivedPassiveLogEntries", list); | 749 CallJavascriptFunction(L"g_browser.receivedPassiveLogEntries", list); |
750 } | 750 } |
751 | 751 |
752 void NetInternalsMessageHandler::IOThreadImpl::OnStartConnectionTests( | 752 void NetInternalsMessageHandler::IOThreadImpl::OnStartConnectionTests( |
753 const Value* value) { | 753 const Value* value) { |
754 // |value| should be: [<URL to test>]. | 754 // |value| should be: [<URL to test>]. |
755 string16 url_str; | 755 string16 url_str; |
756 if (value && value->GetType() == Value::TYPE_LIST) { | 756 if (value && value->GetType() == Value::TYPE_LIST) { |
757 const ListValue* list = static_cast<const ListValue*>(value); | 757 const ListValue* list = static_cast<const ListValue*>(value); |
758 list->GetStringAsUTF16(0, &url_str); | 758 list->GetString(0, &url_str); |
759 } | 759 } |
760 | 760 |
761 // Try to fix-up the user provided URL into something valid. | 761 // Try to fix-up the user provided URL into something valid. |
762 // For example, turn "www.google.com" into "http://www.google.com". | 762 // For example, turn "www.google.com" into "http://www.google.com". |
763 GURL url(URLFixerUpper::FixupURL(UTF16ToUTF8(url_str), std::string())); | 763 GURL url(URLFixerUpper::FixupURL(UTF16ToUTF8(url_str), std::string())); |
764 | 764 |
765 connection_tester_.reset(new ConnectionTester(this)); | 765 connection_tester_.reset(new ConnectionTester(this)); |
766 connection_tester_->RunAllTests(url); | 766 connection_tester_->RunAllTests(url); |
767 } | 767 } |
768 | 768 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); | 884 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); |
885 | 885 |
886 // Set up the chrome://net-internals/ source. | 886 // Set up the chrome://net-internals/ source. |
887 ChromeThread::PostTask( | 887 ChromeThread::PostTask( |
888 ChromeThread::IO, FROM_HERE, | 888 ChromeThread::IO, FROM_HERE, |
889 NewRunnableMethod( | 889 NewRunnableMethod( |
890 Singleton<ChromeURLDataManager>::get(), | 890 Singleton<ChromeURLDataManager>::get(), |
891 &ChromeURLDataManager::AddDataSource, | 891 &ChromeURLDataManager::AddDataSource, |
892 make_scoped_refptr(html_source))); | 892 make_scoped_refptr(html_source))); |
893 } | 893 } |
OLD | NEW |