Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 568173004: Use base::StringPairs where appropriate from /chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/prefs/tracked/tracked_preferences_migration_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 void NetInternalsMessageHandler::IOThreadImpl::OnGetHttpCacheInfo( 1204 void NetInternalsMessageHandler::IOThreadImpl::OnGetHttpCacheInfo(
1205 const base::ListValue* list) { 1205 const base::ListValue* list) {
1206 DCHECK(!list); 1206 DCHECK(!list);
1207 base::DictionaryValue* info_dict = new base::DictionaryValue(); 1207 base::DictionaryValue* info_dict = new base::DictionaryValue();
1208 base::DictionaryValue* stats_dict = new base::DictionaryValue(); 1208 base::DictionaryValue* stats_dict = new base::DictionaryValue();
1209 1209
1210 disk_cache::Backend* disk_cache = GetDiskCacheBackend(GetMainContext()); 1210 disk_cache::Backend* disk_cache = GetDiskCacheBackend(GetMainContext());
1211 1211
1212 if (disk_cache) { 1212 if (disk_cache) {
1213 // Extract the statistics key/value pairs from the backend. 1213 // Extract the statistics key/value pairs from the backend.
1214 std::vector<std::pair<std::string, std::string> > stats; 1214 base::StringPairs stats;
1215 disk_cache->GetStats(&stats); 1215 disk_cache->GetStats(&stats);
1216 for (size_t i = 0; i < stats.size(); ++i) { 1216 for (size_t i = 0; i < stats.size(); ++i) {
1217 stats_dict->SetStringWithoutPathExpansion( 1217 stats_dict->SetStringWithoutPathExpansion(
1218 stats[i].first, stats[i].second); 1218 stats[i].first, stats[i].second);
1219 } 1219 }
1220 } 1220 }
1221 1221
1222 info_dict->Set("stats", stats_dict); 1222 info_dict->Set("stats", stats_dict);
1223 1223
1224 SendJavascriptCommand("receivedHttpCacheInfo", info_dict); 1224 SendJavascriptCommand("receivedHttpCacheInfo", info_dict);
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 } 1709 }
1710 1710
1711 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1711 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1712 : WebUIController(web_ui) { 1712 : WebUIController(web_ui) {
1713 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1713 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1714 1714
1715 // Set up the chrome://net-internals/ source. 1715 // Set up the chrome://net-internals/ source.
1716 Profile* profile = Profile::FromWebUI(web_ui); 1716 Profile* profile = Profile::FromWebUI(web_ui);
1717 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1717 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1718 } 1718 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/tracked/tracked_preferences_migration_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698