Index: components/subresource_filter/content/common/document_load_statistics.h |
diff --git a/components/subresource_filter/content/common/document_load_statistics.h b/components/subresource_filter/content/common/document_load_statistics.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e05f31666f7aab6540376cc919adc8610bbbc410 |
--- /dev/null |
+++ b/components/subresource_filter/content/common/document_load_statistics.h |
@@ -0,0 +1,35 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_COMMON_DOCUMENT_LOAD_STATISTICS_H_ |
+#define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_COMMON_DOCUMENT_LOAD_STATISTICS_H_ |
+ |
+#include <stdint.h> |
+ |
+#include "base/time/time.h" |
+ |
+namespace subresource_filter { |
+ |
+// Contains statistics and performance metrics collected by the |
+// DocumentSubresourceFilter. |
+struct DocumentLoadStatistics { |
+ // The number of subresource loads that went through the |
+ // DocumentSubresouceFilter::allowLoad method. |
+ int32_t num_loads_total = 0; |
+ |
+ // Statistics on the number of subresource loads that were evaluated, were |
+ // matched by filtering rules, and were disallowed, respectively, during the |
+ // lifetime of a DocumentSubresourceFilter. |
+ int32_t num_loads_evaluated = 0; |
+ int32_t num_loads_matching_rules = 0; |
+ int32_t num_loads_disallowed = 0; |
+ |
+ // Total time spent in allowLoad() calls while evaluating subresource loads. |
+ base::TimeDelta evaluation_total_wall_duration; |
+ base::TimeDelta evaluation_total_cpu_duration; |
+}; |
+ |
+} // namespace subresource_filter |
+ |
+#endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_COMMON_DOCUMENT_LOAD_STATISTICS_H_ |