| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import <UIKit/UIKit.h> | 5 #import <UIKit/UIKit.h> |
| 6 | 6 |
| 7 #import "ios/chrome/today_extension/today_metrics_logger.h" | 7 #import "ios/chrome/today_extension/today_metrics_logger.h" |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/cpu.h" | 10 #include "base/cpu.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void SetMetricsClientId(const std::string& client_id) override; | 62 void SetMetricsClientId(const std::string& client_id) override; |
| 63 int32_t GetProduct() override; | 63 int32_t GetProduct() override; |
| 64 std::string GetApplicationLocale() override; | 64 std::string GetApplicationLocale() override; |
| 65 bool GetBrand(std::string* brand_code) override; | 65 bool GetBrand(std::string* brand_code) override; |
| 66 metrics::SystemProfileProto::Channel GetChannel() override; | 66 metrics::SystemProfileProto::Channel GetChannel() override; |
| 67 std::string GetVersionString() override; | 67 std::string GetVersionString() override; |
| 68 void InitializeSystemProfileMetrics( | 68 void InitializeSystemProfileMetrics( |
| 69 const base::Closure& done_callback) override; | 69 const base::Closure& done_callback) override; |
| 70 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; | 70 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; |
| 71 std::unique_ptr<metrics::MetricsLogUploader> CreateUploader( | 71 std::unique_ptr<metrics::MetricsLogUploader> CreateUploader( |
| 72 const std::string& server_url, | 72 base::StringPiece server_url, |
| 73 const std::string& mime_type, | 73 base::StringPiece mime_type, |
| 74 metrics::MetricsLogUploader::MetricServiceType service_type, | 74 metrics::MetricsLogUploader::MetricServiceType service_type, |
| 75 const base::Callback<void(int)>& on_upload_complete) override; | 75 const base::Callback<void(int)>& on_upload_complete) override; |
| 76 base::TimeDelta GetStandardUploadInterval() override; | 76 base::TimeDelta GetStandardUploadInterval() override; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 DISALLOW_COPY_AND_ASSIGN(TodayMetricsServiceClient); | 79 DISALLOW_COPY_AND_ASSIGN(TodayMetricsServiceClient); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 class TodayMetricsLog : public metrics::MetricsLog { | 82 class TodayMetricsLog : public metrics::MetricsLog { |
| 83 public: | 83 public: |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 NOTREACHED(); | 143 NOTREACHED(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void TodayMetricsServiceClient::CollectFinalMetricsForLog( | 146 void TodayMetricsServiceClient::CollectFinalMetricsForLog( |
| 147 const base::Closure& done_callback) { | 147 const base::Closure& done_callback) { |
| 148 NOTREACHED(); | 148 NOTREACHED(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 std::unique_ptr<metrics::MetricsLogUploader> | 151 std::unique_ptr<metrics::MetricsLogUploader> |
| 152 TodayMetricsServiceClient::CreateUploader( | 152 TodayMetricsServiceClient::CreateUploader( |
| 153 const std::string& server_url, | 153 base::StringPiece server_url, |
| 154 const std::string& mime_type, | 154 base::StringPiece mime_type, |
| 155 metrics::MetricsLogUploader::MetricServiceType service_type, | 155 metrics::MetricsLogUploader::MetricServiceType service_type, |
| 156 const base::Callback<void(int)>& on_upload_complete) { | 156 const base::Callback<void(int)>& on_upload_complete) { |
| 157 NOTREACHED(); | 157 NOTREACHED(); |
| 158 return nullptr; | 158 return nullptr; |
| 159 } | 159 } |
| 160 | 160 |
| 161 base::TimeDelta TodayMetricsServiceClient::GetStandardUploadInterval() { | 161 base::TimeDelta TodayMetricsServiceClient::GetStandardUploadInterval() { |
| 162 NOTREACHED(); | 162 NOTREACHED(); |
| 163 return base::TimeDelta::FromSeconds(0); | 163 return base::TimeDelta::FromSeconds(0); |
| 164 } | 164 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 void TodayMetricsLogger::UniqueInconsistencyDetected( | 297 void TodayMetricsLogger::UniqueInconsistencyDetected( |
| 298 base::HistogramBase::Inconsistency problem) { | 298 base::HistogramBase::Inconsistency problem) { |
| 299 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", problem, | 299 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", problem, |
| 300 base::HistogramBase::NEVER_EXCEEDED_VALUE); | 300 base::HistogramBase::NEVER_EXCEEDED_VALUE); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void TodayMetricsLogger::InconsistencyDetectedInLoggedCount(int amount) { | 303 void TodayMetricsLogger::InconsistencyDetectedInLoggedCount(int amount) { |
| 304 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", | 304 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", |
| 305 std::abs(amount)); | 305 std::abs(amount)); |
| 306 } | 306 } |
| OLD | NEW |