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 #include "net/spdy/spdy_framer.h" | 5 #include "net/spdy/spdy_framer.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/metrics/stats_counters.h" | 9 #include "base/metrics/stats_counters.h" |
10 #include "base/third_party/valgrind/memcheck.h" | 10 #include "base/third_party/valgrind/memcheck.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 // Used to indicate no flags in a SPDY flags field. | 47 // Used to indicate no flags in a SPDY flags field. |
48 const uint8 kNoFlags = 0; | 48 const uint8 kNoFlags = 0; |
49 | 49 |
50 // Wire sizes of priority payloads. | 50 // Wire sizes of priority payloads. |
51 const size_t kPriorityDependencyPayloadSize = 4; | 51 const size_t kPriorityDependencyPayloadSize = 4; |
52 const size_t kPriorityWeightPayloadSize = 1; | 52 const size_t kPriorityWeightPayloadSize = 1; |
53 | 53 |
54 } // namespace | 54 } // namespace |
55 | 55 |
56 const SpdyStreamId SpdyFramer::kInvalidStream = -1; | 56 const SpdyStreamId SpdyFramer::kInvalidStream = static_cast<SpdyStreamId>(-1); |
57 const size_t SpdyFramer::kHeaderDataChunkMaxSize = 1024; | 57 const size_t SpdyFramer::kHeaderDataChunkMaxSize = 1024; |
58 // largest control frame, which is SYN_STREAM. See GetSynStreamMinimumSize() for | 58 // largest control frame, which is SYN_STREAM. See GetSynStreamMinimumSize() for |
59 // calculation details. | 59 // calculation details. |
60 const size_t SpdyFramer::kControlFrameBufferSize = 18; | 60 const size_t SpdyFramer::kControlFrameBufferSize = 18; |
61 | 61 |
62 #ifdef DEBUG_SPDY_STATE_CHANGES | 62 #ifdef DEBUG_SPDY_STATE_CHANGES |
63 #define CHANGE_STATE(newstate) \ | 63 #define CHANGE_STATE(newstate) \ |
64 do { \ | 64 do { \ |
65 DVLOG(1) << "Changing state from: " \ | 65 DVLOG(1) << "Changing state from: " \ |
66 << StateToString(state_) \ | 66 << StateToString(state_) \ |
(...skipping 3132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3199 builder->Seek(compressed_size); | 3199 builder->Seek(compressed_size); |
3200 builder->RewriteLength(*this); | 3200 builder->RewriteLength(*this); |
3201 | 3201 |
3202 pre_compress_bytes.Add(uncompressed_len); | 3202 pre_compress_bytes.Add(uncompressed_len); |
3203 post_compress_bytes.Add(compressed_size); | 3203 post_compress_bytes.Add(compressed_size); |
3204 | 3204 |
3205 compressed_frames.Increment(); | 3205 compressed_frames.Increment(); |
3206 } | 3206 } |
3207 | 3207 |
3208 } // namespace net | 3208 } // namespace net |
OLD | NEW |