| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "android_webview/native/aw_metrics_service_client_impl.h" | 5 #include "android_webview/native/aw_metrics_service_client_impl.h" |
| 6 | 6 |
| 7 #include "android_webview/common/aw_version_info_values.h" | 7 #include "android_webview/common/aw_version_info_values.h" |
| 8 #include "android_webview/jni/AwMetricsServiceClient_jni.h" | 8 #include "android_webview/jni/AwMetricsServiceClient_jni.h" |
| 9 #include "android_webview/native/aw_metrics_log_uploader.h" | 9 #include "android_webview/native/aw_metrics_log_uploader.h" |
| 10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 void AwMetricsServiceClientImpl::CollectFinalMetricsForLog( | 205 void AwMetricsServiceClientImpl::CollectFinalMetricsForLog( |
| 206 const base::Closure& done_callback) { | 206 const base::Closure& done_callback) { |
| 207 done_callback.Run(); | 207 done_callback.Run(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 std::unique_ptr<metrics::MetricsLogUploader> | 210 std::unique_ptr<metrics::MetricsLogUploader> |
| 211 AwMetricsServiceClientImpl::CreateUploader( | 211 AwMetricsServiceClientImpl::CreateUploader( |
| 212 base::StringPiece server_url, | 212 base::StringPiece server_url, |
| 213 base::StringPiece mime_type, | 213 base::StringPiece mime_type, |
| 214 metrics::MetricsLogUploader::MetricServiceType service_type, | 214 metrics::MetricsLogUploader::MetricServiceType service_type, |
| 215 const base::Callback<void(int)>& on_upload_complete) { | 215 const metrics::MetricsLogUploader::UploadCallback& on_upload_complete) { |
| 216 // |server_url| and |mime_type| are unused because WebView uses the platform | 216 // |server_url| and |mime_type| are unused because WebView uses the platform |
| 217 // logging mechanism instead of the normal UMA server. | 217 // logging mechanism instead of the normal UMA server. |
| 218 return std::unique_ptr<::metrics::MetricsLogUploader>( | 218 return std::unique_ptr<::metrics::MetricsLogUploader>( |
| 219 new AwMetricsLogUploader(on_upload_complete)); | 219 new AwMetricsLogUploader(on_upload_complete)); |
| 220 } | 220 } |
| 221 | 221 |
| 222 base::TimeDelta AwMetricsServiceClientImpl::GetStandardUploadInterval() { | 222 base::TimeDelta AwMetricsServiceClientImpl::GetStandardUploadInterval() { |
| 223 // The platform logging mechanism is responsible for upload frequency; this | 223 // The platform logging mechanism is responsible for upload frequency; this |
| 224 // just specifies how frequently to provide logs to the platform. | 224 // just specifies how frequently to provide logs to the platform. |
| 225 return base::TimeDelta::FromMinutes(kUploadIntervalMinutes); | 225 return base::TimeDelta::FromMinutes(kUploadIntervalMinutes); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 238 const base::android::JavaParamRef<jclass>& jcaller, | 238 const base::android::JavaParamRef<jclass>& jcaller, |
| 239 jboolean enabled) { | 239 jboolean enabled) { |
| 240 g_lazy_instance_.Pointer()->SetMetricsEnabled(enabled); | 240 g_lazy_instance_.Pointer()->SetMetricsEnabled(enabled); |
| 241 } | 241 } |
| 242 | 242 |
| 243 bool RegisterAwMetricsServiceClient(JNIEnv* env) { | 243 bool RegisterAwMetricsServiceClient(JNIEnv* env) { |
| 244 return RegisterNativesImpl(env); | 244 return RegisterNativesImpl(env); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace android_webview | 247 } // namespace android_webview |
| OLD | NEW |