diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 21:42:52 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-12 21:42:52 +0000 |
commit | eb9989097eb86b7cc6e535a1d69112b3a38a02c0 (patch) | |
tree | c9918e47c10ae09ca9d0f82928075624b10c9c2a /chrome/renderer/renderer_glue.cc | |
parent | 3e896efc285b9656fab36fa855d796b16634bd94 (diff) | |
download | chromium_src-eb9989097eb86b7cc6e535a1d69112b3a38a02c0.zip chromium_src-eb9989097eb86b7cc6e535a1d69112b3a38a02c0.tar.gz chromium_src-eb9989097eb86b7cc6e535a1d69112b3a38a02c0.tar.bz2 |
Switch to using one ResourceDispatcher per render process, and move it to ChildThread so that the same code is used by the plugin process (and soon, workers).
Review URL: http://codereview.chromium.org/42108
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/renderer_glue.cc')
-rw-r--r-- | chrome/renderer/renderer_glue.cc | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index 6cace23..117f625 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -236,18 +236,6 @@ webkit_glue::ScreenInfo GetScreenInfo(gfx::NativeViewId window) { return results; } -#ifndef USING_SIMPLE_RESOURCE_LOADER_BRIDGE - -// Each RenderView has a ResourceDispatcher. In unit tests, this function may -// not work properly since there may be a ResourceDispatcher w/o a RenderView. -// The WebView's delegate may be null, which typically happens as a WebView is -// being closed (but it is also possible that it could be null at other times -// since WebView has a SetDelegate method). -static ResourceDispatcher* GetResourceDispatcher(WebFrame* frame) { - WebViewDelegate* d = frame->GetView()->GetDelegate(); - return d ? static_cast<RenderView*>(d)->resource_dispatcher() : NULL; -} - // static factory function ResourceLoaderBridge* ResourceLoaderBridge::Create( WebFrame* webframe, @@ -268,14 +256,13 @@ ResourceLoaderBridge* ResourceLoaderBridge::Create( NOTREACHED() << "no webframe"; return NULL; } - ResourceDispatcher* dispatcher = GetResourceDispatcher(webframe); - if (!dispatcher) { - DLOG(WARNING) << "no resource dispatcher"; - return NULL; - } - return dispatcher->CreateBridge(method, url, policy_url, referrer, headers, - load_flags, origin_pid, resource_type, - mixed_content, 0); + + RenderView* rv = static_cast<RenderView*>(webframe->GetView()->GetDelegate()); + int route_id = rv->routing_id(); + ResourceDispatcher* dispatch = RenderThread::current()->resource_dispatcher(); + return dispatch->CreateBridge(method, url, policy_url, referrer, headers, + load_flags, origin_pid, resource_type, + mixed_content, 0, route_id); } void NotifyCacheStats() { @@ -286,6 +273,5 @@ void NotifyCacheStats() { RenderThread::current()->InformHostOfCacheStatsLater(); } -#endif // !USING_SIMPLE_RESOURCE_LOADER_BRIDGE } // namespace webkit_glue |