| OLD | NEW |
| 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/filter_source_stream.h" | 5 #include "net/filter/filter_source_stream.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return rv; | 60 return rv; |
| 61 } | 61 } |
| 62 | 62 |
| 63 std::string FilterSourceStream::Description() const { | 63 std::string FilterSourceStream::Description() const { |
| 64 std::string next_type_string = upstream_->Description(); | 64 std::string next_type_string = upstream_->Description(); |
| 65 if (next_type_string.empty()) | 65 if (next_type_string.empty()) |
| 66 return GetTypeAsString(); | 66 return GetTypeAsString(); |
| 67 return next_type_string + "," + GetTypeAsString(); | 67 return next_type_string + "," + GetTypeAsString(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void FilterSourceStream::DumpMemoryStats( |
| 71 base::trace_event::MemoryAllocatorDump* dump) const { |
| 72 DumpMemoryStatsImpl(dump); |
| 73 upstream_->DumpMemoryStats(dump); |
| 74 } |
| 75 |
| 70 int FilterSourceStream::DoLoop(int result) { | 76 int FilterSourceStream::DoLoop(int result) { |
| 71 DCHECK_NE(STATE_NONE, next_state_); | 77 DCHECK_NE(STATE_NONE, next_state_); |
| 72 | 78 |
| 73 int rv = result; | 79 int rv = result; |
| 74 do { | 80 do { |
| 75 State state = next_state_; | 81 State state = next_state_; |
| 76 next_state_ = STATE_NONE; | 82 next_state_ = STATE_NONE; |
| 77 switch (state) { | 83 switch (state) { |
| 78 case STATE_READ_DATA: | 84 case STATE_READ_DATA: |
| 79 rv = DoReadData(); | 85 rv = DoReadData(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 output_buffer_ = nullptr; | 172 output_buffer_ = nullptr; |
| 167 output_buffer_size_ = 0; | 173 output_buffer_size_ = 0; |
| 168 | 174 |
| 169 base::ResetAndReturn(&callback_).Run(rv); | 175 base::ResetAndReturn(&callback_).Run(rv); |
| 170 } | 176 } |
| 171 | 177 |
| 172 bool FilterSourceStream::NeedMoreData() const { | 178 bool FilterSourceStream::NeedMoreData() const { |
| 173 return !upstream_end_reached_; | 179 return !upstream_end_reached_; |
| 174 } | 180 } |
| 175 | 181 |
| 182 void FilterSourceStream::DumpMemoryStatsImpl( |
| 183 base::trace_event::MemoryAllocatorDump* dump) const {} |
| 184 |
| 176 } // namespace net | 185 } // namespace net |
| OLD | NEW |