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

Unified Diff: content/common/resource_dispatcher.cc

Issue 8773007: Don't call CancelPendingRequest for synchronously answered requests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « no previous file | no next file » | 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 4bde33b9b4bc122c455d210aca06e95f7f136cef..fdce5c9c378f2208c1f4faf8ccf38d61e5be2122 100644
--- a/content/common/resource_dispatcher.cc
+++ b/content/common/resource_dispatcher.cc
@@ -73,6 +73,8 @@ class IPCResourceLoaderBridge : public ResourceLoaderBridge {
// The routing id used when sending IPC messages.
int routing_id_;
+
+ bool is_synchronous_request_;
};
IPCResourceLoaderBridge::IPCResourceLoaderBridge(
@@ -81,7 +83,8 @@ IPCResourceLoaderBridge::IPCResourceLoaderBridge(
: peer_(NULL),
dispatcher_(dispatcher),
request_id_(-1),
- routing_id_(request_info.routing_id) {
+ routing_id_(request_info.routing_id),
+ is_synchronous_request_(false) {
DCHECK(dispatcher_) << "no resource dispatcher";
request_.method = request_info.method;
request_.url = request_info.url;
@@ -190,7 +193,8 @@ void IPCResourceLoaderBridge::Cancel() {
return;
}
- dispatcher_->CancelPendingRequest(routing_id_, request_id_);
+ if (!is_synchronous_request_)
+ dispatcher_->CancelPendingRequest(routing_id_, request_id_);
// We can't remove the request ID from the resource dispatcher because more
// data might be pending. Sending the cancel message may cause more data
@@ -214,6 +218,7 @@ void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) {
}
request_id_ = MakeRequestID();
+ is_synchronous_request_ = true;
content::SyncLoadResult result;
IPC::SyncMessage* msg = new ResourceHostMsg_SyncLoad(routing_id_, request_id_,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698