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 <vector> | 10 #include <vector> |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 for (size_t i = 0; i < event_types.size(); ++i) { | 492 for (size_t i = 0; i < event_types.size(); ++i) { |
493 const char* name = net::NetLog::EventTypeToString(event_types[i]); | 493 const char* name = net::NetLog::EventTypeToString(event_types[i]); |
494 dict->SetInteger(ASCIIToWide(name), | 494 dict->SetInteger(ASCIIToWide(name), |
495 static_cast<int>(event_types[i])); | 495 static_cast<int>(event_types[i])); |
496 } | 496 } |
497 | 497 |
498 CallJavascriptFunction(L"g_browser.receivedLogEventTypeConstants", dict); | 498 CallJavascriptFunction(L"g_browser.receivedLogEventTypeConstants", dict); |
499 } | 499 } |
500 | 500 |
| 501 // Tell the javascript about the relationship between load flag enums and |
| 502 // their symbolic name. |
| 503 { |
| 504 DictionaryValue* dict = new DictionaryValue(); |
| 505 |
| 506 #define LOAD_FLAG(label, value) \ |
| 507 dict->SetInteger(ASCIIToWide(# label), static_cast<int>(value)); |
| 508 #include "net/base/load_flags_list.h" |
| 509 #undef LOAD_FLAG |
| 510 |
| 511 CallJavascriptFunction(L"g_browser.receivedLoadFlagConstants", dict); |
| 512 } |
| 513 |
| 514 // Tell the javascript about the relationship between net error codes and |
| 515 // their symbolic name. |
| 516 { |
| 517 DictionaryValue* dict = new DictionaryValue(); |
| 518 |
| 519 #define NET_ERROR(label, value) \ |
| 520 dict->SetInteger(ASCIIToWide(# label), static_cast<int>(value)); |
| 521 #include "net/base/net_error_list.h" |
| 522 #undef NET_ERROR |
| 523 |
| 524 CallJavascriptFunction(L"g_browser.receivedNetErrorConstants", dict); |
| 525 } |
| 526 |
501 // Tell the javascript about the relationship between event phase enums and | 527 // Tell the javascript about the relationship between event phase enums and |
502 // their symbolic name. | 528 // their symbolic name. |
503 { | 529 { |
504 DictionaryValue* dict = new DictionaryValue(); | 530 DictionaryValue* dict = new DictionaryValue(); |
505 | 531 |
506 dict->SetInteger(L"PHASE_BEGIN", net::NetLog::PHASE_BEGIN); | 532 dict->SetInteger(L"PHASE_BEGIN", net::NetLog::PHASE_BEGIN); |
507 dict->SetInteger(L"PHASE_END", net::NetLog::PHASE_END); | 533 dict->SetInteger(L"PHASE_END", net::NetLog::PHASE_END); |
508 dict->SetInteger(L"PHASE_NONE", net::NetLog::PHASE_NONE); | 534 dict->SetInteger(L"PHASE_NONE", net::NetLog::PHASE_NONE); |
509 | 535 |
510 CallJavascriptFunction(L"g_browser.receivedLogEventPhaseConstants", dict); | 536 CallJavascriptFunction(L"g_browser.receivedLogEventPhaseConstants", dict); |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); | 874 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); |
849 | 875 |
850 // Set up the chrome://net-internals/ source. | 876 // Set up the chrome://net-internals/ source. |
851 ChromeThread::PostTask( | 877 ChromeThread::PostTask( |
852 ChromeThread::IO, FROM_HERE, | 878 ChromeThread::IO, FROM_HERE, |
853 NewRunnableMethod( | 879 NewRunnableMethod( |
854 Singleton<ChromeURLDataManager>::get(), | 880 Singleton<ChromeURLDataManager>::get(), |
855 &ChromeURLDataManager::AddDataSource, | 881 &ChromeURLDataManager::AddDataSource, |
856 make_scoped_refptr(html_source))); | 882 make_scoped_refptr(html_source))); |
857 } | 883 } |
OLD | NEW |