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

Side by Side Diff: net/filter/gzip_source_stream.cc

Issue 2525743002: Make URLRequestContext a MemoryDumpProvider (Abandoned) (Closed)
Patch Set: rebased to 7f3d142161b15869f6bea58ac43c5f52ce5834ac Created 4 years 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/filter/gzip_source_stream.h" 5 #include "net/filter/gzip_source_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 case TYPE_GZIP_FALLBACK: 69 case TYPE_GZIP_FALLBACK:
70 return kGzipFallback; 70 return kGzipFallback;
71 case TYPE_DEFLATE: 71 case TYPE_DEFLATE:
72 return kDeflate; 72 return kDeflate;
73 default: 73 default:
74 NOTREACHED(); 74 NOTREACHED();
75 return ""; 75 return "";
76 } 76 }
77 } 77 }
78 78
79 void GzipSourceStream::DumpMemoryStatsImpl(
80 base::trace_event::MemoryAllocatorDump* dump) const {}
81
79 int GzipSourceStream::FilterData(IOBuffer* output_buffer, 82 int GzipSourceStream::FilterData(IOBuffer* output_buffer,
80 int output_buffer_size, 83 int output_buffer_size,
81 IOBuffer* input_buffer, 84 IOBuffer* input_buffer,
82 int input_buffer_size, 85 int input_buffer_size,
83 int* consumed_bytes, 86 int* consumed_bytes,
84 bool /*upstream_end_reached*/) { 87 bool /*upstream_end_reached*/) {
85 *consumed_bytes = 0; 88 *consumed_bytes = 0;
86 char* input_data = input_buffer->data(); 89 char* input_data = input_buffer->data();
87 int input_data_size = input_buffer_size; 90 int input_data_size = input_buffer_size;
88 int bytes_out = 0; 91 int bytes_out = 0;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // 1952 2.3.1, so if the first byte isn't the first byte of the gzip magic, and 214 // 1952 2.3.1, so if the first byte isn't the first byte of the gzip magic, and
212 // this filter is checking whether it should fallback, then fallback. 215 // this filter is checking whether it should fallback, then fallback.
213 bool GzipSourceStream::ShouldFallbackToPlain(char first_byte) { 216 bool GzipSourceStream::ShouldFallbackToPlain(char first_byte) {
214 if (type() != TYPE_GZIP_FALLBACK) 217 if (type() != TYPE_GZIP_FALLBACK)
215 return false; 218 return false;
216 static const char kGzipFirstByte = 0x1f; 219 static const char kGzipFirstByte = 0x1f;
217 return first_byte != kGzipFirstByte; 220 return first_byte != kGzipFirstByte;
218 } 221 }
219 222
220 } // namespace net 223 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698