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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/android/context_utils.h" | 9 #include "base/android/context_utils.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 } | 112 } |
113 | 113 |
114 DCHECK_EQ(app_package_name_native.size(), domain_path_regex_native.size()); | 114 DCHECK_EQ(app_package_name_native.size(), domain_path_regex_native.size()); |
115 DCHECK_EQ(app_package_name_native.size(), label_native.size()); | 115 DCHECK_EQ(app_package_name_native.size(), label_native.size()); |
116 | 116 |
117 if (!data_use_tab_model_) | 117 if (!data_use_tab_model_) |
118 return; | 118 return; |
119 | 119 |
120 data_use_tab_model_->RegisterURLRegexes( | 120 data_use_tab_model_->RegisterURLRegexes( |
121 app_package_name_native, domain_path_regex_native, label_native); | 121 app_package_name_native, domain_path_regex_native, label_native); |
122 | |
123 io_task_runner_->PostTask( | |
124 FROM_HERE, base::Bind(&ExternalDataUseObserver::OnFetchMatchingRulesDone, | |
tbansal1
2016/01/13 18:06:52
What are we trying to measure here? The way it is
Raj
2016/01/13 23:33:51
Agreed. I guess duration for first fetch is more v
| |
125 external_data_use_observer_)); | |
122 } | 126 } |
123 | 127 |
124 void ExternalDataUseObserverBridge::ReportDataUse( | 128 void ExternalDataUseObserverBridge::ReportDataUse( |
125 const std::string& label, | 129 const std::string& label, |
126 net::NetworkChangeNotifier::ConnectionType connection_type, | 130 net::NetworkChangeNotifier::ConnectionType connection_type, |
127 const std::string& mcc_mnc, | 131 const std::string& mcc_mnc, |
128 const base::Time& start_time, | 132 const base::Time& start_time, |
129 const base::Time& end_time, | 133 const base::Time& end_time, |
130 int64_t bytes_downloaded, | 134 int64_t bytes_downloaded, |
131 int64_t bytes_uploaded) const { | 135 int64_t bytes_uploaded) const { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 data_use_tab_model_->OnControlAppInstalled(); | 168 data_use_tab_model_->OnControlAppInstalled(); |
165 } | 169 } |
166 | 170 |
167 bool RegisterExternalDataUseObserver(JNIEnv* env) { | 171 bool RegisterExternalDataUseObserver(JNIEnv* env) { |
168 return RegisterNativesImpl(env); | 172 return RegisterNativesImpl(env); |
169 } | 173 } |
170 | 174 |
171 } // namespace android | 175 } // namespace android |
172 | 176 |
173 } // namespace chrome | 177 } // namespace chrome |
OLD | NEW |