OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" | 5 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver.h" | 9 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver.h" |
10 #include "components/subresource_filter/content/common/subresource_filter_messag
es.h" | 10 #include "components/subresource_filter/content/common/subresource_filter_messag
es.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 DCHECK(driver); | 134 DCHECK(driver); |
135 driver->ActivateForProvisionalLoad(GetMaximumActivationState(), url, | 135 driver->ActivateForProvisionalLoad(GetMaximumActivationState(), url, |
136 measure_performance_); | 136 measure_performance_); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 void ContentSubresourceFilterDriverFactory::OnReloadRequested() { | 140 void ContentSubresourceFilterDriverFactory::OnReloadRequested() { |
141 UMA_HISTOGRAM_BOOLEAN("SubresourceFilter.Prompt.NumReloads", true); | 141 UMA_HISTOGRAM_BOOLEAN("SubresourceFilter.Prompt.NumReloads", true); |
142 const GURL& whitelist_url = web_contents()->GetLastCommittedURL(); | 142 const GURL& whitelist_url = web_contents()->GetLastCommittedURL(); |
143 AddHostOfURLToWhitelistSet(whitelist_url); | 143 AddHostOfURLToWhitelistSet(whitelist_url); |
144 web_contents()->GetController().Reload(true); | 144 web_contents()->GetController().Reload(content::ReloadType::NORMAL, true); |
145 } | 145 } |
146 | 146 |
147 void ContentSubresourceFilterDriverFactory::SetDriverForFrameHostForTesting( | 147 void ContentSubresourceFilterDriverFactory::SetDriverForFrameHostForTesting( |
148 content::RenderFrameHost* render_frame_host, | 148 content::RenderFrameHost* render_frame_host, |
149 std::unique_ptr<ContentSubresourceFilterDriver> driver) { | 149 std::unique_ptr<ContentSubresourceFilterDriver> driver) { |
150 auto iterator_and_inserted = | 150 auto iterator_and_inserted = |
151 frame_drivers_.insert(std::make_pair(render_frame_host, nullptr)); | 151 frame_drivers_.insert(std::make_pair(render_frame_host, nullptr)); |
152 iterator_and_inserted.first->second = std::move(driver); | 152 iterator_and_inserted.first->second = std::move(driver); |
153 } | 153 } |
154 | 154 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 if (!hits_pattern) | 273 if (!hits_pattern) |
274 return; | 274 return; |
275 UMA_HISTOGRAM_ENUMERATION( | 275 UMA_HISTOGRAM_ENUMERATION( |
276 "SubresourceFilter.PageLoad.RedirectChainMatchPattern", hits_pattern, | 276 "SubresourceFilter.PageLoad.RedirectChainMatchPattern", hits_pattern, |
277 0x10 /* max value */); | 277 0x10 /* max value */); |
278 UMA_HISTOGRAM_COUNTS("SubresourceFilter.PageLoad.RedirectChainLength", | 278 UMA_HISTOGRAM_COUNTS("SubresourceFilter.PageLoad.RedirectChainLength", |
279 navigation_chain_.size()); | 279 navigation_chain_.size()); |
280 } | 280 } |
281 | 281 |
282 } // namespace subresource_filter | 282 } // namespace subresource_filter |
OLD | NEW |