From c0697d8abeb45fc6d02eaedcee63126b30b4a544 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 24 Jan 2017 14:16:23 +0900 Subject: [PATCH] SetupFilter is replaced with SetUpSourceStream --- atom/browser/net/asar/url_request_asar_job.cc | 10 +++++++--- atom/browser/net/asar/url_request_asar_job.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/atom/browser/net/asar/url_request_asar_job.cc b/atom/browser/net/asar/url_request_asar_job.cc index 586aa42a5a4..8bacf1124bf 100644 --- a/atom/browser/net/asar/url_request_asar_job.cc +++ b/atom/browser/net/asar/url_request_asar_job.cc @@ -21,7 +21,7 @@ #include "net/base/load_flags.h" #include "net/base/mime_util.h" #include "net/base/net_errors.h" -#include "net/filter/filter.h" +#include "net/filter/gzip_source_stream.h" #include "net/http/http_util.h" #include "net/url_request/url_request_status.h" @@ -179,10 +179,14 @@ bool URLRequestAsarJob::IsRedirectResponse(GURL* location, #endif } -std::unique_ptr URLRequestAsarJob::SetupFilter() const { +std::unique_ptr URLRequestAsarJob::SetUpSourceStream() { + std::unique_ptr source = + net::URLRequestJob::SetUpSourceStream(); // Bug 9936 - .svgz files needs to be decompressed. return base::LowerCaseEqualsASCII(file_path_.Extension(), ".svgz") - ? net::Filter::GZipFactory() : nullptr; + ? net::GzipSourceStream::Create(std::move(source), + net::SourceStream::TYPE_GZIP) + : std::move(source); } bool URLRequestAsarJob::GetMimeType(std::string* mime_type) const { diff --git a/atom/browser/net/asar/url_request_asar_job.h b/atom/browser/net/asar/url_request_asar_job.h index 7af88da7696..9808be88189 100644 --- a/atom/browser/net/asar/url_request_asar_job.h +++ b/atom/browser/net/asar/url_request_asar_job.h @@ -56,7 +56,7 @@ class URLRequestAsarJob : public net::URLRequestJob { void Kill() override; int ReadRawData(net::IOBuffer* buf, int buf_size) override; bool IsRedirectResponse(GURL* location, int* http_status_code) override; - std::unique_ptr SetupFilter() const override; + std::unique_ptr SetUpSourceStream() override; bool GetMimeType(std::string* mime_type) const override; void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; int GetResponseCode() const override;