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

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

Issue 56135: Adding unit tests for the SafeBrowsingBlockingPage class (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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_service.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_service.cc (revision 12779)
+++ chrome/browser/safe_browsing/safe_browsing_service.cc (working copy)
@@ -264,12 +264,14 @@
if (!wc) {
// 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;
std::vector<UnsafeResource> resources;
resources.push_back(resource);
- io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
+ MessageLoop* message_loop;
+ if (g_browser_process->io_thread())
+ message_loop = g_browser_process->io_thread()->message_loop();
+ else // For unit-tests, just post on the current thread.
+ message_loop = MessageLoop::current();
+ message_loop->PostTask(FROM_HERE, NewRunnableMethod(
this, &SafeBrowsingService::OnBlockingPageDone, resources, false));
return;
}
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.h ('k') | chrome/browser/tab_contents/interstitial_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698