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

Unified Diff: components/metrics/metrics_log_manager.cc

Issue 239093004: Move part of metrics from chrome/common to components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding TBR section for owners of minor changes. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: components/metrics/metrics_log_manager.cc
diff --git a/chrome/common/metrics/metrics_log_manager.cc b/components/metrics/metrics_log_manager.cc
similarity index 96%
rename from chrome/common/metrics/metrics_log_manager.cc
rename to components/metrics/metrics_log_manager.cc
index bd49de9c9b380730a648a2960104623ee2f4e8ec..6a3cbfb00c782b59b169453be899cf09350fc755 100644
--- a/chrome/common/metrics/metrics_log_manager.cc
+++ b/components/metrics/metrics_log_manager.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/common/metrics/metrics_log_manager.h"
+#include "components/metrics/metrics_log_manager.h"
#include <algorithm>
@@ -10,7 +10,9 @@
#include "base/sha1.h"
#include "base/strings/string_util.h"
#include "base/timer/elapsed_timer.h"
-#include "chrome/common/metrics/metrics_log_base.h"
+#include "components/metrics/metrics_log_base.h"
+
+namespace metrics {
MetricsLogManager::SerializedLog::SerializedLog() {}
MetricsLogManager::SerializedLog::~SerializedLog() {}
@@ -143,8 +145,9 @@ void MetricsLogManager::DiscardLastProvisionalStore() {
if (last_provisional_store_index_ == -1)
return;
std::vector<SerializedLog>* source_list =
- (last_provisional_store_type_ == MetricsLogBase::ONGOING_LOG) ?
- &unsent_ongoing_logs_ : &unsent_initial_logs_;
+ (last_provisional_store_type_ == MetricsLogBase::ONGOING_LOG)
+ ? &unsent_ongoing_logs_
+ : &unsent_initial_logs_;
DCHECK_LT(static_cast<unsigned int>(last_provisional_store_index_),
source_list->size());
source_list->erase(source_list->begin() + last_provisional_store_index_);
@@ -201,3 +204,5 @@ void MetricsLogManager::CompressCurrentLog(SerializedLog* compressed_log) {
current_log_->GetEncodedLog(&log_text);
compressed_log->SwapLogText(&log_text);
}
+
+} // namespace metrics

Powered by Google App Engine
This is Rietveld 408576698