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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc

Issue 273022: Fixing a bug with interstitial pages triggered with malware.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_blocking_page.cc (revision 28624)
+++ chrome/browser/safe_browsing/safe_browsing_blocking_page.cc (working copy)
@@ -461,7 +461,18 @@
TabContents* tab_contents = tab_util::GetTabContentsByID(
unsafe_resource.render_process_host_id, unsafe_resource.render_view_id);
- if (!InterstitialPage::GetInterstitialPage(tab_contents)) {
+ InterstitialPage* interstitial =
+ InterstitialPage::GetInterstitialPage(tab_contents);
+ if (interstitial &&
+ unsafe_resource.resource_type == ResourceType::MAIN_FRAME) {
+ // There is already an interstitial showing and we are about to display a
+ // new one for the main frame. Just hide the current one, it is now
+ // irrelevent
+ interstitial->DontProceed();
+ interstitial = NULL;
+ }
+
+ if (!interstitial) {
// There are no interstitial currently showing in that tab, go ahead and
// show this interstitial.
std::vector<SafeBrowsingService::UnsafeResource> resources;
@@ -476,9 +487,7 @@
return;
}
- // Let's queue the interstitial.
- // Note we only expect resources from the page at this point.
- DCHECK(unsafe_resource.resource_type != ResourceType::MAIN_FRAME);
+ // This is an interstitial for a page's resource, let's queue it.
UnsafeResourceMap* unsafe_resource_map = GetUnsafeResourcesMap();
(*unsafe_resource_map)[tab_contents].push_back(unsafe_resource);
}

Powered by Google App Engine
This is Rietveld 408576698