Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Side by Side Diff: net/url_request/url_request_job.cc

Issue 2278823003: Change net::LOAD_MAIN_FRAME to net::LOAD_MAIN_FRAME_DEPRECATED to discourage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added deprecation flag to two recent tests. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/nqe/network_quality_estimator_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/nqe/network_quality_estimator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698