Chromium Code Reviews| 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> | |
| 11 #include <memory> | 12 #include <memory> |
| 12 #include <string> | 13 #include <string> |
| 13 | 14 |
| 14 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
| 15 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
| 18 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 19 #include "net/base/network_change_notifier.h" | 20 #include "net/base/network_change_notifier.h" |
| 20 | 21 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 const char* field_trial, | 64 const char* field_trial, |
| 64 DataUseTabModel* data_use_tab_model, | 65 DataUseTabModel* data_use_tab_model, |
| 65 ExternalDataUseObserverBridge* external_data_use_observer_bridge); | 66 ExternalDataUseObserverBridge* external_data_use_observer_bridge); |
| 66 virtual ~ExternalDataUseReporter(); | 67 virtual ~ExternalDataUseReporter(); |
| 67 | 68 |
| 68 void InitOnUIThread(); | 69 void InitOnUIThread(); |
| 69 | 70 |
| 70 // Notifies the ExternalDataUseReporter of data usage. The data use is | 71 // Notifies the ExternalDataUseReporter of data usage. The data use is |
| 71 // labeled using |data_use_tab_model_|, buffered and then reported to | 72 // labeled using |data_use_tab_model_|, buffered and then reported to |
| 72 // |external_data_use_observer_bridge_| later. | 73 // |external_data_use_observer_bridge_| later. |
| 73 void OnDataUse(const data_usage::DataUse& data_use); | 74 void OnDataUse( |
| 75 std::unique_ptr<std::deque<const data_usage::DataUse>> data_use_list); | |
|
tbansal1
2016/07/21 04:40:30
you can also mark the deque as const which will pr
Raj
2016/07/21 05:58:22
Done.
| |
| 74 | 76 |
| 75 void OnReportDataUseDone(bool success); | 77 void OnReportDataUseDone(bool success); |
| 76 | 78 |
| 77 private: | 79 private: |
| 78 friend class ExternalDataUseReporterTest; | 80 friend class ExternalDataUseReporterTest; |
| 79 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, BufferDataUseReports); | 81 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, BufferDataUseReports); |
| 80 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, BufferSize); | 82 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, BufferSize); |
| 81 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, DataUseReportTimedOut); | 83 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, DataUseReportTimedOut); |
| 82 #if defined(OS_ANDROID) | 84 #if defined(OS_ANDROID) |
| 83 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, | 85 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseReporterTest, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 base::ThreadChecker thread_checker_; | 235 base::ThreadChecker thread_checker_; |
| 234 | 236 |
| 235 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseReporter); | 237 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseReporter); |
| 236 }; | 238 }; |
| 237 | 239 |
| 238 } // namespace android | 240 } // namespace android |
| 239 | 241 |
| 240 } // namespace chrome | 242 } // namespace chrome |
| 241 | 243 |
| 242 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_REPORTER_H_ | 244 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_REPORTER_H_ |
| OLD | NEW |