| 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 <list> | 7 #include <list> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1658 #undef LOAD_FLAG | 1658 #undef LOAD_FLAG |
| 1659 | 1659 |
| 1660 constants_dict->Set("loadFlag", dict); | 1660 constants_dict->Set("loadFlag", dict); |
| 1661 } | 1661 } |
| 1662 | 1662 |
| 1663 // Add information on the relationship between net error codes and their | 1663 // Add information on the relationship between net error codes and their |
| 1664 // symbolic names. | 1664 // symbolic names. |
| 1665 { | 1665 { |
| 1666 DictionaryValue* dict = new DictionaryValue(); | 1666 DictionaryValue* dict = new DictionaryValue(); |
| 1667 | 1667 |
| 1668 const size_t kSkipErrPrefix = strlen("ERR_"); |
| 1668 #define NET_ERROR(label, value) \ | 1669 #define NET_ERROR(label, value) \ |
| 1669 dict->SetInteger(# label, static_cast<int>(value)); | 1670 DCHECK(strlen(#label) > kSkipErrPrefix); \ |
| 1671 dict->SetInteger(# label + kSkipErrPrefix, static_cast<int>(value)); |
| 1670 #include "net/base/net_error_list.h" | 1672 #include "net/base/net_error_list.h" |
| 1671 #undef NET_ERROR | 1673 #undef NET_ERROR |
| 1672 | 1674 |
| 1673 constants_dict->Set("netError", dict); | 1675 constants_dict->Set("netError", dict); |
| 1674 } | 1676 } |
| 1675 | 1677 |
| 1676 // Information about the relationship between event phase enums and their | 1678 // Information about the relationship between event phase enums and their |
| 1677 // symbolic names. | 1679 // symbolic names. |
| 1678 { | 1680 { |
| 1679 DictionaryValue* dict = new DictionaryValue(); | 1681 DictionaryValue* dict = new DictionaryValue(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 } | 1745 } |
| 1744 | 1746 |
| 1745 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) | 1747 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) |
| 1746 : WebUIController(web_ui) { | 1748 : WebUIController(web_ui) { |
| 1747 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); | 1749 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); |
| 1748 | 1750 |
| 1749 // Set up the chrome://net-internals/ source. | 1751 // Set up the chrome://net-internals/ source. |
| 1750 Profile* profile = Profile::FromWebUI(web_ui); | 1752 Profile* profile = Profile::FromWebUI(web_ui); |
| 1751 ChromeURLDataManager::AddDataSource(profile, CreateNetInternalsHTMLSource()); | 1753 ChromeURLDataManager::AddDataSource(profile, CreateNetInternalsHTMLSource()); |
| 1752 } | 1754 } |
| OLD | NEW |