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

Unified Diff: chrome/browser/metrics/metrics_log.cc

Issue 12082090: [net] Add WifiPhyMode to SystemProfile (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: sync Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/metrics/metrics_log.h ('k') | chrome/browser/metrics/metrics_network_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_log.cc
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index 3e518144c7e8ceaf119391f4ca66b99e67aaabf3..e3c6fa321d29f0eb6f6a363bb77d517bae4bb1f4 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -45,7 +45,6 @@
#include "content/public/common/content_client.h"
#include "content/public/common/gpu_info.h"
#include "googleurl/src/gurl.h"
-#include "net/base/network_change_notifier.h"
#include "ui/gfx/screen.h"
#include "webkit/plugins/webplugininfo.h"
@@ -308,65 +307,6 @@ void WriteScreenDPIInformationProto(SystemProfileProto::Hardware* hardware) {
} // namespace
-class MetricsLog::NetworkObserver
- : public net::NetworkChangeNotifier::ConnectionTypeObserver {
- public:
- NetworkObserver() : connection_type_is_ambiguous_(false) {
- net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
- Reset();
- }
- virtual ~NetworkObserver() {
- net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
- }
-
- void Reset() {
- connection_type_is_ambiguous_ = false;
- connection_type_ = net::NetworkChangeNotifier::GetConnectionType();
- }
-
- // ConnectionTypeObserver:
- virtual void OnConnectionTypeChanged(
- net::NetworkChangeNotifier::ConnectionType type) OVERRIDE {
- if (type == net::NetworkChangeNotifier::CONNECTION_NONE)
- return;
- if (type != connection_type_ &&
- connection_type_ != net::NetworkChangeNotifier::CONNECTION_NONE) {
- connection_type_is_ambiguous_ = true;
- }
- connection_type_ = type;
- }
-
- bool connection_type_is_ambiguous() const {
- return connection_type_is_ambiguous_;
- }
-
- SystemProfileProto::Network::ConnectionType connection_type() const {
- switch (connection_type_) {
- case net::NetworkChangeNotifier::CONNECTION_NONE:
- case net::NetworkChangeNotifier::CONNECTION_UNKNOWN:
- return SystemProfileProto::Network::CONNECTION_UNKNOWN;
- case net::NetworkChangeNotifier::CONNECTION_ETHERNET:
- return SystemProfileProto::Network::CONNECTION_ETHERNET;
- case net::NetworkChangeNotifier::CONNECTION_WIFI:
- return SystemProfileProto::Network::CONNECTION_WIFI;
- case net::NetworkChangeNotifier::CONNECTION_2G:
- return SystemProfileProto::Network::CONNECTION_2G;
- case net::NetworkChangeNotifier::CONNECTION_3G:
- return SystemProfileProto::Network::CONNECTION_3G;
- case net::NetworkChangeNotifier::CONNECTION_4G:
- return SystemProfileProto::Network::CONNECTION_4G;
- }
- NOTREACHED();
- return SystemProfileProto::Network::CONNECTION_UNKNOWN;
- }
-
- private:
- bool connection_type_is_ambiguous_;
- net::NetworkChangeNotifier::ConnectionType connection_type_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkObserver);
-};
-
GoogleUpdateMetrics::GoogleUpdateMetrics() : is_system_install(false) {}
GoogleUpdateMetrics::~GoogleUpdateMetrics() {}
@@ -375,8 +315,7 @@ static base::LazyInstance<std::string>::Leaky
g_version_extension = LAZY_INSTANCE_INITIALIZER;
MetricsLog::MetricsLog(const std::string& client_id, int session_id)
- : MetricsLogBase(client_id, session_id, MetricsLog::GetVersionString()),
- network_observer_(new NetworkObserver()) {}
+ : MetricsLogBase(client_id, session_id, MetricsLog::GetVersionString()) {}
MetricsLog::~MetricsLog() {}
@@ -876,9 +815,13 @@ void MetricsLog::RecordEnvironmentProto(
SystemProfileProto::Network* network = system_profile->mutable_network();
network->set_connection_type_is_ambiguous(
- network_observer_->connection_type_is_ambiguous());
- network->set_connection_type(network_observer_->connection_type());
- network_observer_->Reset();
+ network_observer_.connection_type_is_ambiguous());
+ network->set_connection_type(network_observer_.connection_type());
+ network->set_wifi_phy_layer_protocol_is_ambiguous(
+ network_observer_.wifi_phy_layer_protocol_is_ambiguous());
+ network->set_wifi_phy_layer_protocol(
+ network_observer_.wifi_phy_layer_protocol());
+ network_observer_.Reset();
SystemProfileProto::OS* os = system_profile->mutable_os();
std::string os_name = base::SysInfo::OperatingSystemName();
« no previous file with comments | « chrome/browser/metrics/metrics_log.h ('k') | chrome/browser/metrics/metrics_network_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698