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

Side by Side Diff: net/filter/filter_source_stream.h

Issue 2753453003: Reject unadvertised encodings (Closed)
Patch Set: Extracted code for UMA reporting Created 3 years, 9 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/filter/filter_source_stream.cc » ('j') | net/http/http_network_transaction.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef NET_FILTER_FILTER_SOURCE_STREAM_H_ 5 #ifndef NET_FILTER_FILTER_SOURCE_STREAM_H_
6 #define NET_FILTER_FILTER_SOURCE_STREAM_H_ 6 #define NET_FILTER_FILTER_SOURCE_STREAM_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 20 matching lines...) Expand all
31 FilterSourceStream(SourceType type, std::unique_ptr<SourceStream> upstream); 31 FilterSourceStream(SourceType type, std::unique_ptr<SourceStream> upstream);
32 32
33 ~FilterSourceStream() override; 33 ~FilterSourceStream() override;
34 34
35 int Read(IOBuffer* read_buffer, 35 int Read(IOBuffer* read_buffer,
36 int read_buffer_size, 36 int read_buffer_size,
37 const CompletionCallback& callback) override; 37 const CompletionCallback& callback) override;
38 38
39 std::string Description() const override; 39 std::string Description() const override;
40 40
41 static void ReportContentDecodingFailed(SourceType type);
42
41 private: 43 private:
42 enum State { 44 enum State {
43 STATE_NONE, 45 STATE_NONE,
44 // Reading data from |upstream_| into |input_buffer_|. 46 // Reading data from |upstream_| into |input_buffer_|.
45 STATE_READ_DATA, 47 STATE_READ_DATA,
46 // Reading data from |upstream_| completed. 48 // Reading data from |upstream_| completed.
47 STATE_READ_DATA_COMPLETE, 49 STATE_READ_DATA_COMPLETE,
48 // Filtering data contained in |input_buffer_|. 50 // Filtering data contained in |input_buffer_|.
49 STATE_FILTER_DATA, 51 STATE_FILTER_DATA,
50 // Filtering data contained in |input_buffer_| completed. 52 // Filtering data contained in |input_buffer_| completed.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 112
111 // Reading from |upstream_| has returned 0 byte or an error code. 113 // Reading from |upstream_| has returned 0 byte or an error code.
112 bool upstream_end_reached_; 114 bool upstream_end_reached_;
113 115
114 DISALLOW_COPY_AND_ASSIGN(FilterSourceStream); 116 DISALLOW_COPY_AND_ASSIGN(FilterSourceStream);
115 }; 117 };
116 118
117 } // namespace net 119 } // namespace net
118 120
119 #endif // NET_FILTER_FILTER_SOURCE_STREAM_H_ 121 #endif // NET_FILTER_FILTER_SOURCE_STREAM_H_
OLDNEW
« no previous file with comments | « no previous file | net/filter/filter_source_stream.cc » ('j') | net/http/http_network_transaction.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698