summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 21:42:52 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 21:42:52 +0000
commiteb9989097eb86b7cc6e535a1d69112b3a38a02c0 (patch)
treec9918e47c10ae09ca9d0f82928075624b10c9c2a /chrome/renderer
parent3e896efc285b9656fab36fa855d796b16634bd94 (diff)
downloadchromium_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')
-rw-r--r--chrome/renderer/render_view.cc6
-rw-r--r--chrome/renderer/render_view.h9
-rw-r--r--chrome/renderer/renderer_glue.cc28
3 files changed, 7 insertions, 36 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index e098199..eb0ccf7 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -191,7 +191,6 @@ RenderView::RenderView(RenderThreadBase* render_thread)
form_field_autofill_request_id_(0),
popup_notification_visible_(false),
delay_seconds_for_form_state_sync_(kDefaultDelaySecondsForFormStateSync) {
- resource_dispatcher_ = new ResourceDispatcher(this);
#ifdef CHROME_PERSONALIZATION
personalization_ = Personalization::CreateRendererPersonalization();
#endif
@@ -201,7 +200,6 @@ RenderView::~RenderView() {
if (decrement_shared_popup_at_destruction_)
shared_popup_counter_->data--;
- resource_dispatcher_->ClearMessageSender();
// Clear any back-pointers that might still be held by plugins.
PluginDelegateList::iterator it = plugin_delegates_.begin();
while (it != plugin_delegates_.end()) {
@@ -342,10 +340,6 @@ void RenderView::OnMessageReceived(const IPC::Message& message) {
main_frame ? main_frame->GetURL() : GURL());
#endif
- // Let the resource dispatcher intercept resource messages first.
- if (resource_dispatcher_->OnMessageReceived(message))
- return;
-
// If this is developer tools renderer intercept tools messages first.
if (dev_tools_client_.get() && dev_tools_client_->OnMessageReceived(message))
return;
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 9a0ec22..29c262d7 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -16,7 +16,6 @@
#include "base/timer.h"
#include "base/values.h"
#include "build/build_config.h"
-#include "chrome/common/resource_dispatcher.h"
#ifdef CHROME_PERSONALIZATION
#include "chrome/personalization/personalization.h"
#endif
@@ -117,11 +116,6 @@ class RenderView : public RenderWidget,
// Sets the "next page id" counter.
static void SetNextPageID(int32 next_page_id);
- // The resource dispatcher used to fetch resources for this view.
- ResourceDispatcher* resource_dispatcher() {
- return resource_dispatcher_;
- }
-
// May return NULL when the view is closing.
WebView* webview() const {
return static_cast<WebView*>(webwidget());
@@ -619,9 +613,6 @@ class RenderView : public RenderWidget,
// A helper method used by WasOpenedByUserGesture.
bool WasOpenedByUserGestureHelper() const;
- // Handles resource loads for this view.
- scoped_refptr<ResourceDispatcher> resource_dispatcher_;
-
// Bitwise-ORed set of extra bindings that have been enabled. See
// BindingsPolicy for details.
int enabled_bindings_;
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