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

Unified Diff: content/common/resource_dispatcher.cc

Issue 11270027: Add a ResourceScheduler to ResourceDispatcherHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move Client back to .h -- broke Win Created 7 years, 10 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
« no previous file with comments | « content/common/resource_dispatcher.h ('k') | content/common/resource_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/resource_dispatcher.cc
diff --git a/content/common/resource_dispatcher.cc b/content/common/resource_dispatcher.cc
index ce49f4e133b1f5fe7803db278b160627de6edd27..45109670f2339fa3c2f9493154ab36d68403d6a8 100644
--- a/content/common/resource_dispatcher.cc
+++ b/content/common/resource_dispatcher.cc
@@ -22,6 +22,7 @@
#include "content/public/common/resource_response.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
+#include "net/base/request_priority.h"
#include "net/http/http_response_headers.h"
#include "webkit/glue/resource_request_body.h"
#include "webkit/glue/resource_type.h"
@@ -62,6 +63,7 @@ class IPCResourceLoaderBridge : public ResourceLoaderBridge {
virtual bool Start(Peer* peer) OVERRIDE;
virtual void Cancel() OVERRIDE;
virtual void SetDefersLoading(bool value) OVERRIDE;
+ virtual void DidChangePriority(net::RequestPriority new_priority) OVERRIDE;
virtual void SyncLoad(SyncLoadResponse* response) OVERRIDE;
private:
@@ -193,6 +195,16 @@ void IPCResourceLoaderBridge::SetDefersLoading(bool value) {
dispatcher_->SetDefersLoading(request_id_, value);
}
+void IPCResourceLoaderBridge::DidChangePriority(
+ net::RequestPriority new_priority) {
+ if (request_id_ < 0) {
+ NOTREACHED() << "Trying to change priority of an unstarted request";
+ return;
+ }
+
+ dispatcher_->DidChangePriority(routing_id_, request_id_, new_priority);
+}
+
void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) {
if (request_id_ != -1) {
NOTREACHED() << "Starting a request twice";
@@ -549,6 +561,13 @@ void ResourceDispatcher::SetDefersLoading(int request_id, bool value) {
}
}
+void ResourceDispatcher::DidChangePriority(
+ int routing_id, int request_id, net::RequestPriority new_priority) {
+ DCHECK(ContainsKey(pending_requests_, request_id));
+ message_sender()->Send(new ResourceHostMsg_DidChangePriority(
+ routing_id, request_id, new_priority));
+}
+
ResourceDispatcher::PendingRequestInfo::PendingRequestInfo()
: peer(NULL),
resource_type(ResourceType::SUB_RESOURCE),
« no previous file with comments | « content/common/resource_dispatcher.h ('k') | content/common/resource_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698