summaryrefslogtreecommitdiffstats
path: root/content/browser/loader/async_resource_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/loader/async_resource_handler.cc')
-rw-r--r--content/browser/loader/async_resource_handler.cc44
1 files changed, 16 insertions, 28 deletions
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc
index fbd8f14..69e831bd2 100644
--- a/content/browser/loader/async_resource_handler.cc
+++ b/content/browser/loader/async_resource_handler.cc
@@ -23,7 +23,6 @@
#include "content/browser/resource_context_impl.h"
#include "content/common/resource_messages.h"
#include "content/common/view_messages.h"
-#include "content/public/browser/global_request_id.h"
#include "content/public/browser/resource_dispatcher_host_delegate.h"
#include "content/public/common/resource_response.h"
#include "net/base/io_buffer.h"
@@ -126,18 +125,16 @@ void AsyncResourceHandler::OnDataReceivedACK(int request_id) {
}
}
-bool AsyncResourceHandler::OnUploadProgress(int request_id,
- uint64 position,
+bool AsyncResourceHandler::OnUploadProgress(uint64 position,
uint64 size) {
ResourceMessageFilter* filter = GetFilter();
if (!filter)
return false;
return filter->Send(
- new ResourceMsg_UploadProgress(request_id, position, size));
+ new ResourceMsg_UploadProgress(GetRequestID(), position, size));
}
-bool AsyncResourceHandler::OnRequestRedirected(int request_id,
- const GURL& new_url,
+bool AsyncResourceHandler::OnRequestRedirected(const GURL& new_url,
ResourceResponse* response,
bool* defer) {
const ResourceRequestInfoImpl* info = GetRequestInfo();
@@ -162,12 +159,11 @@ bool AsyncResourceHandler::OnRequestRedirected(int request_id,
// and hopefully those will eventually all be owned by the browser. It's
// possible this is still needed while renderer-owned ones exist.
return info->filter()->Send(new ResourceMsg_ReceivedRedirect(
- request_id, new_url, request()->first_party_for_cookies(),
+ GetRequestID(), new_url, request()->first_party_for_cookies(),
response->head));
}
-bool AsyncResourceHandler::OnResponseStarted(int request_id,
- ResourceResponse* response,
+bool AsyncResourceHandler::OnResponseStarted(ResourceResponse* response,
bool* defer) {
// For changes to the main frame, inform the renderer of the new URL's
// per-host settings before the request actually commits. This way the
@@ -208,7 +204,7 @@ bool AsyncResourceHandler::OnResponseStarted(int request_id,
response->head.request_start = request()->creation_time();
response->head.response_start = TimeTicks::Now();
- info->filter()->Send(new ResourceMsg_ReceivedResponse(request_id,
+ info->filter()->Send(new ResourceMsg_ReceivedResponse(GetRequestID(),
response->head));
sent_received_response_msg_ = true;
@@ -216,27 +212,22 @@ bool AsyncResourceHandler::OnResponseStarted(int request_id,
std::vector<char> copy(request()->response_info().metadata->data(),
request()->response_info().metadata->data() +
request()->response_info().metadata->size());
- info->filter()->Send(new ResourceMsg_ReceivedCachedMetadata(request_id,
+ info->filter()->Send(new ResourceMsg_ReceivedCachedMetadata(GetRequestID(),
copy));
}
return true;
}
-bool AsyncResourceHandler::OnWillStart(int request_id,
- const GURL& url,
- bool* defer) {
+bool AsyncResourceHandler::OnWillStart(const GURL& url, bool* defer) {
return true;
}
-bool AsyncResourceHandler::OnBeforeNetworkStart(int request_id,
- const GURL& url,
- bool* defer) {
+bool AsyncResourceHandler::OnBeforeNetworkStart(const GURL& url, bool* defer) {
return true;
}
-bool AsyncResourceHandler::OnWillRead(int request_id,
- scoped_refptr<net::IOBuffer>* buf,
+bool AsyncResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf,
int* buf_size,
int min_size) {
DCHECK_EQ(-1, min_size);
@@ -257,8 +248,7 @@ bool AsyncResourceHandler::OnWillRead(int request_id,
return true;
}
-bool AsyncResourceHandler::OnReadCompleted(int request_id, int bytes_read,
- bool* defer) {
+bool AsyncResourceHandler::OnReadCompleted(int bytes_read, bool* defer) {
DCHECK_GE(bytes_read, 0);
if (!bytes_read)
@@ -283,7 +273,7 @@ bool AsyncResourceHandler::OnReadCompleted(int request_id, int bytes_read,
if (!buffer_->ShareToProcess(filter->PeerHandle(), &handle, &size))
return false;
filter->Send(new ResourceMsg_SetDataBuffer(
- request_id, handle, size, filter->peer_pid()));
+ GetRequestID(), handle, size, filter->peer_pid()));
sent_first_data_msg_ = true;
}
@@ -294,7 +284,7 @@ bool AsyncResourceHandler::OnReadCompleted(int request_id, int bytes_read,
reported_transfer_size_ = current_transfer_size;
filter->Send(new ResourceMsg_DataReceived(
- request_id, data_offset, bytes_read, encoded_data_length));
+ GetRequestID(), data_offset, bytes_read, encoded_data_length));
++pending_data_count_;
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Net.AsyncResourceHandler_PendingDataCount",
@@ -311,8 +301,7 @@ bool AsyncResourceHandler::OnReadCompleted(int request_id, int bytes_read,
return true;
}
-void AsyncResourceHandler::OnDataDownloaded(
- int request_id, int bytes_downloaded) {
+void AsyncResourceHandler::OnDataDownloaded(int bytes_downloaded) {
int64_t current_transfer_size = request()->GetTotalReceivedBytes();
int encoded_data_length = current_transfer_size - reported_transfer_size_;
reported_transfer_size_ = current_transfer_size;
@@ -320,12 +309,11 @@ void AsyncResourceHandler::OnDataDownloaded(
ResourceMessageFilter* filter = GetFilter();
if (filter) {
filter->Send(new ResourceMsg_DataDownloaded(
- request_id, bytes_downloaded, encoded_data_length));
+ GetRequestID(), bytes_downloaded, encoded_data_length));
}
}
void AsyncResourceHandler::OnResponseCompleted(
- int request_id,
const net::URLRequestStatus& status,
const std::string& security_info,
bool* defer) {
@@ -375,7 +363,7 @@ void AsyncResourceHandler::OnResponseCompleted(
request_complete_data.encoded_data_length =
request()->GetTotalReceivedBytes();
info->filter()->Send(
- new ResourceMsg_RequestComplete(request_id, request_complete_data));
+ new ResourceMsg_RequestComplete(GetRequestID(), request_complete_data));
}
bool AsyncResourceHandler::EnsureResourceBufferIsInitialized() {