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 #ifndef ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "android_webview/browser/aw_metrics_service_client.h" | 12 #include "android_webview/browser/aw_metrics_service_client.h" |
13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "components/metrics/metrics_log_uploader.h" | 15 #include "components/metrics/metrics_log_uploader.h" |
| 16 #include "components/version_info/channel.h" |
16 | 17 |
17 namespace metrics { | 18 namespace metrics { |
18 class MetricsStateManager; | 19 class MetricsStateManager; |
19 } | 20 } |
20 | 21 |
21 namespace android_webview { | 22 namespace android_webview { |
22 | 23 |
23 // This singleton manages metrics for an app using any number of WebViews. It | 24 // This singleton manages metrics for an app using any number of WebViews. It |
24 // must always be used on the same thread. (Currently the UI thread is enforced, | 25 // must always be used on the same thread. (Currently the UI thread is enforced, |
25 // but it could be any thread.) This is to prevent enable/disable race | 26 // but it could be any thread.) This is to prevent enable/disable race |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 AwMetricsServiceClientImpl(); | 66 AwMetricsServiceClientImpl(); |
66 ~AwMetricsServiceClientImpl() override; | 67 ~AwMetricsServiceClientImpl() override; |
67 | 68 |
68 void InitializeWithGUID(std::string* guid); | 69 void InitializeWithGUID(std::string* guid); |
69 | 70 |
70 bool is_enabled_; | 71 bool is_enabled_; |
71 PrefService* pref_service_; | 72 PrefService* pref_service_; |
72 net::URLRequestContextGetter* request_context_; | 73 net::URLRequestContextGetter* request_context_; |
73 std::unique_ptr<metrics::MetricsStateManager> metrics_state_manager_; | 74 std::unique_ptr<metrics::MetricsStateManager> metrics_state_manager_; |
74 std::unique_ptr<metrics::MetricsService> metrics_service_; | 75 std::unique_ptr<metrics::MetricsService> metrics_service_; |
| 76 version_info::Channel channel_; |
75 | 77 |
76 DISALLOW_COPY_AND_ASSIGN(AwMetricsServiceClientImpl); | 78 DISALLOW_COPY_AND_ASSIGN(AwMetricsServiceClientImpl); |
77 }; | 79 }; |
78 | 80 |
79 bool RegisterAwMetricsServiceClient(JNIEnv* env); | 81 bool RegisterAwMetricsServiceClient(JNIEnv* env); |
80 | 82 |
81 } // namespace android_webview | 83 } // namespace android_webview |
82 | 84 |
83 #endif // ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ | 85 #endif // ANDROID_WEBVIEW_BROWSER_AW_METRICS_SERVICE_CLIENT_IMPL_H_ |
OLD | NEW |