| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TODO(rtenhove) clean up frame buffer size calculations so that we aren't | 5 // TODO(rtenhove) clean up frame buffer size calculations so that we aren't |
| 6 // constantly adding and subtracting header sizes; this is ugly and error- | 6 // constantly adding and subtracting header sizes; this is ugly and error- |
| 7 // prone. | 7 // prone. |
| 8 | 8 |
| 9 #include "net/spdy/spdy_framer.h" | 9 #include "net/spdy/spdy_framer.h" |
| 10 | 10 |
| (...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 compressed_size); | 1419 compressed_size); |
| 1420 | 1420 |
| 1421 new_frame->set_length( | 1421 new_frame->set_length( |
| 1422 header_length + compressed_size - SpdyFrame::kHeaderSize); | 1422 header_length + compressed_size - SpdyFrame::kHeaderSize); |
| 1423 | 1423 |
| 1424 pre_compress_bytes.Add(payload_length); | 1424 pre_compress_bytes.Add(payload_length); |
| 1425 post_compress_bytes.Add(new_frame->length()); | 1425 post_compress_bytes.Add(new_frame->length()); |
| 1426 | 1426 |
| 1427 compressed_frames.Increment(); | 1427 compressed_frames.Increment(); |
| 1428 | 1428 |
| 1429 if (visitor_) |
| 1430 visitor_->OnControlFrameCompressed(frame, *new_frame); |
| 1431 |
| 1429 return new_frame.release(); | 1432 return new_frame.release(); |
| 1430 } | 1433 } |
| 1431 | 1434 |
| 1432 // Incrementally decompress the control frame's header block, feeding the | 1435 // Incrementally decompress the control frame's header block, feeding the |
| 1433 // result to the visitor in chunks. Continue this until the visitor | 1436 // result to the visitor in chunks. Continue this until the visitor |
| 1434 // indicates that it cannot process any more data, or (more commonly) we | 1437 // indicates that it cannot process any more data, or (more commonly) we |
| 1435 // run out of data to deliver. | 1438 // run out of data to deliver. |
| 1436 bool SpdyFramer::IncrementallyDecompressControlFrameHeaderData( | 1439 bool SpdyFramer::IncrementallyDecompressControlFrameHeaderData( |
| 1437 const SpdyControlFrame* control_frame, | 1440 const SpdyControlFrame* control_frame, |
| 1438 const char* data, | 1441 const char* data, |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1622 } | 1625 } |
| 1623 } | 1626 } |
| 1624 return stream_id; | 1627 return stream_id; |
| 1625 } | 1628 } |
| 1626 | 1629 |
| 1627 void SpdyFramer::set_enable_compression(bool value) { | 1630 void SpdyFramer::set_enable_compression(bool value) { |
| 1628 enable_compression_ = value; | 1631 enable_compression_ = value; |
| 1629 } | 1632 } |
| 1630 | 1633 |
| 1631 } // namespace net | 1634 } // namespace net |
| OLD | NEW |