Chromium Code Reviews| Index: components/metrics/metrics_service.cc |
| diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc |
| index 529af17d829491521866ac870048baf24d07d1a7..afe3dce214d10fe7fab5ceb2509158eadd516e1d 100644 |
| --- a/components/metrics/metrics_service.cc |
| +++ b/components/metrics/metrics_service.cc |
| @@ -157,6 +157,7 @@ |
| #include "components/prefs/pref_registry_simple.h" |
| #include "components/prefs/pref_service.h" |
| #include "components/variations/entropy_provider.h" |
| +#include "net/base/network_change_notifier.h" |
|
Steven Holte
2017/04/12 23:26:23
I don't think net/ is allowed here, so this probab
|
| namespace metrics { |
| @@ -727,6 +728,12 @@ void MetricsService::StartScheduledUpload() { |
| return; |
| } |
| + // Don't try to send existing logs or to collecting something new if there is |
| + // no network connection. A cumulative log will be created at the next (or |
| + // future) upload time when a network connection is available. |
| + if (net::NetworkChangeNotifier::IsOffline()) |
|
Steven Holte
2017/04/12 23:11:37
You should call (or schedule a call to) rotation_s
Steven Holte
2017/04/12 23:26:23
Actually after rereading the code, this will also
bcwhite
2017/04/18 14:56:44
Sounds like it's not worth it, then. One (or even
|
| + return; |
| + |
| // If there are unsent logs, send the next one. If not, start the asynchronous |
| // process of finalizing the current log for upload. |
| if (state_ == SENDING_LOGS && has_unsent_logs()) { |