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

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

Issue 634583003: Simplify VersionInfo code, avoid hitting sandbox IPC constantly on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linux include Created 6 years, 2 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/ui/webui/help/help_handler.cc ('k') | chrome/browser/upgrade_detector_impl.cc » ('j') | 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 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 base::DictionaryValue* constants_dict = net::NetLogLogger::GetConstants(); 1698 base::DictionaryValue* constants_dict = net::NetLogLogger::GetConstants();
1699 DCHECK(constants_dict); 1699 DCHECK(constants_dict);
1700 1700
1701 // Add a dictionary with the version of the client and its command line 1701 // Add a dictionary with the version of the client and its command line
1702 // arguments. 1702 // arguments.
1703 { 1703 {
1704 base::DictionaryValue* dict = new base::DictionaryValue(); 1704 base::DictionaryValue* dict = new base::DictionaryValue();
1705 1705
1706 chrome::VersionInfo version_info; 1706 chrome::VersionInfo version_info;
1707 1707
1708 if (!version_info.is_valid()) { 1708 // We have everything we need to send the right values.
1709 DLOG(ERROR) << "Unable to create chrome::VersionInfo"; 1709 dict->SetString("name", version_info.Name());
1710 } else { 1710 dict->SetString("version", version_info.Version());
1711 // We have everything we need to send the right values. 1711 dict->SetString("cl", version_info.LastChange());
1712 dict->SetString("name", version_info.Name()); 1712 dict->SetString("version_mod",
1713 dict->SetString("version", version_info.Version()); 1713 chrome::VersionInfo::GetVersionStringModifier());
1714 dict->SetString("cl", version_info.LastChange()); 1714 dict->SetString("official",
1715 dict->SetString("version_mod", 1715 version_info.IsOfficialBuild() ? "official" : "unofficial");
1716 chrome::VersionInfo::GetVersionStringModifier()); 1716 dict->SetString("os_type", version_info.OSType());
1717 dict->SetString("official", 1717 dict->SetString("command_line",
1718 version_info.IsOfficialBuild() ? "official" : 1718 CommandLine::ForCurrentProcess()->GetCommandLineString());
1719 "unofficial");
1720 dict->SetString("os_type", version_info.OSType());
1721 dict->SetString("command_line",
1722 CommandLine::ForCurrentProcess()->GetCommandLineString());
1723 }
1724 1719
1725 constants_dict->Set("clientInfo", dict); 1720 constants_dict->Set("clientInfo", dict);
1726 } 1721 }
1727 1722
1728 return constants_dict; 1723 return constants_dict;
1729 } 1724 }
1730 1725
1731 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui) 1726 NetInternalsUI::NetInternalsUI(content::WebUI* web_ui)
1732 : WebUIController(web_ui) { 1727 : WebUIController(web_ui) {
1733 web_ui->AddMessageHandler(new NetInternalsMessageHandler()); 1728 web_ui->AddMessageHandler(new NetInternalsMessageHandler());
1734 1729
1735 // Set up the chrome://net-internals/ source. 1730 // Set up the chrome://net-internals/ source.
1736 Profile* profile = Profile::FromWebUI(web_ui); 1731 Profile* profile = Profile::FromWebUI(web_ui);
1737 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource()); 1732 content::WebUIDataSource::Add(profile, CreateNetInternalsHTMLSource());
1738 } 1733 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/help/help_handler.cc ('k') | chrome/browser/upgrade_detector_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698