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

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

Issue 1080763003: Remove URLRequestJob::filter_input_byte_count_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge Created 5 years, 8 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 | « no previous file | net/url_request/url_request_job.h » ('j') | 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_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 bool URLRequestHttpJob::HttpFilterContext::IsCachedContent() const { 107 bool URLRequestHttpJob::HttpFilterContext::IsCachedContent() const {
108 return job_->is_cached_content_; 108 return job_->is_cached_content_;
109 } 109 }
110 110
111 SdchManager::DictionarySet* 111 SdchManager::DictionarySet*
112 URLRequestHttpJob::HttpFilterContext::SdchDictionariesAdvertised() const { 112 URLRequestHttpJob::HttpFilterContext::SdchDictionariesAdvertised() const {
113 return job_->dictionaries_advertised_.get(); 113 return job_->dictionaries_advertised_.get();
114 } 114 }
115 115
116 int64 URLRequestHttpJob::HttpFilterContext::GetByteReadCount() const { 116 int64 URLRequestHttpJob::HttpFilterContext::GetByteReadCount() const {
117 return job_->filter_input_byte_count(); 117 return job_->prefilter_bytes_read();
118 } 118 }
119 119
120 int URLRequestHttpJob::HttpFilterContext::GetResponseCode() const { 120 int URLRequestHttpJob::HttpFilterContext::GetResponseCode() const {
121 return job_->GetResponseCode(); 121 return job_->GetResponseCode();
122 } 122 }
123 123
124 const URLRequestContext* 124 const URLRequestContext*
125 URLRequestHttpJob::HttpFilterContext::GetURLRequestContext() const { 125 URLRequestHttpJob::HttpFilterContext::GetURLRequestContext() const {
126 return job_->request() ? job_->request()->context() : NULL; 126 return job_->request() ? job_->request()->context() : NULL;
127 } 127 }
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 << "The timer was reset before it was recorded."; 1383 << "The timer was reset before it was recorded.";
1384 return; 1384 return;
1385 } 1385 }
1386 request_creation_time_ = base::Time::Now(); 1386 request_creation_time_ = base::Time::Now();
1387 } 1387 }
1388 1388
1389 void URLRequestHttpJob::UpdatePacketReadTimes() { 1389 void URLRequestHttpJob::UpdatePacketReadTimes() {
1390 if (!packet_timing_enabled_) 1390 if (!packet_timing_enabled_)
1391 return; 1391 return;
1392 1392
1393 if (filter_input_byte_count() <= bytes_observed_in_packets_) { 1393 DCHECK_GT(prefilter_bytes_read(), bytes_observed_in_packets_);
1394 DCHECK_EQ(filter_input_byte_count(), bytes_observed_in_packets_);
1395 return; // No new bytes have arrived.
1396 }
1397 1394
1398 base::Time now(base::Time::Now()); 1395 base::Time now(base::Time::Now());
1399 if (!bytes_observed_in_packets_) 1396 if (!bytes_observed_in_packets_)
1400 request_time_snapshot_ = now; 1397 request_time_snapshot_ = now;
1401 final_packet_time_ = now; 1398 final_packet_time_ = now;
1402 1399
1403 bytes_observed_in_packets_ = filter_input_byte_count(); 1400 bytes_observed_in_packets_ = prefilter_bytes_read();
1404 } 1401 }
1405 1402
1406 void URLRequestHttpJob::RecordPacketStats( 1403 void URLRequestHttpJob::RecordPacketStats(
1407 FilterContext::StatisticSelector statistic) const { 1404 FilterContext::StatisticSelector statistic) const {
1408 if (!packet_timing_enabled_ || (final_packet_time_ == base::Time())) 1405 if (!packet_timing_enabled_ || (final_packet_time_ == base::Time()))
1409 return; 1406 return;
1410 1407
1411 base::TimeDelta duration = final_packet_time_ - request_time_snapshot_; 1408 base::TimeDelta duration = final_packet_time_ - request_time_snapshot_;
1412 switch (statistic) { 1409 switch (statistic) {
1413 case FilterContext::SDCH_DECODE: { 1410 case FilterContext::SDCH_DECODE: {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 return override_response_headers_.get() ? 1482 return override_response_headers_.get() ?
1486 override_response_headers_.get() : 1483 override_response_headers_.get() :
1487 transaction_->GetResponseInfo()->headers.get(); 1484 transaction_->GetResponseInfo()->headers.get();
1488 } 1485 }
1489 1486
1490 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1487 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1491 awaiting_callback_ = false; 1488 awaiting_callback_ = false;
1492 } 1489 }
1493 1490
1494 } // namespace net 1491 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/url_request/url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698