Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/http2/hpack/decoder/http2_hpack_decoder.h" | 5 #include "net/http2/hpack/decoder/http2_hpack_decoder.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/http2/decoder/decode_status.h" | 8 #include "net/http2/decoder/decode_status.h" |
| 9 | 9 |
| 10 using base::StringPiece; | 10 using base::StringPiece; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 DVLOG(2) << "Http2HpackDecoder::error_detected in entry_buffer_"; | 109 DVLOG(2) << "Http2HpackDecoder::error_detected in entry_buffer_"; |
| 110 error_detected_ = true; | 110 error_detected_ = true; |
| 111 } else if (decoder_state_.error_detected()) { | 111 } else if (decoder_state_.error_detected()) { |
| 112 DVLOG(2) << "Http2HpackDecoder::error_detected in decoder_state_"; | 112 DVLOG(2) << "Http2HpackDecoder::error_detected in decoder_state_"; |
| 113 error_detected_ = true; | 113 error_detected_ = true; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 return error_detected_; | 116 return error_detected_; |
| 117 } | 117 } |
| 118 | 118 |
| 119 size_t Http2HpackDecoder::EstimateMemoryUsage() const { | |
| 120 return entry_buffer_.EstimateMemoryUsage(); | |
|
Bence
2017/02/05 19:11:23
I thought EstimateMemoryUsage(entry_buffer_) is pr
xunjieli
2017/02/06 14:54:56
Done. Oops sorry. Good catch! I missed this one an
| |
| 121 } | |
| 122 | |
| 119 void Http2HpackDecoder::ReportError(StringPiece error_message) { | 123 void Http2HpackDecoder::ReportError(StringPiece error_message) { |
| 120 DVLOG(3) << "Http2HpackDecoder::ReportError is new=" | 124 DVLOG(3) << "Http2HpackDecoder::ReportError is new=" |
| 121 << (!error_detected_ ? "true" : "false") | 125 << (!error_detected_ ? "true" : "false") |
| 122 << ", error_message: " << error_message; | 126 << ", error_message: " << error_message; |
| 123 if (!error_detected_) { | 127 if (!error_detected_) { |
| 124 error_detected_ = true; | 128 error_detected_ = true; |
| 125 listener()->OnHeaderErrorDetected(error_message); | 129 listener()->OnHeaderErrorDetected(error_message); |
| 126 } | 130 } |
| 127 } | 131 } |
| 128 | 132 |
| 129 } // namespace net | 133 } // namespace net |
| OLD | NEW |