| 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 dict->SetInteger(L"PHASE_NONE", net::NetLog::PHASE_NONE); | 574 dict->SetInteger(L"PHASE_NONE", net::NetLog::PHASE_NONE); |
| 575 | 575 |
| 576 CallJavascriptFunction(L"g_browser.receivedLogEventPhaseConstants", dict); | 576 CallJavascriptFunction(L"g_browser.receivedLogEventPhaseConstants", dict); |
| 577 } | 577 } |
| 578 | 578 |
| 579 // Tell the javascript about the relationship between source type enums and | 579 // Tell the javascript about the relationship between source type enums and |
| 580 // their symbolic name. | 580 // their symbolic name. |
| 581 { | 581 { |
| 582 DictionaryValue* dict = new DictionaryValue(); | 582 DictionaryValue* dict = new DictionaryValue(); |
| 583 | 583 |
| 584 int i = 0; | 584 #define SOURCE_TYPE(label, value) dict->SetInteger(ASCIIToWide(# label), value); |
| 585 #define SOURCE_TYPE(label) dict->SetInteger(ASCIIToWide(# label), i++); | |
| 586 #include "net/base/net_log_source_type_list.h" | 585 #include "net/base/net_log_source_type_list.h" |
| 587 #undef SOURCE_TYPE | 586 #undef SOURCE_TYPE |
| 588 | 587 |
| 589 CallJavascriptFunction(L"g_browser.receivedLogSourceTypeConstants", dict); | 588 CallJavascriptFunction(L"g_browser.receivedLogSourceTypeConstants", dict); |
| 590 } | 589 } |
| 591 | 590 |
| 592 // Tell the javascript how the "time ticks" values we have given it relate to | 591 // Tell the javascript how the "time ticks" values we have given it relate to |
| 593 // actual system times. (We used time ticks throughout since they are stable | 592 // actual system times. (We used time ticks throughout since they are stable |
| 594 // across system clock changes). | 593 // across system clock changes). |
| 595 { | 594 { |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); | 908 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); |
| 910 | 909 |
| 911 // Set up the chrome://net-internals/ source. | 910 // Set up the chrome://net-internals/ source. |
| 912 ChromeThread::PostTask( | 911 ChromeThread::PostTask( |
| 913 ChromeThread::IO, FROM_HERE, | 912 ChromeThread::IO, FROM_HERE, |
| 914 NewRunnableMethod( | 913 NewRunnableMethod( |
| 915 Singleton<ChromeURLDataManager>::get(), | 914 Singleton<ChromeURLDataManager>::get(), |
| 916 &ChromeURLDataManager::AddDataSource, | 915 &ChromeURLDataManager::AddDataSource, |
| 917 make_scoped_refptr(html_source))); | 916 make_scoped_refptr(html_source))); |
| 918 } | 917 } |
| OLD | NEW |