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

Side by Side Diff: extensions/browser/api/web_request/web_request_api.cc

Issue 2858403002: Extensions: Add UMA to monitor whether a webview request has DWR rules to be evaluated. (Closed)
Patch Set: Rebase Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "extensions/browser/api/web_request/web_request_api.h" 5 #include "extensions/browser/api/web_request/web_request_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 BlockedRequest& blocked_request = blocked_requests_[request->identifier()]; 1992 BlockedRequest& blocked_request = blocked_requests_[request->identifier()];
1993 blocked_request.num_handlers_blocking++; 1993 blocked_request.num_handlers_blocking++;
1994 blocked_request.request = request; 1994 blocked_request.request = request;
1995 blocked_request.is_incognito |= IsIncognitoBrowserContext(browser_context); 1995 blocked_request.is_incognito |= IsIncognitoBrowserContext(browser_context);
1996 blocked_request.blocking_time = base::Time::Now(); 1996 blocked_request.blocking_time = base::Time::Now();
1997 blocked_request.original_response_headers = original_response_headers; 1997 blocked_request.original_response_headers = original_response_headers;
1998 blocked_request.extension_info_map = extension_info_map; 1998 blocked_request.extension_info_map = extension_info_map;
1999 return true; 1999 return true;
2000 } 2000 }
2001 2001
2002 if (is_web_view_guest) {
2003 const bool has_declarative_rules = !relevant_registries.empty();
2004 UMA_HISTOGRAM_BOOLEAN(
2005 "Extensions.DeclarativeWebRequest.WebViewRequestDeclarativeRules",
lazyboy 2017/05/05 17:46:45 relevant_registries.empty() == true doesn't necess
karandeepb 2017/05/05 18:40:27 Have removed the usage of the word applicable and
2006 has_declarative_rules);
2007 }
2008
2002 base::Time start = base::Time::Now(); 2009 base::Time start = base::Time::Now();
2003 2010
2004 bool deltas_created = false; 2011 bool deltas_created = false;
2005 for (const auto& it : relevant_registries) { 2012 for (const auto& it : relevant_registries) {
2006 WebRequestRulesRegistry* rules_registry = it.first; 2013 WebRequestRulesRegistry* rules_registry = it.first;
2007 helpers::EventResponseDeltas result = rules_registry->CreateDeltas( 2014 helpers::EventResponseDeltas result = rules_registry->CreateDeltas(
2008 extension_info_map, 2015 extension_info_map,
2009 WebRequestData(request, request_stage, navigation_ui_data, 2016 WebRequestData(request, request_stage, navigation_ui_data,
2010 original_response_headers), 2017 original_response_headers),
2011 it.second); 2018 it.second);
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 // Since EventListeners are segmented by browser_context, check that 2441 // Since EventListeners are segmented by browser_context, check that
2435 // last, as it is exceedingly unlikely to be different. 2442 // last, as it is exceedingly unlikely to be different.
2436 return extension_id == that.extension_id && 2443 return extension_id == that.extension_id &&
2437 sub_event_name == that.sub_event_name && 2444 sub_event_name == that.sub_event_name &&
2438 web_view_instance_id == that.web_view_instance_id && 2445 web_view_instance_id == that.web_view_instance_id &&
2439 embedder_process_id == that.embedder_process_id && 2446 embedder_process_id == that.embedder_process_id &&
2440 browser_context == that.browser_context; 2447 browser_context == that.browser_context;
2441 } 2448 }
2442 2449
2443 } // namespace extensions 2450 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698