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

Unified Diff: chrome/browser/tab_contents/interstitial_page.cc

Issue 342068: Third patch in getting rid of caching MessageLoop pointers and always using C... (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/tab_contents/interstitial_page.cc
===================================================================
--- chrome/browser/tab_contents/interstitial_page.cc (revision 30650)
+++ chrome/browser/tab_contents/interstitial_page.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/thread.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/dom_operation_notification_details.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
@@ -495,16 +496,16 @@
// The tab might not have a render_view_host if it was closed (in which case,
// we have taken care of the blocked requests when processing
// NOTIFY_RENDER_WIDGET_HOST_DESTROYED.
- // Also we need to test there is an IO thread, as when unit-tests we don't
- // have one.
+ // Also we need to test there is a ResourceDispatcherHost, as when unit-tests
+ // we don't have one.
RenderViewHost* rvh = RenderViewHost::FromID(original_child_id_,
original_rvh_id_);
- if (rvh && g_browser_process->io_thread()) {
- g_browser_process->io_thread()->message_loop()->PostTask(
- FROM_HERE, new ResourceRequestTask(original_child_id_,
- original_rvh_id_,
- action));
- }
+ if (!rvh || !g_browser_process->resource_dispatcher_host())
+ return;
+
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ new ResourceRequestTask(original_child_id_, original_rvh_id_, action));
}
// static
« no previous file with comments | « chrome/browser/sync/sync_setup_wizard_unittest.cc ('k') | chrome/browser/tab_contents/web_contents_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698