| 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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 925 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
| 926 | 926 |
| 927 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455952 is fixed. | 927 // TODO(pkasting): Remove ScopedTracker below once crbug.com/455952 is fixed. |
| 928 tracked_objects::ScopedTracker tracking_profile2( | 928 tracked_objects::ScopedTracker tracking_profile2( |
| 929 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 929 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 930 "455952 delegate_task_runner_->PostTask()")); | 930 "455952 delegate_task_runner_->PostTask()")); |
| 931 | 931 |
| 932 delegate_task_runner_->PostTask( | 932 delegate_task_runner_->PostTask( |
| 933 FROM_HERE, | 933 FROM_HERE, |
| 934 base::Bind( | 934 base::Bind( |
| 935 &URLFetcherCore::InformDelegateDownloadProgressInDelegateThread, | 935 &URLFetcherCore::InformDelegateDownloadProgressInDelegateThread, this, |
| 936 this, current_response_bytes_, total_response_bytes_)); | 936 current_response_bytes_, total_response_bytes_, |
| 937 request_->GetTotalReceivedBytes())); |
| 937 } | 938 } |
| 938 | 939 |
| 939 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( | 940 void URLFetcherCore::InformDelegateDownloadProgressInDelegateThread( |
| 940 int64_t current, | 941 int64_t current, |
| 941 int64_t total) { | 942 int64_t total, |
| 943 int64_t current_network_bytes) { |
| 942 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); | 944 DCHECK(delegate_task_runner_->BelongsToCurrentThread()); |
| 943 if (delegate_) | 945 if (delegate_) |
| 944 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total); | 946 delegate_->OnURLFetchDownloadProgress(fetcher_, current, total, |
| 947 current_network_bytes); |
| 945 } | 948 } |
| 946 | 949 |
| 947 void URLFetcherCore::AssertHasNoUploadData() const { | 950 void URLFetcherCore::AssertHasNoUploadData() const { |
| 948 DCHECK(!upload_content_set_); | 951 DCHECK(!upload_content_set_); |
| 949 DCHECK(upload_content_.empty()); | 952 DCHECK(upload_content_.empty()); |
| 950 DCHECK(upload_file_path_.empty()); | 953 DCHECK(upload_file_path_.empty()); |
| 951 DCHECK(upload_stream_factory_.is_null()); | 954 DCHECK(upload_stream_factory_.is_null()); |
| 952 } | 955 } |
| 953 | 956 |
| 954 } // namespace net | 957 } // namespace net |
| OLD | NEW |