Commit f465319a authored by jam@chromium.org's avatar jam@chromium.org

Convert a bunch of resource IPCs to be control messages. They didn't need to be routed.

BUG=286074
R=ajwong@chromium.org

Review URL: https://codereview.chromium.org/23583039

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221751 0039d316-1c4b-4281-b951-d872f2087c98
parent b926d6a8
......@@ -78,12 +78,10 @@ class DependentIOBuffer : public net::WrappedIOBuffer {
AsyncResourceHandler::AsyncResourceHandler(
ResourceMessageFilter* filter,
int routing_id,
net::URLRequest* request,
ResourceDispatcherHostImpl* rdh)
: ResourceMessageDelegate(request),
filter_(filter),
routing_id_(routing_id),
request_(request),
rdh_(rdh),
pending_data_count_(0),
......@@ -139,8 +137,8 @@ void AsyncResourceHandler::OnDataReceivedACK(int request_id) {
bool AsyncResourceHandler::OnUploadProgress(int request_id,
uint64 position,
uint64 size) {
return filter_->Send(new ResourceMsg_UploadProgress(routing_id_, request_id,
position, size));
return filter_->Send(new ResourceMsg_UploadProgress(request_id, position,
size));
}
bool AsyncResourceHandler::OnRequestRedirected(int request_id,
......@@ -159,7 +157,7 @@ bool AsyncResourceHandler::OnRequestRedirected(int request_id,
response->head.request_start = request_->creation_time();
response->head.response_start = TimeTicks::Now();
return filter_->Send(new ResourceMsg_ReceivedRedirect(
routing_id_, request_id, new_url, response->head));
request_id, new_url, response->head));
}
bool AsyncResourceHandler::OnResponseStarted(int request_id,
......@@ -194,16 +192,14 @@ bool AsyncResourceHandler::OnResponseStarted(int request_id,
response->head.request_start = request_->creation_time();
response->head.response_start = TimeTicks::Now();
filter_->Send(new ResourceMsg_ReceivedResponse(
routing_id_, request_id, response->head));
filter_->Send(new ResourceMsg_ReceivedResponse(request_id, response->head));
sent_received_response_msg_ = true;
if (request_->response_info().metadata.get()) {
std::vector<char> copy(request_->response_info().metadata->data(),
request_->response_info().metadata->data() +
request_->response_info().metadata->size());
filter_->Send(new ResourceMsg_ReceivedCachedMetadata(
routing_id_, request_id, copy));
filter_->Send(new ResourceMsg_ReceivedCachedMetadata(request_id, copy));
}
return true;
......@@ -254,9 +250,8 @@ bool AsyncResourceHandler::OnReadCompleted(int request_id, int bytes_read,
int size;
if (!buffer_->ShareToProcess(filter_->PeerHandle(), &handle, &size))
return false;
filter_->Send(
new ResourceMsg_SetDataBuffer(routing_id_, request_id, handle, size,
filter_->peer_pid()));
filter_->Send(new ResourceMsg_SetDataBuffer(
request_id, handle, size, filter_->peer_pid()));
sent_first_data_msg_ = true;
}
......@@ -264,9 +259,8 @@ bool AsyncResourceHandler::OnReadCompleted(int request_id, int bytes_read,
int encoded_data_length =
DevToolsNetLogObserver::GetAndResetEncodedDataLength(request_);
filter_->Send(
new ResourceMsg_DataReceived(routing_id_, request_id, data_offset,
bytes_read, encoded_data_length));
filter_->Send(new ResourceMsg_DataReceived(
request_id, data_offset, bytes_read, encoded_data_length));
++pending_data_count_;
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Net.AsyncResourceHandler_PendingDataCount",
......@@ -288,7 +282,7 @@ void AsyncResourceHandler::OnDataDownloaded(
DevToolsNetLogObserver::GetAndResetEncodedDataLength(request_);
filter_->Send(new ResourceMsg_DataDownloaded(
routing_id_, request_id, bytes_downloaded, encoded_data_length));
request_id, bytes_downloaded, encoded_data_length));
}
bool AsyncResourceHandler::OnResponseCompleted(
......@@ -331,8 +325,7 @@ bool AsyncResourceHandler::OnResponseCompleted(
error_code = net::ERR_FAILED;
}
filter_->Send(new ResourceMsg_RequestComplete(routing_id_,
request_id,
filter_->Send(new ResourceMsg_RequestComplete(request_id,
error_code,
was_ignored_by_handler,
security_info,
......
......@@ -28,7 +28,6 @@ class AsyncResourceHandler : public ResourceHandler,
public ResourceMessageDelegate {
public:
AsyncResourceHandler(ResourceMessageFilter* filter,
int routing_id,
net::URLRequest* request,
ResourceDispatcherHostImpl* rdh);
virtual ~AsyncResourceHandler();
......@@ -75,7 +74,6 @@ class AsyncResourceHandler : public ResourceHandler,
scoped_refptr<ResourceBuffer> buffer_;
scoped_refptr<ResourceMessageFilter> filter_;
int routing_id_;
net::URLRequest* request_;
ResourceDispatcherHostImpl* rdh_;
......
......@@ -138,7 +138,6 @@ const int kAllNetErrorCodes[] = {
// Aborts a request before an URLRequest has actually been created.
void AbortRequestBeforeItStarts(ResourceMessageFilter* filter,
IPC::Message* sync_result,
int route_id,
int request_id) {
if (sync_result) {
SyncLoadResult result;
......@@ -148,7 +147,6 @@ void AbortRequestBeforeItStarts(ResourceMessageFilter* filter,
} else {
// Tell the renderer that this request was disallowed.
filter->Send(new ResourceMsg_RequestComplete(
route_id,
request_id,
net::ERR_ABORTED,
false,
......@@ -929,7 +927,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
if (is_shutdown_ ||
!ShouldServiceRequest(process_type, child_id, request_data,
filter_->file_system_context())) {
AbortRequestBeforeItStarts(filter_, sync_result, route_id, request_id);
AbortRequestBeforeItStarts(filter_, sync_result, request_id);
return;
}
......@@ -942,7 +940,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
request_data.url,
request_data.resource_type,
resource_context)) {
AbortRequestBeforeItStarts(filter_, sync_result, route_id, request_id);
AbortRequestBeforeItStarts(filter_, sync_result, request_id);
return;
}
......@@ -1041,8 +1039,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
handler.reset(new SyncResourceHandler(
filter_, request, sync_result, this));
} else {
handler.reset(new AsyncResourceHandler(
filter_, route_id, request, this));
handler.reset(new AsyncResourceHandler(filter_, request, this));
}
// The RedirectToFileResourceHandler depends on being next in the chain.
......
......@@ -708,7 +708,7 @@ class ResourceDispatcherHostTest : public testing::Test,
bool result = PickleIterator(msg).ReadInt(&request_id);
DCHECK(result);
scoped_ptr<IPC::Message> ack(
new ResourceHostMsg_DataReceived_ACK(msg.routing_id(), request_id));
new ResourceHostMsg_DataReceived_ACK(request_id));
base::MessageLoop::current()->PostTask(
FROM_HERE,
......@@ -1609,7 +1609,7 @@ TEST_F(ResourceDispatcherHostTest, IgnoreCancelForDownloads) {
EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage());
// And now simulate a cancellation coming from the renderer.
ResourceHostMsg_CancelRequest msg(filter_->child_id(), request_id);
ResourceHostMsg_CancelRequest msg(request_id);
bool msg_was_ok;
host_.OnMessageReceived(msg, filter_.get(), &msg_was_ok);
......@@ -1644,7 +1644,7 @@ TEST_F(ResourceDispatcherHostTest, CancelRequestsForContext) {
EXPECT_TRUE(net::URLRequestTestJob::ProcessOnePendingMessage());
// And now simulate a cancellation coming from the renderer.
ResourceHostMsg_CancelRequest msg(filter_->child_id(), request_id);
ResourceHostMsg_CancelRequest msg(request_id);
bool msg_was_ok;
host_.OnMessageReceived(msg, filter_.get(), &msg_was_ok);
......@@ -1685,7 +1685,7 @@ TEST_F(ResourceDispatcherHostTest, CancelRequestsForContextTransferred) {
GURL("http://example.com/blah"));
// And now simulate a cancellation coming from the renderer.
ResourceHostMsg_CancelRequest msg(filter_->child_id(), request_id);
ResourceHostMsg_CancelRequest msg(request_id);
bool msg_was_ok;
host_.OnMessageReceived(msg, filter_.get(), &msg_was_ok);
......@@ -1832,7 +1832,7 @@ TEST_F(ResourceDispatcherHostTest, TransferNavigationAndThenRedirect) {
// Now, simulate the renderer choosing to follow the redirect.
ResourceHostMsg_FollowRedirect redirect_msg(
new_render_view_id, new_request_id, false, GURL());
new_request_id, false, GURL());
host_.OnMessageReceived(redirect_msg, second_filter.get(), &msg_was_ok);
base::MessageLoop::current()->RunUntilIdle();
......@@ -1938,7 +1938,7 @@ TEST_F(ResourceDispatcherHostTest, DelayedDataReceivedACKs) {
EXPECT_EQ(ResourceMsg_DataReceived::ID, msgs[0][i].type());
ResourceHostMsg_DataReceived_ACK msg(0, 1);
ResourceHostMsg_DataReceived_ACK msg(1);
bool msg_was_ok;
host_.OnMessageReceived(msg, filter_.get(), &msg_was_ok);
}
......@@ -1973,7 +1973,7 @@ TEST_F(ResourceDispatcherHostTest, DataReceivedUnexpectedACKs) {
// Send some unexpected ACKs.
for (size_t i = 0; i < 128; ++i) {
ResourceHostMsg_DataReceived_ACK msg(0, 1);
ResourceHostMsg_DataReceived_ACK msg(1);
bool msg_was_ok;
host_.OnMessageReceived(msg, filter_.get(), &msg_was_ok);
}
......@@ -1992,7 +1992,7 @@ TEST_F(ResourceDispatcherHostTest, DataReceivedUnexpectedACKs) {
EXPECT_EQ(ResourceMsg_DataReceived::ID, msgs[0][i].type());
ResourceHostMsg_DataReceived_ACK msg(0, 1);
ResourceHostMsg_DataReceived_ACK msg(1);
bool msg_was_ok;
host_.OnMessageReceived(msg, filter_.get(), &msg_was_ok);
}
......
......@@ -193,8 +193,7 @@ class ResourceSchedulerTest : public testing::Test {
const ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(
request->url_request());
const GlobalRequestID& id = info->GetGlobalRequestID();
ResourceHostMsg_DidChangePriority msg(
kRouteId, id.request_id, new_priority);
ResourceHostMsg_DidChangePriority msg(id.request_id, new_priority);
bool ok = false;
rdh_.OnMessageReceived(msg, filter.get(), &ok);
EXPECT_TRUE(ok);
......
......@@ -1220,7 +1220,6 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) {
// Adding single handlers for your service here is fine, but once your
// service needs more than one handler, please extract them into a new
// message filter and add that filter to CreateMessageFilters().
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP_EX()
if (!msg_is_ok) {
......
......@@ -200,7 +200,7 @@ void IPCResourceLoaderBridge::Cancel() {
}
if (!is_synchronous_request_)
dispatcher_->CancelPendingRequest(routing_id_, request_id_);
dispatcher_->CancelPendingRequest(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
......@@ -324,8 +324,8 @@ ResourceDispatcher::GetPendingRequestInfo(int request_id) {
return &(it->second);
}
void ResourceDispatcher::OnUploadProgress(
const IPC::Message& message, int request_id, int64 position, int64 size) {
void ResourceDispatcher::OnUploadProgress(int request_id, int64 position,
int64 size) {
PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
if (!request_info)
return;
......@@ -333,8 +333,7 @@ void ResourceDispatcher::OnUploadProgress(
request_info->peer->OnUploadProgress(position, size);
// Acknowledge receipt
message_sender()->Send(
new ResourceHostMsg_UploadProgress_ACK(message.routing_id(), request_id));
message_sender()->Send(new ResourceHostMsg_UploadProgress_ACK(request_id));
}
void ResourceDispatcher::OnReceivedResponse(
......@@ -373,8 +372,7 @@ void ResourceDispatcher::OnReceivedCachedMetadata(
request_info->peer->OnReceivedCachedMetadata(&data.front(), data.size());
}
void ResourceDispatcher::OnSetDataBuffer(const IPC::Message& message,
int request_id,
void ResourceDispatcher::OnSetDataBuffer(int request_id,
base::SharedMemoryHandle shm_handle,
int shm_size,
base::ProcessId renderer_pid) {
......@@ -404,8 +402,7 @@ void ResourceDispatcher::OnSetDataBuffer(const IPC::Message& message,
request_info->buffer_size = shm_size;
}
void ResourceDispatcher::OnReceivedData(const IPC::Message& message,
int request_id,
void ResourceDispatcher::OnReceivedData(int request_id,
int data_offset,
int data_length,
int encoded_data_length) {
......@@ -449,17 +446,15 @@ void ResourceDispatcher::OnReceivedData(const IPC::Message& message,
}
// Acknowledge the reception of this data.
message_sender()->Send(
new ResourceHostMsg_DataReceived_ACK(message.routing_id(), request_id));
message_sender()->Send(new ResourceHostMsg_DataReceived_ACK(request_id));
}
void ResourceDispatcher::OnDownloadedData(const IPC::Message& message,
int request_id,
void ResourceDispatcher::OnDownloadedData(int request_id,
int data_len,
int encoded_data_length) {
// Acknowledge the reception of this message.
message_sender()->Send(
new ResourceHostMsg_DataDownloaded_ACK(message.routing_id(), request_id));
new ResourceHostMsg_DataDownloaded_ACK(request_id));
PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
if (!request_info)
......@@ -469,7 +464,6 @@ void ResourceDispatcher::OnDownloadedData(const IPC::Message& message,
}
void ResourceDispatcher::OnReceivedRedirect(
const IPC::Message& message,
int request_id,
const GURL& new_url,
const ResourceResponseHead& response_head) {
......@@ -478,7 +472,6 @@ void ResourceDispatcher::OnReceivedRedirect(
return;
request_info->response_start = ConsumeIOTimestamp();
int32 routing_id = message.routing_id();
bool has_new_first_party_for_cookies = false;
GURL new_first_party_for_cookies;
ResourceResponseInfo renderer_response_info;
......@@ -495,14 +488,14 @@ void ResourceDispatcher::OnReceivedRedirect(
// SiteIsolationPolicy later when OnReceivedResponse is called.
request_info->response_url = new_url;
request_info->pending_redirect_message.reset(
new ResourceHostMsg_FollowRedirect(routing_id, request_id,
new ResourceHostMsg_FollowRedirect(request_id,
has_new_first_party_for_cookies,
new_first_party_for_cookies));
if (!request_info->is_deferred) {
FollowPendingRedirect(request_id, *request_info);
}
} else {
CancelPendingRequest(routing_id, request_id);
CancelPendingRequest(request_id);
}
}
......@@ -574,8 +567,7 @@ bool ResourceDispatcher::RemovePendingRequest(int request_id) {
return true;
}
void ResourceDispatcher::CancelPendingRequest(int routing_id,
int request_id) {
void ResourceDispatcher::CancelPendingRequest(int request_id) {
PendingRequestList::iterator it = pending_requests_.find(request_id);
if (it == pending_requests_.end()) {
DVLOG(1) << "unknown request";
......@@ -587,8 +579,7 @@ void ResourceDispatcher::CancelPendingRequest(int routing_id,
ReleaseResourcesInMessageQueue(&request_info.deferred_message_queue);
pending_requests_.erase(it);
message_sender()->Send(
new ResourceHostMsg_CancelRequest(routing_id, request_id));
message_sender()->Send(new ResourceHostMsg_CancelRequest(request_id));
}
void ResourceDispatcher::SetDefersLoading(int request_id, bool value) {
......@@ -617,7 +608,7 @@ 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));
request_id, new_priority));
}
ResourceDispatcher::PendingRequestInfo::PendingRequestInfo()
......
......@@ -54,7 +54,7 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener {
bool RemovePendingRequest(int request_id);
// Cancels a request in the pending_requests_ list.
void CancelPendingRequest(int routing_id, int request_id);
void CancelPendingRequest(int request_id);
IPC::Sender* message_sender() const {
return message_sender_;
......@@ -125,31 +125,26 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener {
// Message response handlers, called by the message handler for this process.
void OnUploadProgress(
const IPC::Message& message,
int request_id,
int64 position,
int64 size);
void OnReceivedResponse(int request_id, const ResourceResponseHead&);
void OnReceivedCachedMetadata(int request_id, const std::vector<char>& data);
void OnReceivedRedirect(
const IPC::Message& message,
int request_id,
const GURL& new_url,
const ResourceResponseHead& response_head);
void OnSetDataBuffer(
const IPC::Message& message,
int request_id,
base::SharedMemoryHandle shm_handle,
int shm_size,
base::ProcessId renderer_pid);
void OnReceivedData(
const IPC::Message& message,
int request_id,
int data_offset,
int data_length,
int encoded_data_length);
void OnDownloadedData(
const IPC::Message& message,
int request_id,
int data_len,
int encoded_data_length);
......
......@@ -134,10 +134,9 @@ class ResourceDispatcherTest : public testing::Test, public IPC::Sender {
base::SharedMemoryHandle dup_handle;
EXPECT_TRUE(shared_mem.GiveToProcess(
base::Process::Current().handle(), &dup_handle));
dispatcher_->OnSetDataBuffer(message_queue_[0], request_id, dup_handle,
dispatcher_->OnSetDataBuffer(request_id, dup_handle,
test_page_contents_len, 0);
dispatcher_->OnReceivedData(message_queue_[0], request_id, 0,
test_page_contents_len,
dispatcher_->OnReceivedData(request_id, 0, test_page_contents_len,
test_page_contents_len);
message_queue_.erase(message_queue_.begin());
......@@ -251,7 +250,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest,
response_head.error_code = net::OK;
dispatcher_->OnMessageReceived(
ResourceMsg_ReceivedResponse(0, 0, response_head));
ResourceMsg_ReceivedResponse(0, response_head));
// Duplicate the shared memory handle so both the test and the callee can
// close their copy.
......@@ -260,9 +259,8 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest,
&duplicated_handle));
dispatcher_->OnMessageReceived(
ResourceMsg_SetDataBuffer(0, 0, duplicated_handle, 100, 0));
dispatcher_->OnMessageReceived(
ResourceMsg_DataReceived(0, 0, 0, 100, 100));
ResourceMsg_SetDataBuffer(0, duplicated_handle, 100, 0));
dispatcher_->OnMessageReceived(ResourceMsg_DataReceived(0, 0, 100, 100));
set_defer_loading(false);
}
......@@ -355,7 +353,7 @@ class TimeConversionTest : public ResourceDispatcherTest,
bridge->Start(this);
dispatcher_->OnMessageReceived(
ResourceMsg_ReceivedResponse(0, 0, response_head));
ResourceMsg_ReceivedResponse(0, response_head));
}
// ResourceLoaderBridge::Peer methods.
......
......@@ -203,17 +203,17 @@ IPC_STRUCT_END()
// Resource messages sent from the browser to the renderer.
// Sent when the headers are available for a resource request.
IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedResponse,
IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedResponse,
int /* request_id */,
content::ResourceResponseHead)
// Sent when cached metadata from a resource request is ready.
IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedCachedMetadata,
IPC_MESSAGE_CONTROL2(ResourceMsg_ReceivedCachedMetadata,
int /* request_id */,
std::vector<char> /* data */)
// Sent as upload progress is being made.
IPC_MESSAGE_ROUTED3(ResourceMsg_UploadProgress,
IPC_MESSAGE_CONTROL3(ResourceMsg_UploadProgress,
int /* request_id */,
int64 /* position */,
int64 /* size */)
......@@ -221,7 +221,7 @@ IPC_MESSAGE_ROUTED3(ResourceMsg_UploadProgress,
// Sent when the request has been redirected. The receiver is expected to
// respond with either a FollowRedirect message (if the redirect is to be
// followed) or a CancelRequest message (if it should not be followed).
IPC_MESSAGE_ROUTED3(ResourceMsg_ReceivedRedirect,
IPC_MESSAGE_CONTROL3(ResourceMsg_ReceivedRedirect,
int /* request_id */,
GURL /* new_url */,
content::ResourceResponseHead)
......@@ -237,7 +237,7 @@ IPC_MESSAGE_ROUTED3(ResourceMsg_ReceivedRedirect,
// TODO(darin): The |renderer_pid| parameter is just a temporary parameter,
// added to help in debugging crbug/160401.
//
IPC_MESSAGE_ROUTED4(ResourceMsg_SetDataBuffer,
IPC_MESSAGE_CONTROL4(ResourceMsg_SetDataBuffer,
int /* request_id */,
base::SharedMemoryHandle /* shm_handle */,
int /* shm_size */,
......@@ -246,7 +246,7 @@ IPC_MESSAGE_ROUTED4(ResourceMsg_SetDataBuffer,
// Sent when some data from a resource request is ready. The data offset and
// length specify a byte range into the shared memory buffer provided by the
// SetDataBuffer message.
IPC_MESSAGE_ROUTED4(ResourceMsg_DataReceived,
IPC_MESSAGE_CONTROL4(ResourceMsg_DataReceived,
int /* request_id */,
int /* data_offset */,
int /* data_length */,
......@@ -255,13 +255,13 @@ IPC_MESSAGE_ROUTED4(ResourceMsg_DataReceived,
// Sent when some data from a resource request has been downloaded to
// file. This is only called in the 'download_to_file' case and replaces
// ResourceMsg_DataReceived in the call sequence in that case.
IPC_MESSAGE_ROUTED3(ResourceMsg_DataDownloaded,
IPC_MESSAGE_CONTROL3(ResourceMsg_DataDownloaded,
int /* request_id */,
int /* data_len */,
int /* encoded_data_length */)
// Sent when the request has been completed.
IPC_MESSAGE_ROUTED5(ResourceMsg_RequestComplete,
IPC_MESSAGE_CONTROL5(ResourceMsg_RequestComplete,
int /* request_id */,
int /* error_code */,
bool /* was_ignored_by_handler */,
......@@ -276,12 +276,12 @@ IPC_MESSAGE_ROUTED2(ResourceHostMsg_RequestResource,
ResourceHostMsg_Request)
// Cancels a resource request with the ID given as the parameter.
IPC_MESSAGE_ROUTED1(ResourceHostMsg_CancelRequest,
IPC_MESSAGE_CONTROL1(ResourceHostMsg_CancelRequest,
int /* request_id */)
// Follows a redirect that occured for the resource request with the ID given
// as the parameter.
IPC_MESSAGE_ROUTED3(ResourceHostMsg_FollowRedirect,
IPC_MESSAGE_CONTROL3(ResourceHostMsg_FollowRedirect,
int /* request_id */,
bool /* has_new_first_party_for_cookies */,
GURL /* new_first_party_for_cookies */)
......@@ -294,16 +294,16 @@ IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad,
// Sent when the renderer process is done processing a DataReceived
// message.
IPC_MESSAGE_ROUTED1(ResourceHostMsg_DataReceived_ACK,
IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataReceived_ACK,
int /* request_id */)
// Sent when the renderer has processed a DataDownloaded message.
IPC_MESSAGE_ROUTED1(ResourceHostMsg_DataDownloaded_ACK,
IPC_MESSAGE_CONTROL1(ResourceHostMsg_DataDownloaded_ACK,
int /* request_id */)
// Sent by the renderer process to acknowledge receipt of a
// UploadProgress message.
IPC_MESSAGE_ROUTED1(ResourceHostMsg_UploadProgress_ACK,
IPC_MESSAGE_CONTROL1(ResourceHostMsg_UploadProgress_ACK,
int /* request_id */)
// Sent when the renderer process deletes a resource loader.
......@@ -311,6 +311,6 @@ IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile,
int /* request_id */)
// Sent by the renderer when a resource request changes priority.
IPC_MESSAGE_ROUTED2(ResourceHostMsg_DidChangePriority,
IPC_MESSAGE_CONTROL2(ResourceHostMsg_DidChangePriority,
int /* request_id */,
net::RequestPriority)
......@@ -163,7 +163,7 @@ void RenderViewFakeResourcesTest::OnRequestResource(
response_head.headers = new net::HttpResponseHeaders(headers);
response_head.mime_type = "text/html";
ASSERT_TRUE(channel_->Send(new ResourceMsg_ReceivedResponse(
message.routing_id(), request_id, response_head)));
request_id, response_head)));
base::SharedMemory shared_memory;
ASSERT_TRUE(shared_memory.CreateAndMapAnonymous(body.size()));
......@@ -174,21 +174,18 @@ void RenderViewFakeResourcesTest::OnRequestResource(
&handle));
ASSERT_TRUE(channel_->Send(new ResourceMsg_SetDataBuffer(
message.routing_id(),
request_id,
handle,
body.size(),
0)));
ASSERT_TRUE(channel_->Send(new ResourceMsg_DataReceived(
message.routing_id(),
request_id,
0,
body.size(),
body.size())));
ASSERT_TRUE(channel_->Send(new ResourceMsg_RequestComplete(
message.routing_id(),
request_id,
net::OK,
false,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment