| Index: components/metrics/metrics_log_manager.cc
|
| ===================================================================
|
| --- components/metrics/metrics_log_manager.cc (revision 275859)
|
| +++ 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);
|
|
|