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

Side by Side Diff: chrome/browser/android/data_usage/external_data_use_observer_bridge.cc

Issue 2165123002: Make ExternalDataUseReporter independent of other data use classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698