OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/net/compressed_packet_reader.h" | 5 #include "blimp/net/compressed_packet_reader.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 decompressed->RemainingCapacity() - zlib_stream_.avail_out; | 86 decompressed->RemainingCapacity() - zlib_stream_.avail_out; |
87 | 87 |
88 // Verify that the decompressed output isn't bigger than the maximum allowable | 88 // Verify that the decompressed output isn't bigger than the maximum allowable |
89 // payload size, by checking if there are bytes waiting to be processed. | 89 // payload size, by checking if there are bytes waiting to be processed. |
90 if (zlib_stream_.avail_in > 0) { | 90 if (zlib_stream_.avail_in > 0) { |
91 DLOG(ERROR) | 91 DLOG(ERROR) |
92 << "Decompressed buffer size exceeds allowable limits; aborting."; | 92 << "Decompressed buffer size exceeds allowable limits; aborting."; |
93 return net::ERR_FILE_TOO_BIG; | 93 return net::ERR_FILE_TOO_BIG; |
94 } | 94 } |
95 | 95 |
96 if (connection_statistics_) { | |
Kevin M
2016/05/20 01:02:04
Test this interaction?
shaktisahu
2016/05/22 22:36:57
Done.
| |
97 connection_statistics_->Add( | |
98 BlimpConnectionStatistics::EventType::BYTES_RECEIVED, size); | |
99 } | |
96 return decompressed_size; | 100 return decompressed_size; |
97 } | 101 } |
98 | 102 |
99 } // namespace blimp | 103 } // namespace blimp |
OLD | NEW |