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 COMPONENTS_SUBRESOURCE_FILTER_CONTENT_COMMON_DOCUMENT_LOAD_STATISTICS_H_ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_DOCUMENT_LOAD_STATISTICS_H_ |
6 #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_COMMON_DOCUMENT_LOAD_STATISTICS_H_ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_DOCUMENT_LOAD_STATISTICS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 | 11 |
12 namespace subresource_filter { | 12 namespace subresource_filter { |
13 | 13 |
14 // Contains statistics and performance metrics collected by the | 14 // Contains statistics and performance metrics collected by the |
15 // DocumentSubresourceFilter. | 15 // DocumentSubresourceFilter. |
16 struct DocumentLoadStatistics { | 16 struct DocumentLoadStatistics { |
17 // The number of subresource loads that went through the | 17 // The number of subresource loads that went through the |
18 // DocumentSubresouceFilter::allowLoad method. | 18 // DocumentSubresouceFilter filtering methods. |
19 int32_t num_loads_total = 0; | 19 int32_t num_loads_total = 0; |
20 | 20 |
21 // Statistics on the number of subresource loads that were evaluated, were | 21 // Statistics on the number of subresource loads that were evaluated, were |
22 // matched by filtering rules, and were disallowed, respectively, during the | 22 // matched by filtering rules, and were disallowed, respectively, during the |
23 // lifetime of a DocumentSubresourceFilter. | 23 // lifetime of a DocumentSubresourceFilter. |
24 int32_t num_loads_evaluated = 0; | 24 int32_t num_loads_evaluated = 0; |
25 int32_t num_loads_matching_rules = 0; | 25 int32_t num_loads_matching_rules = 0; |
26 int32_t num_loads_disallowed = 0; | 26 int32_t num_loads_disallowed = 0; |
27 | 27 |
28 // Total time spent in allowLoad() calls while evaluating subresource loads. | 28 // Total time spent in GetLoadPolicy() calls evaluating subresource loads. |
29 base::TimeDelta evaluation_total_wall_duration; | 29 base::TimeDelta evaluation_total_wall_duration; |
30 base::TimeDelta evaluation_total_cpu_duration; | 30 base::TimeDelta evaluation_total_cpu_duration; |
31 }; | 31 }; |
32 | 32 |
33 } // namespace subresource_filter | 33 } // namespace subresource_filter |
34 | 34 |
35 #endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_COMMON_DOCUMENT_LOAD_STATISTICS
_H_ | 35 #endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_DOCUMENT_LOAD_STATISTICS_H_ |
OLD | NEW |