| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_REPORTER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_REPORTER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_REPORTER_H_ | 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_REPORTER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <deque> | |
| 12 #include <memory> | 11 #include <memory> |
| 13 #include <string> | 12 #include <string> |
| 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/containers/hash_tables.h" | 16 #include "base/containers/hash_tables.h" |
| 17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/threading/thread_checker.h" | 19 #include "base/threading/thread_checker.h" |
| 20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 21 #include "chrome/browser/android/data_usage/data_use_tab_model.h" | 21 #include "chrome/browser/android/data_usage/data_use_tab_model.h" |
| 22 #include "net/base/network_change_notifier.h" | 22 #include "net/base/network_change_notifier.h" |
| 23 | 23 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 const GetTrackingInfoCallback& get_tracking_info_callback, | 79 const GetTrackingInfoCallback& get_tracking_info_callback, |
| 80 const ReportDataUseCallback& report_data_use_callback); | 80 const ReportDataUseCallback& report_data_use_callback); |
| 81 | 81 |
| 82 virtual ~ExternalDataUseReporter(); | 82 virtual ~ExternalDataUseReporter(); |
| 83 | 83 |
| 84 void InitOnUIThread(); | 84 void InitOnUIThread(); |
| 85 | 85 |
| 86 // Notifies the ExternalDataUseReporter of data usage. The data use is labeled | 86 // Notifies the ExternalDataUseReporter of data usage. The data use is labeled |
| 87 // using |data_use_tab_model_|, buffered and then reported to | 87 // using |data_use_tab_model_|, buffered and then reported to |
| 88 // |external_data_use_observer_bridge_| later. | 88 // |external_data_use_observer_bridge_| later. |
| 89 void OnDataUse(std::unique_ptr<const std::deque<const data_usage::DataUse>> | 89 void OnDataUse(std::unique_ptr<const std::vector<const data_usage::DataUse>> |
| 90 data_use_list); | 90 data_use_list); |
| 91 | 91 |
| 92 void OnReportDataUseDone(bool success); | 92 void OnReportDataUseDone(bool success); |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 friend class ExternalDataUseReporterTest; | 95 friend class ExternalDataUseReporterTest; |
| 96 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, BufferDataUseReports); | 96 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, BufferDataUseReports); |
| 97 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, BufferSize); | 97 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, BufferSize); |
| 98 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, DataUseReportTimedOut); | 98 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, DataUseReportTimedOut); |
| 99 #if defined(OS_ANDROID) | 99 #if defined(OS_ANDROID) |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 base::ThreadChecker thread_checker_; | 249 base::ThreadChecker thread_checker_; |
| 250 | 250 |
| 251 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseReporter); | 251 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseReporter); |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 } // namespace android | 254 } // namespace android |
| 255 | 255 |
| 256 } // namespace chrome | 256 } // namespace chrome |
| 257 | 257 |
| 258 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_REPORTER_H_ | 258 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_REPORTER_H_ |
| OLD | NEW |