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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host_impl.h

Issue 11270027: Add a ResourceScheduler to ResourceDispatcherHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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/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 8fe84385ae94f142aa13cfefae858b78694ecec7..ff478b2d23c7ac5213ec7e303af182b9ae329cd7 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_impl.h
+++ b/content/browser/renderer_host/resource_dispatcher_host_impl.h
@@ -24,8 +24,8 @@
#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_loader_impl.h"
+#include "content/browser/renderer_host/resource_loader_impl_delegate.h"
#include "content/common/content_export.h"
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/notification_types.h"
@@ -53,6 +53,7 @@ class ResourceContext;
class ResourceDispatcherHostDelegate;
class ResourceMessageFilter;
class ResourceRequestInfoImpl;
+class ResourceScheduler;
class WebContentsImpl;
struct DownloadSaveInfo;
struct GlobalRequestID;
@@ -60,7 +61,7 @@ struct Referrer;
class CONTENT_EXPORT ResourceDispatcherHostImpl
: public ResourceDispatcherHost,
- public ResourceLoaderDelegate {
+ public ResourceLoaderImplDelegate {
public:
ResourceDispatcherHostImpl();
virtual ~ResourceDispatcherHostImpl();
@@ -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(
@@ -221,23 +226,23 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
friend class ShutdownTask;
- // ResourceLoaderDelegate implementation:
+ // ResourceLoaderImplDelegate implementation:
virtual ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(
- ResourceLoader* loader,
+ ResourceLoaderImpl* loader,
net::AuthChallengeInfo* auth_info) OVERRIDE;
virtual bool AcceptAuthRequest(
- ResourceLoader* loader,
+ ResourceLoaderImpl* loader,
net::AuthChallengeInfo* auth_info) OVERRIDE;
virtual bool AcceptSSLClientCertificateRequest(
- ResourceLoader* loader,
+ ResourceLoaderImpl* loader,
net::SSLCertRequestInfo* cert_info) OVERRIDE;
- virtual bool HandleExternalProtocol(ResourceLoader* loader,
+ virtual bool HandleExternalProtocol(ResourceLoaderImpl* loader,
const GURL& url) OVERRIDE;
- virtual void DidStartRequest(ResourceLoader* loader) OVERRIDE;
- virtual void DidReceiveRedirect(ResourceLoader* loader,
+ virtual void DidStartRequest(ResourceLoaderImpl* loader) OVERRIDE;
+ virtual void DidReceiveRedirect(ResourceLoaderImpl* loader,
const GURL& new_url) OVERRIDE;
- virtual void DidReceiveResponse(ResourceLoader* loader) OVERRIDE;
- virtual void DidFinishLoading(ResourceLoader* loader) OVERRIDE;
+ virtual void DidReceiveResponse(ResourceLoaderImpl* loader) OVERRIDE;
+ virtual void DidFinishLoading(ResourceLoaderImpl* loader) OVERRIDE;
// Extracts the render view/process host's identifiers from the given request
// and places them in the given out params (both required). If there are no
@@ -261,7 +266,7 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
scoped_ptr<ResourceHandler> handler);
void StartLoading(ResourceRequestInfoImpl* info,
- const linked_ptr<ResourceLoader>& loader);
+ const linked_ptr<ResourceLoaderImpl>& loader);
// Updates the "cost" of outstanding requests for |child_id|.
// The "cost" approximates how many bytes are consumed by all the in-memory
@@ -282,7 +287,7 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
// 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;
+ typedef std::map<GlobalRequestID, linked_ptr<ResourceLoaderImpl> > LoaderMap;
// Deletes the pending request identified by the iterator passed in.
// This function will invalidate the iterator passed in. Callers should
@@ -343,8 +348,8 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
bool IsTransferredNavigation(
const GlobalRequestID& transferred_request_id) const;
- ResourceLoader* GetLoader(const GlobalRequestID& id) const;
- ResourceLoader* GetLoader(int child_id, int request_id) const;
+ ResourceLoaderImpl* GetLoader(const GlobalRequestID& id) const;
+ ResourceLoaderImpl* GetLoader(int child_id, int request_id) const;
LoaderMap pending_loaders_;
@@ -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 std::vector<linked_ptr<ResourceLoaderImpl> > 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_;
+ scoped_ptr<ResourceScheduler> resource_scheduler_;
+
DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
};

Powered by Google App Engine
This is Rietveld 408576698