SetupFilter is replaced with SetUpSourceStream

This commit is contained in:
Cheng Zhao 2017-01-24 14:16:23 +09:00 committed by Kevin Sawicki
parent 9882e87fbd
commit c0697d8abe
2 changed files with 8 additions and 4 deletions

View file

@ -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<net::Filter> URLRequestAsarJob::SetupFilter() const {
std::unique_ptr<net::SourceStream> URLRequestAsarJob::SetUpSourceStream() {
std::unique_ptr<net::SourceStream> 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 {

View file

@ -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<net::Filter> SetupFilter() const override;
std::unique_ptr<net::SourceStream> SetUpSourceStream() override;
bool GetMimeType(std::string* mime_type) const override;
void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override;
int GetResponseCode() const override;