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

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

Issue 2345433002: Remove Extensions.NetworkDelayStartup histogram (Closed)
Patch Set: Remove owner tag from histograms.xml Created 4 years, 3 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/histograms.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 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1607 1607
1608 activity_monitor::OnWebRequestApiUsed( 1608 activity_monitor::OnWebRequestApiUsed(
1609 static_cast<content::BrowserContext*>(browser_context), extension_id, 1609 static_cast<content::BrowserContext*>(browser_context), extension_id,
1610 blocked_request.request->url(), blocked_request.is_incognito, 1610 blocked_request.request->url(), blocked_request.is_incognito,
1611 event_name, SummarizeResponseDelta(event_name, *delta)); 1611 event_name, SummarizeResponseDelta(event_name, *delta));
1612 1612
1613 blocked_request.response_deltas.push_back( 1613 blocked_request.response_deltas.push_back(
1614 linked_ptr<helpers::EventResponseDelta>(delta)); 1614 linked_ptr<helpers::EventResponseDelta>(delta));
1615 } 1615 }
1616 1616
1617 base::TimeDelta block_time =
1618 base::Time::Now() - blocked_request.blocking_time;
1619 if (!extension_id.empty()) { 1617 if (!extension_id.empty()) {
1618 base::TimeDelta block_time =
1619 base::Time::Now() - blocked_request.blocking_time;
1620 request_time_tracker_->IncrementExtensionBlockTime( 1620 request_time_tracker_->IncrementExtensionBlockTime(
1621 extension_id, request_id, block_time); 1621 extension_id, request_id, block_time);
1622 } else {
1623 // |extension_id| is empty for requests blocked on startup waiting for the
1624 // declarative rules to be read from disk.
1625 UMA_HISTOGRAM_TIMES("Extensions.NetworkDelayStartup", block_time);
1626 } 1622 }
1627 1623
1628 if (num_handlers_blocking == 0) { 1624 if (num_handlers_blocking == 0) {
1629 blocked_request.request->LogUnblocked(); 1625 blocked_request.request->LogUnblocked();
1630 ExecuteDeltas(browser_context, request_id, true); 1626 ExecuteDeltas(browser_context, request_id, true);
1631 } else { 1627 } else {
1632 // Update the URLRequest to make sure it's tagged with an extension that's 1628 // Update the URLRequest to make sure it's tagged with an extension that's
1633 // still blocking it. This may end up being the same extension as before. 1629 // still blocking it. This may end up being the same extension as before.
1634 Listeners& listeners = listeners_[browser_context][event_name]; 1630 Listeners& listeners = listeners_[browser_context][event_name];
1635 1631
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
2266 // Since EventListeners are segmented by browser_context, check that 2262 // Since EventListeners are segmented by browser_context, check that
2267 // last, as it is exceedingly unlikely to be different. 2263 // last, as it is exceedingly unlikely to be different.
2268 return extension_id == that.extension_id && 2264 return extension_id == that.extension_id &&
2269 sub_event_name == that.sub_event_name && 2265 sub_event_name == that.sub_event_name &&
2270 web_view_instance_id == that.web_view_instance_id && 2266 web_view_instance_id == that.web_view_instance_id &&
2271 embedder_process_id == that.embedder_process_id && 2267 embedder_process_id == that.embedder_process_id &&
2272 browser_context == that.browser_context; 2268 browser_context == that.browser_context;
2273 } 2269 }
2274 2270
2275 } // namespace extensions 2271 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698