| 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..b2d6cd42db893cea3eeb8cdabc50d3c4942b0ae6 100644
|
| --- a/content/browser/renderer_host/resource_dispatcher_host_impl.h
|
| +++ b/content/browser/renderer_host/resource_dispatcher_host_impl.h
|
| @@ -21,11 +21,13 @@
|
| #include "base/gtest_prod_util.h"
|
| #include "base/memory/linked_ptr.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/scoped_vector.h"
|
| #include "base/time.h"
|
| #include "base/timer.h"
|
| #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 +201,10 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| return delegate_;
|
| }
|
|
|
| + ResourceScheduler* scheduler() {
|
| + return &resource_scheduler_;
|
| + }
|
| +
|
| // Must be called after the ResourceRequestInfo has been created
|
| // and associated with the request.
|
| scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload(
|
| @@ -261,7 +267,7 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| scoped_ptr<ResourceHandler> handler);
|
|
|
| void StartLoading(ResourceRequestInfoImpl* info,
|
| - const linked_ptr<ResourceLoader>& loader);
|
| + scoped_ptr<ResourceLoader> loader);
|
|
|
| // Updates the "cost" of outstanding requests for |child_id|.
|
| // The "cost" approximates how many bytes are consumed by all the in-memory
|
| @@ -275,13 +281,12 @@ 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.
|
| + // 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;
|
|
|
| // Deletes the pending request identified by the iterator passed in.
|
| @@ -377,7 +382,7 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| // True if the resource dispatcher host has been shut down.
|
| bool is_shutdown_;
|
|
|
| - typedef std::vector<linked_ptr<ResourceLoader> > BlockedLoadersList;
|
| + typedef ScopedVector<ResourceLoader> BlockedLoadersList;
|
| typedef std::pair<int, int> ProcessRouteIDs;
|
| typedef std::map<ProcessRouteIDs, BlockedLoadersList*> BlockedLoadersMap;
|
| BlockedLoadersMap blocked_loaders_map_;
|
| @@ -413,6 +418,8 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| // shutdown.
|
| std::set<const ResourceContext*> active_resource_contexts_;
|
|
|
| + ResourceScheduler resource_scheduler_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
|
| };
|
|
|
|
|