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

Side by Side Diff: components/metrics/metrics_log_store.cc

Issue 2918533003: Send metrics with embedded system profiles after system startup. (Closed)
Patch Set: addressed final review comments Created 3 years, 6 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 | « components/metrics/metrics_log.cc ('k') | components/metrics/metrics_provider.h » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/metrics_log_store.h" 5 #include "components/metrics/metrics_log_store.h"
6 6
7 #include "components/metrics/metrics_pref_names.h" 7 #include "components/metrics/metrics_pref_names.h"
8 #include "components/metrics/persisted_logs_metrics_impl.h" 8 #include "components/metrics/persisted_logs_metrics_impl.h"
9 #include "components/prefs/pref_registry_simple.h" 9 #include "components/prefs/pref_registry_simple.h"
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 unsent_logs_loaded_ = true; 66 unsent_logs_loaded_ = true;
67 } 67 }
68 68
69 void MetricsLogStore::StoreLog(const std::string& log_data, 69 void MetricsLogStore::StoreLog(const std::string& log_data,
70 MetricsLog::LogType log_type) { 70 MetricsLog::LogType log_type) {
71 switch (log_type) { 71 switch (log_type) {
72 case MetricsLog::INITIAL_STABILITY_LOG: 72 case MetricsLog::INITIAL_STABILITY_LOG:
73 initial_log_queue_.StoreLog(log_data); 73 initial_log_queue_.StoreLog(log_data);
74 break; 74 break;
75 case MetricsLog::ONGOING_LOG: 75 case MetricsLog::ONGOING_LOG:
76 case MetricsLog::INDEPENDENT_LOG:
76 ongoing_log_queue_.StoreLog(log_data); 77 ongoing_log_queue_.StoreLog(log_data);
77 break; 78 break;
78 } 79 }
79 } 80 }
80 81
81 bool MetricsLogStore::has_unsent_logs() const { 82 bool MetricsLogStore::has_unsent_logs() const {
82 return initial_log_queue_.has_unsent_logs() || 83 return initial_log_queue_.has_unsent_logs() ||
83 ongoing_log_queue_.has_unsent_logs(); 84 ongoing_log_queue_.has_unsent_logs();
84 } 85 }
85 86
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void MetricsLogStore::PersistUnsentLogs() const { 120 void MetricsLogStore::PersistUnsentLogs() const {
120 DCHECK(unsent_logs_loaded_); 121 DCHECK(unsent_logs_loaded_);
121 if (!unsent_logs_loaded_) 122 if (!unsent_logs_loaded_)
122 return; 123 return;
123 124
124 initial_log_queue_.PersistUnsentLogs(); 125 initial_log_queue_.PersistUnsentLogs();
125 ongoing_log_queue_.PersistUnsentLogs(); 126 ongoing_log_queue_.PersistUnsentLogs();
126 } 127 }
127 128
128 } // namespace metrics 129 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/metrics_log.cc ('k') | components/metrics/metrics_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698