summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/safe_browsing_service.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-19 00:42:30 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-19 00:42:30 +0000
commita3a1d14240d6e41a0b6732ebcd3600399c64b26a (patch)
treea38ced2761bdf4447bf180470fd5dade857ef11b /chrome/browser/safe_browsing/safe_browsing_service.cc
parent5b62083c99317965244123c031c707d53f0a03f1 (diff)
downloadchromium_src-a3a1d14240d6e41a0b6732ebcd3600399c64b26a.zip
chromium_src-a3a1d14240d6e41a0b6732ebcd3600399c64b26a.tar.gz
chromium_src-a3a1d14240d6e41a0b6732ebcd3600399c64b26a.tar.bz2
Review URL: http://codereview.chromium.org/14809
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/safe_browsing_service.cc')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_service.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index 837c11f..5a7a617 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/safe_browsing/protocol_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
#include "chrome/browser/safe_browsing/safe_browsing_database.h"
+#include "chrome/browser/tab_util.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -281,6 +282,20 @@ void SafeBrowsingService::DisplayBlockingPage(const GURL& url,
// Invoked on the UI thread.
void SafeBrowsingService::DoDisplayBlockingPage(
const BlockingPageParam& param) {
+ // The tab might have been closed.
+ if (!tab_util::GetWebContentsByID(param.render_process_host_id,
+ param.render_view_id)) {
+ // The tab is gone and we did not have a chance at showing the interstitial.
+ // Just act as "Don't Proceed" was chosen.
+ base::Thread* io_thread = g_browser_process->io_thread();
+ if (!io_thread)
+ return;
+ BlockingPageParam response_param = param;
+ response_param.proceed = false;
+ io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
+ this, &SafeBrowsingService::OnBlockingPageDone, response_param));
+ return;
+ }
SafeBrowsingBlockingPage* blocking_page = new SafeBrowsingBlockingPage(this,
param);
blocking_page->Show();