OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef URL_URL_CANON_H_ | 5 #ifndef URL_URL_CANON_H_ |
6 #define URL_URL_CANON_H_ | 6 #define URL_URL_CANON_H_ |
7 | 7 |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 public: | 147 public: |
148 RawCanonOutputT() : CanonOutputT<T>() { | 148 RawCanonOutputT() : CanonOutputT<T>() { |
149 this->buffer_ = fixed_buffer_; | 149 this->buffer_ = fixed_buffer_; |
150 this->buffer_len_ = fixed_capacity; | 150 this->buffer_len_ = fixed_capacity; |
151 } | 151 } |
152 virtual ~RawCanonOutputT() { | 152 virtual ~RawCanonOutputT() { |
153 if (this->buffer_ != fixed_buffer_) | 153 if (this->buffer_ != fixed_buffer_) |
154 delete[] this->buffer_; | 154 delete[] this->buffer_; |
155 } | 155 } |
156 | 156 |
157 virtual void Resize(int sz) { | 157 void Resize(int sz) override { |
158 T* new_buf = new T[sz]; | 158 T* new_buf = new T[sz]; |
159 memcpy(new_buf, this->buffer_, | 159 memcpy(new_buf, this->buffer_, |
160 sizeof(T) * (this->cur_len_ < sz ? this->cur_len_ : sz)); | 160 sizeof(T) * (this->cur_len_ < sz ? this->cur_len_ : sz)); |
161 if (this->buffer_ != fixed_buffer_) | 161 if (this->buffer_ != fixed_buffer_) |
162 delete[] this->buffer_; | 162 delete[] this->buffer_; |
163 this->buffer_ = new_buf; | 163 this->buffer_ = new_buf; |
164 this->buffer_len_ = sz; | 164 this->buffer_len_ = sz; |
165 } | 165 } |
166 | 166 |
167 protected: | 167 protected: |
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 bool base_is_file, | 883 bool base_is_file, |
884 const base::char16* relative_url, | 884 const base::char16* relative_url, |
885 const Component& relative_component, | 885 const Component& relative_component, |
886 CharsetConverter* query_converter, | 886 CharsetConverter* query_converter, |
887 CanonOutput* output, | 887 CanonOutput* output, |
888 Parsed* out_parsed); | 888 Parsed* out_parsed); |
889 | 889 |
890 } // namespace url | 890 } // namespace url |
891 | 891 |
892 #endif // URL_URL_CANON_H_ | 892 #endif // URL_URL_CANON_H_ |
OLD | NEW |