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

Side by Side Diff: components/metrics/net/network_metrics_provider.cc

Issue 2663023002: Mark ECT as ambiguous if there is a change in the connection type. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/metrics/net/network_metrics_provider.h" 5 #include "components/metrics/net/network_metrics_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // connection type is refreshed in ProvideSystemProfileMetrics() each time a 218 // connection type is refreshed in ProvideSystemProfileMetrics() each time a
219 // new UMA logging window begins, so users who genuinely transition to offline 219 // new UMA logging window begins, so users who genuinely transition to offline
220 // mode for an extended duration will still be at least partially represented 220 // mode for an extended duration will still be at least partially represented
221 // in the metrics logs. 221 // in the metrics logs.
222 if (type == net::NetworkChangeNotifier::CONNECTION_NONE) 222 if (type == net::NetworkChangeNotifier::CONNECTION_NONE)
223 return; 223 return;
224 224
225 if (type != connection_type_ && 225 if (type != connection_type_ &&
226 connection_type_ != net::NetworkChangeNotifier::CONNECTION_NONE) { 226 connection_type_ != net::NetworkChangeNotifier::CONNECTION_NONE) {
227 connection_type_is_ambiguous_ = true; 227 connection_type_is_ambiguous_ = true;
228 effective_connection_type_is_ambiguous_ = true;
228 } 229 }
229 connection_type_ = type; 230 connection_type_ = type;
230 231
231 ProbeWifiPHYLayerProtocol(); 232 ProbeWifiPHYLayerProtocol();
232 } 233 }
233 234
234 SystemProfileProto::Network::ConnectionType 235 SystemProfileProto::Network::ConnectionType
235 NetworkMetricsProvider::GetConnectionType() const { 236 NetworkMetricsProvider::GetConnectionType() const {
236 DCHECK(thread_checker_.CalledOnValidThread()); 237 DCHECK(thread_checker_.CalledOnValidThread());
237 switch (connection_type_) { 238 switch (connection_type_) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 DCHECK(thread_checker_.CalledOnValidThread()); 430 DCHECK(thread_checker_.CalledOnValidThread());
430 if (effective_connection_type_ != type && 431 if (effective_connection_type_ != type &&
431 type != net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN && 432 type != net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN &&
432 effective_connection_type_ != net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN) { 433 effective_connection_type_ != net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN) {
433 effective_connection_type_is_ambiguous_ = true; 434 effective_connection_type_is_ambiguous_ = true;
434 } 435 }
435 effective_connection_type_ = type; 436 effective_connection_type_ = type;
436 } 437 }
437 438
438 } // namespace metrics 439 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/net/network_metrics_provider.h ('k') | components/metrics/net/network_metrics_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698