Chromium Code Reviews| Index: chrome/browser/safe_browsing/client_side_detection_host.cc |
| diff --git a/chrome/browser/safe_browsing/client_side_detection_host.cc b/chrome/browser/safe_browsing/client_side_detection_host.cc |
| index ef73fb4f7265b6025066d1d1a4cf19a19d84220b..ef03f96da019e52a9545503bb0728e3027cc10fb 100644 |
| --- a/chrome/browser/safe_browsing/client_side_detection_host.cc |
| +++ b/chrome/browser/safe_browsing/client_side_detection_host.cc |
| @@ -405,7 +405,7 @@ void ClientSideDetectionHost::DidNavigateMainFrame( |
| void ClientSideDetectionHost::OnSafeBrowsingHit( |
| const SafeBrowsingUIManager::UnsafeResource& resource) { |
| - if (!web_contents() || !web_contents()->GetController().GetActiveEntry()) |
| + if (!web_contents()) |
|
Charlie Reis
2015/12/11 05:39:24
Unfortunately, you might still need a null check o
Nathan Parker
2015/12/11 19:48:06
How is web_contents_ different from what resource.
Charlie Reis
2015/12/11 21:10:04
resource.GetNavigationEntryForResource() handles t
mattm
2015/12/15 01:42:25
The UnsafeResource doesn't really have any enforce
mattm
2015/12/15 01:42:25
Thanks, done.
|
| return; |
| // Check that the hit is either malware or phishing. |
| @@ -422,7 +422,7 @@ void ClientSideDetectionHost::OnSafeBrowsingHit( |
| // Store the unique page ID for later. |
| unsafe_unique_page_id_ = |
| - web_contents()->GetController().GetActiveEntry()->GetUniqueID(); |
| + resource.GetNavigationEntryForResource()->GetUniqueID(); |
| // We also keep the resource around in order to be able to send the |
| // malicious URL to the server. |
| @@ -674,7 +674,7 @@ bool ClientSideDetectionHost::DidShowSBInterstitial() const { |
| return false; |
| } |
| const NavigationEntry* nav_entry = |
| - web_contents()->GetController().GetActiveEntry(); |
| + web_contents()->GetController().GetLastCommittedEntry(); |
|
Charlie Reis
2015/12/11 05:39:24
Is this meant to be called while the interstitial
mattm
2015/12/15 01:42:25
If the interstitial was a blocking main page load,
|
| return (nav_entry && nav_entry->GetUniqueID() == unsafe_unique_page_id_); |
| } |