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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 source_dict->SetInteger(L"id", source.id); | 71 source_dict->SetInteger(L"id", source.id); |
72 source_dict->SetInteger(L"type", static_cast<int>(source.type)); | 72 source_dict->SetInteger(L"type", static_cast<int>(source.type)); |
73 entry_dict->Set(L"source", source_dict); | 73 entry_dict->Set(L"source", source_dict); |
74 | 74 |
75 // Set the event info. | 75 // Set the event info. |
76 entry_dict->SetInteger(L"type", static_cast<int>(type)); | 76 entry_dict->SetInteger(L"type", static_cast<int>(type)); |
77 entry_dict->SetInteger(L"phase", static_cast<int>(phase)); | 77 entry_dict->SetInteger(L"phase", static_cast<int>(phase)); |
78 | 78 |
79 // Set the event-specific parameters. | 79 // Set the event-specific parameters. |
80 if (extra_parameters) | 80 if (extra_parameters) |
81 entry_dict->SetString(L"extra_parameters", extra_parameters->ToString()); | 81 entry_dict->Set(L"extra_parameters", extra_parameters->ToValue()); |
82 | 82 |
83 return entry_dict; | 83 return entry_dict; |
84 } | 84 } |
85 | 85 |
86 class NetInternalsHTMLSource : public ChromeURLDataManager::DataSource { | 86 class NetInternalsHTMLSource : public ChromeURLDataManager::DataSource { |
87 public: | 87 public: |
88 NetInternalsHTMLSource(); | 88 NetInternalsHTMLSource(); |
89 | 89 |
90 // Called when the network layer has requested a resource underneath | 90 // Called when the network layer has requested a resource underneath |
91 // the path we registered. | 91 // the path we registered. |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); | 693 NetInternalsHTMLSource* html_source = new NetInternalsHTMLSource(); |
694 | 694 |
695 // Set up the chrome://net-internals/ source. | 695 // Set up the chrome://net-internals/ source. |
696 ChromeThread::PostTask( | 696 ChromeThread::PostTask( |
697 ChromeThread::IO, FROM_HERE, | 697 ChromeThread::IO, FROM_HERE, |
698 NewRunnableMethod( | 698 NewRunnableMethod( |
699 Singleton<ChromeURLDataManager>::get(), | 699 Singleton<ChromeURLDataManager>::get(), |
700 &ChromeURLDataManager::AddDataSource, | 700 &ChromeURLDataManager::AddDataSource, |
701 make_scoped_refptr(html_source))); | 701 make_scoped_refptr(html_source))); |
702 } | 702 } |
OLD | NEW |