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

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

Issue 1906173002: Convert //components/metrics from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/metrics_log_manager.h" 5 #include "components/metrics/metrics_log_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 kStorageByteLimitPerLogType, 46 kStorageByteLimitPerLogType,
47 0), 47 0),
48 ongoing_log_queue_(local_state, 48 ongoing_log_queue_(local_state,
49 prefs::kMetricsOngoingLogs, 49 prefs::kMetricsOngoingLogs,
50 kOngoingLogsPersistLimit, 50 kOngoingLogsPersistLimit,
51 kStorageByteLimitPerLogType, 51 kStorageByteLimitPerLogType,
52 max_ongoing_log_size) {} 52 max_ongoing_log_size) {}
53 53
54 MetricsLogManager::~MetricsLogManager() {} 54 MetricsLogManager::~MetricsLogManager() {}
55 55
56 void MetricsLogManager::BeginLoggingWithLog(scoped_ptr<MetricsLog> log) { 56 void MetricsLogManager::BeginLoggingWithLog(std::unique_ptr<MetricsLog> log) {
57 DCHECK(!current_log_); 57 DCHECK(!current_log_);
58 current_log_ = std::move(log); 58 current_log_ = std::move(log);
59 } 59 }
60 60
61 void MetricsLogManager::FinishCurrentLog() { 61 void MetricsLogManager::FinishCurrentLog() {
62 DCHECK(current_log_.get()); 62 DCHECK(current_log_.get());
63 current_log_->CloseLog(); 63 current_log_->CloseLog();
64 std::string log_data; 64 std::string log_data;
65 current_log_->GetEncodedLog(&log_data); 65 current_log_->GetEncodedLog(&log_data);
66 if (!log_data.empty()) 66 if (!log_data.empty())
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 ongoing_log_queue_.SerializeLogs(); 121 ongoing_log_queue_.SerializeLogs();
122 } 122 }
123 123
124 void MetricsLogManager::LoadPersistedUnsentLogs() { 124 void MetricsLogManager::LoadPersistedUnsentLogs() {
125 initial_log_queue_.DeserializeLogs(); 125 initial_log_queue_.DeserializeLogs();
126 ongoing_log_queue_.DeserializeLogs(); 126 ongoing_log_queue_.DeserializeLogs();
127 unsent_logs_loaded_ = true; 127 unsent_logs_loaded_ = true;
128 } 128 }
129 129
130 } // namespace metrics 130 } // namespace metrics
OLDNEW
« 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