| 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/tools/content_decoder_tool/content_decoder_tool.h" | 5 #include "net/tools/content_decoder_tool/content_decoder_tool.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 if (input_stream_) { | 42 if (input_stream_) { |
| 43 input_stream_->read(dest_buffer->data(), buffer_size); | 43 input_stream_->read(dest_buffer->data(), buffer_size); |
| 44 int bytes = input_stream_->gcount(); | 44 int bytes = input_stream_->gcount(); |
| 45 return bytes; | 45 return bytes; |
| 46 } | 46 } |
| 47 return ERR_FAILED; | 47 return ERR_FAILED; |
| 48 } | 48 } |
| 49 | 49 |
| 50 std::string Description() const override { return ""; } | 50 std::string Description() const override { return ""; } |
| 51 | 51 |
| 52 void DumpMemoryStats( |
| 53 base::trace_event::MemoryAllocatorDump* dump) const override {} |
| 54 |
| 52 private: | 55 private: |
| 53 std::istream* input_stream_; | 56 std::istream* input_stream_; |
| 54 | 57 |
| 55 DISALLOW_COPY_AND_ASSIGN(StdinSourceStream); | 58 DISALLOW_COPY_AND_ASSIGN(StdinSourceStream); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 } // namespace | 61 } // namespace |
| 59 | 62 |
| 60 // static | 63 // static |
| 61 bool ContentDecoderToolProcessInput(std::vector<std::string> content_encodings, | 64 bool ContentDecoderToolProcessInput(std::vector<std::string> content_encodings, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 } | 108 } |
| 106 output_stream->write(read_buffer->data(), bytes_read); | 109 output_stream->write(read_buffer->data(), bytes_read); |
| 107 // If EOF is read, break out the while loop. | 110 // If EOF is read, break out the while loop. |
| 108 if (bytes_read == 0) | 111 if (bytes_read == 0) |
| 109 break; | 112 break; |
| 110 } | 113 } |
| 111 return true; | 114 return true; |
| 112 } | 115 } |
| 113 | 116 |
| 114 } // namespace net | 117 } // namespace net |
| OLD | NEW |