OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/url_request/url_fetcher_core.h" | 5 #include "net/url_request/url_fetcher_core.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 929 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
930 | 930 |
931 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455952 is fixed. | 931 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455952 is fixed. |
932 tracked_objects::ScopedTracker tracking_profile2( | 932 tracked_objects::ScopedTracker tracking_profile2( |
933 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 933 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
934 "455952 delegate_task_runner_->PostTask()")); | 934 "455952 delegate_task_runner_->PostTask()")); |
935 | 935 |
936 delegate_task_runner_->PostTask( | 936 delegate_task_runner_->PostTask( |
937 FROM_HERE, | 937 FROM_HERE, |
938 base::Bind( | 938 base::Bind( |
939 &URLFetcherCore::InformDelegateDownloadProgressInDelegateThread, | 939 &URLFetcherCore::InformDelegateDownloadProgressInDelegateThread, this, |
940 this, current_response_bytes_, total_response_bytes_)); | 940 current_response_bytes_, total_response_bytes_, |
| 941 request_->GetTotalReceivedBytes())); |
941 } | 942 } |
942 | 943 |
943 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( | 944 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( |
944 int64_t current, | 945 int64_t current, |
945 int64_t total) { | 946 int64_t total, |
| 947 int64_t current_network_bytes) { |
946 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); | 948 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); |
947 if (delegate_) | 949 if (delegate_) |
948 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total); | 950 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total, |
| 951 current_network_bytes); |
949 } | 952 } |
950 | 953 |
951 void URLFetcherCore::AssertHasNoUploadData() const { | 954 void URLFetcherCore::AssertHasNoUploadData() const { |
952 DCHECK(!upload_content_set_); | 955 DCHECK(!upload_content_set_); |
953 DCHECK(upload_content_.empty()); | 956 DCHECK(upload_content_.empty()); |
954 DCHECK(upload_file_path_.empty()); | 957 DCHECK(upload_file_path_.empty()); |
955 DCHECK(upload_stream_factory_.is_null()); | 958 DCHECK(upload_stream_factory_.is_null()); |
956 } | 959 } |
957 | 960 |
958 } // namespace net | 961 } // namespace net |
OLD | NEW |