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 6eeb6f7d60d378e3f65a3ec079a2dce0472dd0cd..919ee98e69737e980ff66d8f2008ee426beaf20e 100644 |
--- a/chrome/browser/safe_browsing/client_side_detection_host.cc |
+++ b/chrome/browser/safe_browsing/client_side_detection_host.cc |
@@ -288,11 +288,16 @@ bool ClientSideDetectionHost::OnMessageReceived(const IPC::Message& message) { |
return handled; |
} |
+// Should this be DidStartLoading instead? |
mattm
2013/12/13 00:30:01
Hm, I'm not entirely sure.
The comment about "It
Greg Billock
2013/12/13 00:54:49
Yeah, that's the thing that made me worry.
mattm
2013/12/13 03:03:34
What do you mean by javascript urls? window.open?
|
+void ClientSideDetectionHost::DidStartNavigationToPendingEntry( |
+ const GURL& url, |
+ content::NavigationController::ReloadType reload_type) { |
+ malware_or_phishing_match_ = false; |
+} |
+ |
void ClientSideDetectionHost::DidNavigateMainFrame( |
const content::LoadCommittedDetails& details, |
const content::FrameNavigateParams& params) { |
- malware_or_phishing_match_ = false; |
- |
// TODO(noelutz): move this DCHECK to WebContents and fix all the unit tests |
// that don't call this method on the UI thread. |
// DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
@@ -372,6 +377,14 @@ ClientSideDetectionHost::database_manager() { |
} |
bool ClientSideDetectionHost::DidPageReceiveSafeBrowsingMatch() const { |
+ // Don't report any malware match for pending entries until they're |
+ // committed. This avoids reporting newly pending navigations as |
+ // having matched the malware filter. |
+ const NavigationEntry* nav_entry = |
+ web_contents()->GetController().GetPendingEntry(); |
+ if (nav_entry) |
+ return malware_or_phishing_match_; |
Scott Hess - ex-Googler
2013/12/12 21:28:44
I'm not sure I follow this. AFAICT, the reason yo
Greg Billock
2013/12/12 22:14:44
So in practice, the flaw I'm seeing is when switch
mattm
2013/12/13 00:30:01
It would be nice if there were tests for all the c
Greg Billock
2013/12/13 00:54:49
I think you're right. I'll take all this out and j
|
+ |
return malware_or_phishing_match_ || DidShowSBInterstitial(); |
} |