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

Unified Diff: components/metrics/metrics_log_manager.cc

Issue 318203004: Make MetricsService save compressed logs to local state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/metrics/metrics_log_manager.h ('k') | components/metrics/metrics_log_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_log_manager.cc
===================================================================
--- components/metrics/metrics_log_manager.cc (revision 276253)
+++ components/metrics/metrics_log_manager.cc (working copy)
@@ -43,11 +43,13 @@
: unsent_logs_loaded_(false),
initial_log_queue_(local_state,
prefs::kMetricsInitialLogs,
+ prefs::kMetricsInitialLogsOld,
kInitialLogsPersistLimit,
kStorageByteLimitPerLogType,
0),
ongoing_log_queue_(local_state,
prefs::kMetricsOngoingLogs,
+ prefs::kMetricsOngoingLogsOld,
kOngoingLogsPersistLimit,
kStorageByteLimitPerLogType,
max_ongoing_log_size) {}
@@ -62,10 +64,10 @@
void MetricsLogManager::FinishCurrentLog() {
DCHECK(current_log_.get());
current_log_->CloseLog();
- std::string log_text;
- current_log_->GetEncodedLog(&log_text);
- if (!log_text.empty())
- StoreLog(&log_text, current_log_->log_type());
+ std::string log_data;
+ current_log_->GetEncodedLog(&log_data);
+ if (!log_data.empty())
+ StoreLog(log_data, current_log_->log_type());
current_log_.reset();
}
@@ -101,20 +103,20 @@
current_log_.reset(paused_log_.release());
}
-void MetricsLogManager::StoreLog(std::string* log,
+void MetricsLogManager::StoreLog(const std::string& log_data,
MetricsLog::LogType log_type) {
switch (log_type) {
case MetricsLog::INITIAL_STABILITY_LOG:
- initial_log_queue_.StoreLog(log);
+ initial_log_queue_.StoreLog(log_data);
break;
case MetricsLog::ONGOING_LOG:
- ongoing_log_queue_.StoreLog(log);
+ ongoing_log_queue_.StoreLog(log_data);
break;
}
}
void MetricsLogManager::StoreStagedLogAsUnsent(
- metrics::PersistedLogs::StoreType store_type) {
+ PersistedLogs::StoreType store_type) {
DCHECK(has_staged_log());
if (initial_log_queue_.has_staged_log())
initial_log_queue_.StoreStagedLogAsUnsent(store_type);
« no previous file with comments | « components/metrics/metrics_log_manager.h ('k') | components/metrics/metrics_log_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698