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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 11270027: Add a ResourceScheduler to ResourceDispatcherHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove all linked_ptrs Created 8 years 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: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index a9d26ff50c011def86cdde1d22d276b9f61781cc..0e781f62d327eba2bbb6c852d190aa0e329ccdcd 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -56,7 +56,10 @@
#include "content/browser/hyphenator/hyphenator_message_filter.h"
#include "content/browser/in_process_webkit/indexed_db_context_impl.h"
#include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h"
+#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/loader/resource_message_filter.h"
+#include "content/browser/loader/resource_scheduler.h"
+#include "content/browser/loader/resource_scheduler_filter.h"
#include "content/browser/mime_registry_message_filter.h"
#include "content/browser/plugin_service_impl.h"
#include "content/browser/profiler_message_filter.h"
@@ -479,6 +482,7 @@ bool RenderProcessHostImpl::Init() {
void RenderProcessHostImpl::CreateMessageFilters() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ channel_->AddFilter(new ResourceSchedulerFilter(GetID()));
MediaObserver* media_observer =
GetContentClient()->browser()->GetMediaObserver();
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
@@ -1104,6 +1108,10 @@ bool RenderProcessHostImpl::IgnoreInputEvents() const {
void RenderProcessHostImpl::Attach(RenderWidgetHost* host,
int routing_id) {
render_widget_hosts_.AddWithID(host, routing_id);
+ if (ResourceDispatcherHostImpl::Get()) {
+ ResourceDispatcherHostImpl::Get()->scheduler()->OnCreate(
darin (slow to review) 2012/12/14 22:16:28 Isn't there some potential raciness here? I could
James Simonsen 2012/12/15 02:58:57 Done.
+ GetID(), routing_id);
+ }
}
void RenderProcessHostImpl::Release(int routing_id) {
@@ -1455,6 +1463,10 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead) {
ViewHostMsg_RenderViewGone(iter.GetCurrentKey(),
static_cast<int>(status),
exit_code));
+ if (ResourceDispatcherHostImpl::Get()) {
+ ResourceDispatcherHostImpl::Get()->scheduler()->OnDestroy(
+ GetID(), iter.GetCurrentKey());
+ }
iter.Advance();
}

Powered by Google App Engine
This is Rietveld 408576698