Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(688)

Unified Diff: components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h

Issue 2581043003: Add page-level aggregation of SubresourceFilter time metrics. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
index ad4863bebc547f3f314e37b9202e7eb86693d937..b4b01b6c3c0a27437ab2792b852889c428a2a335 100644
--- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
+++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/supports_user_data.h"
+#include "base/time/time.h"
#include "components/safe_browsing_db/util.h"
#include "content/public/browser/web_contents_observer.h"
#include "url/gurl.h"
@@ -91,6 +92,10 @@ class ContentSubresourceFilterDriverFactory
void OnFirstSubresourceLoadDisallowed();
+ void OnEvaluationDurationAggregated(
+ base::TimeDelta evaluation_total_wall_duration,
+ base::TimeDelta evaluation_total_cpu_duration);
+
bool IsWhitelisted(const GURL& url) const;
// content::WebContentsObserver:
@@ -102,6 +107,8 @@ class ContentSubresourceFilterDriverFactory
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
void ReadyToCommitNavigation(
content::NavigationHandle* navigation_handle) override;
+ void DidFinishLoad(content::RenderFrameHost* render_frame_host,
+ const GURL& validated_url) override;
bool OnMessageReceived(const IPC::Message& message,
content::RenderFrameHost* render_frame_host) override;
@@ -135,6 +142,11 @@ class ContentSubresourceFilterDriverFactory
URLToActivationListsMap activation_list_matches_;
+ // Total time spent in DocumentSubresourceFilter::allowLoad() calls while
engedy 2016/12/19 10:18:42 nit: .... calls, aggregated across all frames, eva
pkalinnikov 2016/12/21 15:28:46 Done.
+ // evaluating subresource loads for the current document.
engedy 2016/12/19 10:18:42 nit: s/document/page load/
pkalinnikov 2016/12/21 15:28:46 Done.
+ base::TimeDelta evaluation_total_wall_duration_;
+ base::TimeDelta evaluation_total_cpu_duration_;
+
DISALLOW_COPY_AND_ASSIGN(ContentSubresourceFilterDriverFactory);
};

Powered by Google App Engine
This is Rietveld 408576698