OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_buffer.h" | 5 #include "net/spdy/chromium/spdy_buffer.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
| 14 #include "net/spdy/core/spdy_protocol.h" |
14 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" | 15 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" |
15 #include "net/spdy/spdy_protocol.h" | |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // Bound on largest frame any SPDY version has allowed. | 21 // Bound on largest frame any SPDY version has allowed. |
22 const size_t kMaxSpdyFrameSize = 0x00ffffff; | 22 const size_t kMaxSpdyFrameSize = 0x00ffffff; |
23 | 23 |
24 // Makes a SpdySerializedFrame with |size| bytes of data copied from |data|. | 24 // Makes a SpdySerializedFrame with |size| bytes of data copied from |data|. |
25 // |data| must be non-NULL and |size| must be positive. | 25 // |data| must be non-NULL and |size| must be positive. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 DCHECK_GE(consume_size, 1u); | 108 DCHECK_GE(consume_size, 1u); |
109 DCHECK_LE(consume_size, GetRemainingSize()); | 109 DCHECK_LE(consume_size, GetRemainingSize()); |
110 offset_ += consume_size; | 110 offset_ += consume_size; |
111 for (std::vector<ConsumeCallback>::const_iterator it = | 111 for (std::vector<ConsumeCallback>::const_iterator it = |
112 consume_callbacks_.begin(); it != consume_callbacks_.end(); ++it) { | 112 consume_callbacks_.begin(); it != consume_callbacks_.end(); ++it) { |
113 it->Run(consume_size, consume_source); | 113 it->Run(consume_size, consume_source); |
114 } | 114 } |
115 }; | 115 }; |
116 | 116 |
117 } // namespace net | 117 } // namespace net |
OLD | NEW |