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

Unified Diff: chrome/browser/extensions/api/web_request/web_request_api.cc

Issue 12230017: Declarative WR: Enable and measure request blocking until registries are loaded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/web_request/web_request_api.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc
index f4caa2571b3311d4cd5710bbc2a9f883752341d4..7a09ec4b7ab5aab415b81499864d8ed3e55ba13a 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api.cc
@@ -1634,10 +1634,8 @@ bool ExtensionWebRequestEventRouter::ProcessDeclarativeRules(
std::make_pair(rules_registries_[cross_profile].get(), true));
}
- // TODO(mpcomplete): Eventually we'll want to turn this on, but for now,
- // we won't block startup for declarative webrequest. I want to measure
- // its effect first.
-#if defined(BLOCK_STARTUP_ON_DECLARATIVE_RULES)
+ // The following block is experimentally enabled and its impact on load time
+ // logged with UMA Extensions.NetworkDelayRegistryLoad. crbug.com/175961
for (RelevantRegistries::iterator i = relevant_registries.begin();
i != relevant_registries.end(); ++i) {
extensions::WebRequestRulesRegistry* rules_registry = i->first;
@@ -1659,7 +1657,6 @@ bool ExtensionWebRequestEventRouter::ProcessDeclarativeRules(
return true;
}
}
-#endif
base::Time start = base::Time::Now();
@@ -1701,6 +1698,10 @@ void ExtensionWebRequestEventRouter::OnRulesRegistryReady(
return;
BlockedRequest& blocked_request = blocked_requests_[request_id];
+ base::TimeDelta block_time =
+ base::Time::Now() - blocked_request.blocking_time;
+ UMA_HISTOGRAM_TIMES("Extensions.NetworkDelayRegistryLoad", block_time);
+
ProcessDeclarativeRules(profile, blocked_request.extension_info_map,
event_name, blocked_request.request, request_stage,
blocked_request.original_response_headers);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698