| 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 "chrome/browser/net/chrome_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 extensions_delegate_->OnBeforeRedirect(request, new_location); | 354 extensions_delegate_->OnBeforeRedirect(request, new_location); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void ChromeNetworkDelegate::OnResponseStarted(net::URLRequest* request, | 357 void ChromeNetworkDelegate::OnResponseStarted(net::URLRequest* request, |
| 358 int net_error) { | 358 int net_error) { |
| 359 extensions_delegate_->OnResponseStarted(request, net_error); | 359 extensions_delegate_->OnResponseStarted(request, net_error); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void ChromeNetworkDelegate::OnNetworkBytesReceived(net::URLRequest* request, | 362 void ChromeNetworkDelegate::OnNetworkBytesReceived(net::URLRequest* request, |
| 363 int64_t bytes_received) { | 363 int64_t bytes_received) { |
| 364 #if defined(ENABLE_TASK_MANAGER) | 364 #if !defined(OS_ANDROID) |
| 365 // Note: Currently, OnNetworkBytesReceived is only implemented for HTTP jobs, | 365 // Note: Currently, OnNetworkBytesReceived is only implemented for HTTP jobs, |
| 366 // not FTP or other types, so those kinds of bytes will not be reported here. | 366 // not FTP or other types, so those kinds of bytes will not be reported here. |
| 367 task_manager::TaskManagerInterface::OnRawBytesRead(*request, bytes_received); | 367 task_manager::TaskManagerInterface::OnRawBytesRead(*request, bytes_received); |
| 368 #endif // defined(ENABLE_TASK_MANAGER) | 368 #endif // !defined(OS_ANDROID) |
| 369 | 369 |
| 370 ReportDataUsageStats(request, 0 /* tx_bytes */, bytes_received); | 370 ReportDataUsageStats(request, 0 /* tx_bytes */, bytes_received); |
| 371 } | 371 } |
| 372 | 372 |
| 373 void ChromeNetworkDelegate::OnNetworkBytesSent(net::URLRequest* request, | 373 void ChromeNetworkDelegate::OnNetworkBytesSent(net::URLRequest* request, |
| 374 int64_t bytes_sent) { | 374 int64_t bytes_sent) { |
| 375 ReportDataUsageStats(request, bytes_sent, 0 /* rx_bytes */); | 375 ReportDataUsageStats(request, bytes_sent, 0 /* rx_bytes */); |
| 376 } | 376 } |
| 377 | 377 |
| 378 void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request, | 378 void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request, |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 if (!data_use_aggregator_) | 577 if (!data_use_aggregator_) |
| 578 return; | 578 return; |
| 579 | 579 |
| 580 if (is_data_usage_off_the_record_) { | 580 if (is_data_usage_off_the_record_) { |
| 581 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); | 581 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); |
| 582 return; | 582 return; |
| 583 } | 583 } |
| 584 | 584 |
| 585 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); | 585 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); |
| 586 } | 586 } |
| OLD | NEW |