| Index: content/browser/loader/async_resource_handler.cc
|
| diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc
|
| index d55bc0f9a72c14c08eeacd3c26729415dee696b6..be9428d4994906043f1e09e03875119d834657ef 100644
|
| --- a/content/browser/loader/async_resource_handler.cc
|
| +++ b/content/browser/loader/async_resource_handler.cc
|
| @@ -337,10 +337,7 @@ bool AsyncResourceHandler::OnWillStart(const GURL& url, bool* defer) {
|
| if (GetRequestInfo()->is_upload_progress_enabled() &&
|
| request()->has_upload()) {
|
| upload_progress_tracker_ = base::MakeUnique<UploadProgressTracker>(
|
| - FROM_HERE,
|
| - base::BindRepeating(&AsyncResourceHandler::SendUploadProgress,
|
| - base::Unretained(this)),
|
| - request());
|
| + FROM_HERE, this, base::ThreadTaskRunnerHandle::Get());
|
| }
|
| return true;
|
| }
|
| @@ -484,6 +481,19 @@ void AsyncResourceHandler::OnResponseCompleted(
|
| RecordHistogram();
|
| }
|
|
|
| +net::UploadProgress AsyncResourceHandler::GetUploadProgress() {
|
| + return request()->GetUploadProgress();
|
| +}
|
| +
|
| +void AsyncResourceHandler::ReportUploadProgress(int64_t current_position,
|
| + int64_t total_size) {
|
| + ResourceMessageFilter* filter = GetFilter();
|
| + if (!filter)
|
| + return;
|
| + filter->Send(new ResourceMsg_UploadProgress(GetRequestID(), current_position,
|
| + total_size));
|
| +}
|
| +
|
| bool AsyncResourceHandler::EnsureResourceBufferIsInitialized() {
|
| DCHECK(has_checked_for_sufficient_resources_);
|
|
|
| @@ -553,13 +563,4 @@ void AsyncResourceHandler::RecordHistogram() {
|
| inlining_helper_->RecordHistogram(elapsed_time);
|
| }
|
|
|
| -void AsyncResourceHandler::SendUploadProgress(int64_t current_position,
|
| - int64_t total_size) {
|
| - ResourceMessageFilter* filter = GetFilter();
|
| - if (!filter)
|
| - return;
|
| - filter->Send(new ResourceMsg_UploadProgress(
|
| - GetRequestID(), current_position, total_size));
|
| -}
|
| -
|
| } // namespace content
|
|
|