From a1ec07e07e6d5fd8735746e19357e70c0276dce8 Mon Sep 17 00:00:00 2001 From: Robo Date: Wed, 22 Jul 2015 21:45:08 +0530 Subject: [PATCH] read post-filtered data when filters are present --- atom/browser/net/adapter_request_job.cc | 11 ++++++++++- atom/browser/net/adapter_request_job.h | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/atom/browser/net/adapter_request_job.cc b/atom/browser/net/adapter_request_job.cc index 5f584c2f7314..2be25b657513 100644 --- a/atom/browser/net/adapter_request_job.cc +++ b/atom/browser/net/adapter_request_job.cc @@ -43,7 +43,11 @@ bool AdapterRequestJob::ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read) { DCHECK(!real_job_.get()); - return real_job_->ReadRawData(buf, buf_size, bytes_read); + // Read post-filtered data if available. + if (real_job_->HasFilter()) + return real_job_->Read(buf, buf_size, bytes_read); + else + return real_job_->ReadRawData(buf, buf_size, bytes_read); } bool AdapterRequestJob::IsRedirectResponse(GURL* location, @@ -75,6 +79,11 @@ int AdapterRequestJob::GetResponseCode() const { return real_job_->GetResponseCode(); } +void AdapterRequestJob::GetLoadTimingInfo( + net::LoadTimingInfo* load_timing_info) const { + real_job_->GetLoadTimingInfo(load_timing_info); +} + base::WeakPtr AdapterRequestJob::GetWeakPtr() { return weak_factory_.GetWeakPtr(); } diff --git a/atom/browser/net/adapter_request_job.h b/atom/browser/net/adapter_request_job.h index 768718584d03..bca549a2eef2 100644 --- a/atom/browser/net/adapter_request_job.h +++ b/atom/browser/net/adapter_request_job.h @@ -46,6 +46,8 @@ class AdapterRequestJob : public net::URLRequestJob { bool GetCharset(std::string* charset) override; void GetResponseInfo(net::HttpResponseInfo* info) override; int GetResponseCode() const override; + void GetLoadTimingInfo( + net::LoadTimingInfo* load_timing_info) const override; base::WeakPtr GetWeakPtr();