Chromium Code Reviews| Index: content/browser/renderer_host/resource_dispatcher_host_impl.h |
| diff --git a/content/browser/renderer_host/resource_dispatcher_host_impl.h b/content/browser/renderer_host/resource_dispatcher_host_impl.h |
| index a3c134f45d6f1ec0d1f278cd8f5293cc1107be49..dd61de1e00474f1c5cd28226b120d72e11b5ced3 100644 |
| --- a/content/browser/renderer_host/resource_dispatcher_host_impl.h |
| +++ b/content/browser/renderer_host/resource_dispatcher_host_impl.h |
| @@ -26,6 +26,7 @@ |
| #include "content/browser/download/download_resource_handler.h" |
| #include "content/browser/renderer_host/resource_loader.h" |
| #include "content/browser/renderer_host/resource_loader_delegate.h" |
| +#include "content/browser/renderer_host/resource_scheduler.h" |
| #include "content/common/content_export.h" |
| #include "content/public/browser/child_process_data.h" |
| #include "content/public/browser/notification_types.h" |
| @@ -199,6 +200,10 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl |
| return delegate_; |
| } |
| + ResourceScheduler* scheduler() { |
| + return resource_scheduler_.get(); |
| + } |
| + |
| // Must be called after the ResourceRequestInfo has been created |
| // and associated with the request. |
| scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( |
| @@ -275,14 +280,14 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl |
| // Estimate how much heap space |request| will consume to run. |
| static int CalculateApproximateMemoryCost(net::URLRequest* request); |
| - // The list of all requests that we have pending. This list is not really |
| + // The list of all requests that we have scheduled. This list is not really |
| // optimized, and assumes that we have relatively few requests pending at once |
| // since some operations require brute-force searching of the list. |
| // |
| - // It may be enhanced in the future to provide some kind of prioritization |
| - // mechanism. We should also consider a hashtable or binary tree if it turns |
| - // out we have a lot of things here. |
| - typedef std::map<GlobalRequestID, linked_ptr<ResourceLoader> > LoaderMap; |
| + // We should also consider a hashtable or binary tree if it turns out we have |
| + // a lot of things here. |
| + typedef std::map< |
| + GlobalRequestID, linked_ptr<ResourceScheduler::LoadHandle> > LoaderMap; |
| // Deletes the pending request identified by the iterator passed in. |
| // This function will invalidate the iterator passed in. Callers should |
| @@ -413,6 +418,8 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl |
| // shutdown. |
| std::set<const ResourceContext*> active_resource_contexts_; |
| + scoped_ptr<ResourceScheduler> resource_scheduler_; |
|
willchan no longer on Chromium
2012/11/21 09:04:30
Why bother with a scoped_ptr?
James Simonsen
2012/11/27 02:20:51
I thought the leak checker would complain during t
willchan no longer on Chromium
2012/11/30 10:16:20
No, I mean, why isn't the whole object just embedd
|
| + |
| DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| }; |