| 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/http/http_stream_parser.h" | 5 #include "net/http/http_stream_parser.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/profiler/scoped_profile.h" | 10 #include "base/profiler/scoped_profile.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 // Returns the logical size of the buffer (i.e the number of bytes of data | 156 // Returns the logical size of the buffer (i.e the number of bytes of data |
| 157 // in the buffer). | 157 // in the buffer). |
| 158 int size() const { return size_; } | 158 int size() const { return size_; } |
| 159 | 159 |
| 160 // Returns the capacity of the buffer. The capacity is the size used when | 160 // Returns the capacity of the buffer. The capacity is the size used when |
| 161 // the object is created. | 161 // the object is created. |
| 162 int capacity() const { return capacity_; }; | 162 int capacity() const { return capacity_; }; |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 virtual ~SeekableIOBuffer() { | 165 ~SeekableIOBuffer() override { |
| 166 // data_ will be deleted in IOBuffer::~IOBuffer(). | 166 // data_ will be deleted in IOBuffer::~IOBuffer(). |
| 167 data_ = real_data_; | 167 data_ = real_data_; |
| 168 } | 168 } |
| 169 | 169 |
| 170 char* real_data_; | 170 char* real_data_; |
| 171 const int capacity_; | 171 const int capacity_; |
| 172 int size_; | 172 int size_; |
| 173 int used_; | 173 int used_; |
| 174 }; | 174 }; |
| 175 | 175 |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 request_body->IsInMemory() && | 1060 request_body->IsInMemory() && |
| 1061 request_body->size() > 0) { | 1061 request_body->size() > 0) { |
| 1062 size_t merged_size = request_headers.size() + request_body->size(); | 1062 size_t merged_size = request_headers.size() + request_body->size(); |
| 1063 if (merged_size <= kMaxMergedHeaderAndBodySize) | 1063 if (merged_size <= kMaxMergedHeaderAndBodySize) |
| 1064 return true; | 1064 return true; |
| 1065 } | 1065 } |
| 1066 return false; | 1066 return false; |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 } // namespace net | 1069 } // namespace net |
| OLD | NEW |