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 "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "components/subresource_filter/content/browser/content_subresource_filt er_driver.h" | 10 #include "components/subresource_filter/content/browser/content_subresource_filt er_driver.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 CreateDriverForFrameHostIfNeeded(render_frame_host); | 202 CreateDriverForFrameHostIfNeeded(render_frame_host); |
203 } | 203 } |
204 | 204 |
205 void ContentSubresourceFilterDriverFactory::RenderFrameDeleted( | 205 void ContentSubresourceFilterDriverFactory::RenderFrameDeleted( |
206 content::RenderFrameHost* render_frame_host) { | 206 content::RenderFrameHost* render_frame_host) { |
207 frame_drivers_.erase(render_frame_host); | 207 frame_drivers_.erase(render_frame_host); |
208 } | 208 } |
209 | 209 |
210 void ContentSubresourceFilterDriverFactory::ReadyToCommitNavigation( | 210 void ContentSubresourceFilterDriverFactory::ReadyToCommitNavigation( |
211 content::NavigationHandle* navigation_handle) { | 211 content::NavigationHandle* navigation_handle) { |
212 DCHECK(!navigation_handle->IsSamePage()); | 212 if (navigation_handle->IsSamePage()) |
clamy
2017/01/09 16:58:48
I don't think we want to call ReadyToCommitNavigat
arthursonzogni
2017/01/12 17:32:29
I don't know. I will filter the call to ReadyToCom
nasko
2017/01/13 02:51:09
This means that users of WebContentsObserver will
| |
213 return; | |
213 content::RenderFrameHost* render_frame_host = | 214 content::RenderFrameHost* render_frame_host = |
214 navigation_handle->GetRenderFrameHost(); | 215 navigation_handle->GetRenderFrameHost(); |
215 GURL url = navigation_handle->GetURL(); | 216 GURL url = navigation_handle->GetURL(); |
216 ReadyToCommitNavigationInternal(render_frame_host, url); | 217 ReadyToCommitNavigationInternal(render_frame_host, url); |
217 } | 218 } |
218 | 219 |
219 void ContentSubresourceFilterDriverFactory::DidFinishLoad( | 220 void ContentSubresourceFilterDriverFactory::DidFinishLoad( |
220 content::RenderFrameHost* render_frame_host, | 221 content::RenderFrameHost* render_frame_host, |
221 const GURL& validated_url) { | 222 const GURL& validated_url) { |
222 if (render_frame_host->GetParent()) | 223 if (render_frame_host->GetParent()) |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 if (!hits_pattern) | 316 if (!hits_pattern) |
316 return; | 317 return; |
317 UMA_HISTOGRAM_ENUMERATION( | 318 UMA_HISTOGRAM_ENUMERATION( |
318 "SubresourceFilter.PageLoad.RedirectChainMatchPattern", hits_pattern, | 319 "SubresourceFilter.PageLoad.RedirectChainMatchPattern", hits_pattern, |
319 0x10 /* max value */); | 320 0x10 /* max value */); |
320 UMA_HISTOGRAM_COUNTS("SubresourceFilter.PageLoad.RedirectChainLength", | 321 UMA_HISTOGRAM_COUNTS("SubresourceFilter.PageLoad.RedirectChainLength", |
321 navigation_chain_.size()); | 322 navigation_chain_.size()); |
322 } | 323 } |
323 | 324 |
324 } // namespace subresource_filter | 325 } // namespace subresource_filter |
OLD | NEW |