diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-02 05:59:37 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-02 05:59:37 +0000 |
commit | 6fad26338ed6119903826156f307e20fe6657c31 (patch) | |
tree | 5c6baed35fce907a0cea47ed6091c941db8ebfd1 /chrome/browser/tab_contents | |
parent | f75c8f13b967b01babc9454506e9d2ed00519e39 (diff) | |
download | chromium_src-6fad26338ed6119903826156f307e20fe6657c31.zip chromium_src-6fad26338ed6119903826156f307e20fe6657c31.tar.gz chromium_src-6fad26338ed6119903826156f307e20fe6657c31.tar.bz2 |
Third patch in getting rid of caching MessageLoop pointers and always using ChromeThread instead.
BUG=25354
Review URL: http://codereview.chromium.org/342068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/interstitial_page.cc | 17 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents_unittest.cc | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc index 3a6b7c6..075c809 100644 --- a/chrome/browser/tab_contents/interstitial_page.cc +++ b/chrome/browser/tab_contents/interstitial_page.cc @@ -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 @@ void InterstitialPage::TakeActionOnResourceDispatcher( // 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 diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index c99a8a8..509e295 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -50,7 +50,7 @@ class TabContentsTestingProfile : public TestingProfile { source_path = source_path.AppendASCII("profiles") .AppendASCII("chrome_prefs").AppendASCII("Preferences"); - prefs_.reset(new PrefService(source_path, NULL)); + prefs_.reset(new PrefService(source_path)); Profile::RegisterUserPrefs(prefs_.get()); browser::RegisterAllPrefs(prefs_.get(), prefs_.get()); } |