| 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_request_job.h" | 5 #include "net/url_request/url_request_job.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 } | 623 } |
| 624 | 624 |
| 625 // If the request succeeded (And wasn't cancelled) and the response code was | 625 // If the request succeeded (And wasn't cancelled) and the response code was |
| 626 // 4xx or 5xx, record whether or not the main frame was blank. This is | 626 // 4xx or 5xx, record whether or not the main frame was blank. This is |
| 627 // intended to be a short-lived histogram, used to figure out how important | 627 // intended to be a short-lived histogram, used to figure out how important |
| 628 // fixing http://crbug.com/331745 is. | 628 // fixing http://crbug.com/331745 is. |
| 629 if (request_->status().is_success()) { | 629 if (request_->status().is_success()) { |
| 630 int response_code = GetResponseCode(); | 630 int response_code = GetResponseCode(); |
| 631 if (400 <= response_code && response_code <= 599) { | 631 if (400 <= response_code && response_code <= 599) { |
| 632 bool page_has_content = (postfilter_bytes_read_ != 0); | 632 bool page_has_content = (postfilter_bytes_read_ != 0); |
| 633 if (request_->load_flags() & net::LOAD_MAIN_FRAME) { | 633 if (request_->load_flags() & net::LOAD_MAIN_FRAME_DEPRECATED) { |
| 634 UMA_HISTOGRAM_BOOLEAN("Net.ErrorResponseHasContentMainFrame", | 634 UMA_HISTOGRAM_BOOLEAN("Net.ErrorResponseHasContentMainFrame", |
| 635 page_has_content); | 635 page_has_content); |
| 636 } else { | 636 } else { |
| 637 UMA_HISTOGRAM_BOOLEAN("Net.ErrorResponseHasContentNonMainFrame", | 637 UMA_HISTOGRAM_BOOLEAN("Net.ErrorResponseHasContentNonMainFrame", |
| 638 page_has_content); | 638 page_has_content); |
| 639 } | 639 } |
| 640 } | 640 } |
| 641 } | 641 } |
| 642 | 642 |
| 643 MaybeNotifyNetworkBytes(); | 643 MaybeNotifyNetworkBytes(); |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 int64_t total_sent_bytes = GetTotalSentBytes(); | 1008 int64_t total_sent_bytes = GetTotalSentBytes(); |
| 1009 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); | 1009 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); |
| 1010 if (total_sent_bytes > last_notified_total_sent_bytes_) { | 1010 if (total_sent_bytes > last_notified_total_sent_bytes_) { |
| 1011 network_delegate_->NotifyNetworkBytesSent( | 1011 network_delegate_->NotifyNetworkBytesSent( |
| 1012 request_, total_sent_bytes - last_notified_total_sent_bytes_); | 1012 request_, total_sent_bytes - last_notified_total_sent_bytes_); |
| 1013 } | 1013 } |
| 1014 last_notified_total_sent_bytes_ = total_sent_bytes; | 1014 last_notified_total_sent_bytes_ = total_sent_bytes; |
| 1015 } | 1015 } |
| 1016 | 1016 |
| 1017 } // namespace net | 1017 } // namespace net |
| OLD | NEW |