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 #include "chrome/browser/android/data_usage/external_data_use_observer_bridge.h" | 5 #include "chrome/browser/android/data_usage/external_data_use_observer_bridge.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/android/context_utils.h" | 10 #include "base/android/context_utils.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 data_use_tab_model_->RegisterURLRegexes( | 129 data_use_tab_model_->RegisterURLRegexes( |
130 app_package_name_native, domain_path_regex_native, label_native); | 130 app_package_name_native, domain_path_regex_native, label_native); |
131 } | 131 } |
132 | 132 |
133 void ExternalDataUseObserverBridge::ReportDataUse( | 133 void ExternalDataUseObserverBridge::ReportDataUse( |
134 const std::string& label, | 134 const std::string& label, |
135 const std::string& tag, | 135 const std::string& tag, |
136 net::NetworkChangeNotifier::ConnectionType connection_type, | 136 net::NetworkChangeNotifier::ConnectionType connection_type, |
137 const std::string& mcc_mnc, | 137 const std::string& mcc_mnc, |
138 const base::Time& start_time, | 138 base::Time start_time, |
139 const base::Time& end_time, | 139 base::Time end_time, |
140 int64_t bytes_downloaded, | 140 int64_t bytes_downloaded, |
141 int64_t bytes_uploaded) const { | 141 int64_t bytes_uploaded) const { |
142 DCHECK(thread_checker_.CalledOnValidThread()); | 142 DCHECK(thread_checker_.CalledOnValidThread()); |
143 | 143 |
144 JNIEnv* env = base::android::AttachCurrentThread(); | 144 JNIEnv* env = base::android::AttachCurrentThread(); |
145 DCHECK(!j_external_data_use_observer_.is_null()); | 145 DCHECK(!j_external_data_use_observer_.is_null()); |
146 | 146 |
147 // End time should be greater than start time. | 147 // End time should be greater than start time. |
148 int64_t start_time_milliseconds = start_time.ToJavaTime(); | 148 int64_t start_time_milliseconds = start_time.ToJavaTime(); |
149 int64_t end_time_milliseconds = end_time.ToJavaTime(); | 149 int64_t end_time_milliseconds = end_time.ToJavaTime(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 external_data_use_observer_, should_register)); | 189 external_data_use_observer_, should_register)); |
190 } | 190 } |
191 | 191 |
192 bool RegisterExternalDataUseObserver(JNIEnv* env) { | 192 bool RegisterExternalDataUseObserver(JNIEnv* env) { |
193 return RegisterNativesImpl(env); | 193 return RegisterNativesImpl(env); |
194 } | 194 } |
195 | 195 |
196 } // namespace android | 196 } // namespace android |
197 | 197 |
198 } // namespace chrome | 198 } // namespace chrome |
OLD | NEW |