| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 | 8 |
| 9 ///////////////////// Value //////////////////// | 9 ///////////////////// Value //////////////////// |
| 10 | 10 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 // static | 187 // static |
| 188 BinaryValue* BinaryValue::Create(char* buffer, size_t size) { | 188 BinaryValue* BinaryValue::Create(char* buffer, size_t size) { |
| 189 if (!buffer) | 189 if (!buffer) |
| 190 return NULL; | 190 return NULL; |
| 191 | 191 |
| 192 return new BinaryValue(buffer, size); | 192 return new BinaryValue(buffer, size); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // static | 195 // static |
| 196 BinaryValue* BinaryValue::CreateWithCopiedBuffer(char* buffer, size_t size) { | 196 BinaryValue* BinaryValue::CreateWithCopiedBuffer(const char* buffer, |
| 197 size_t size) { |
| 197 if (!buffer) | 198 if (!buffer) |
| 198 return NULL; | 199 return NULL; |
| 199 | 200 |
| 200 char* buffer_copy = new char[size]; | 201 char* buffer_copy = new char[size]; |
| 201 memcpy(buffer_copy, buffer, size); | 202 memcpy(buffer_copy, buffer, size); |
| 202 return new BinaryValue(buffer_copy, size); | 203 return new BinaryValue(buffer_copy, size); |
| 203 } | 204 } |
| 204 | 205 |
| 205 | 206 |
| 206 BinaryValue::BinaryValue(char* buffer, size_t size) | 207 BinaryValue::BinaryValue(char* buffer, size_t size) |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 lhs_it != end() && rhs_it != other_list->end(); | 656 lhs_it != end() && rhs_it != other_list->end(); |
| 656 ++lhs_it, ++rhs_it) { | 657 ++lhs_it, ++rhs_it) { |
| 657 if (!(*lhs_it)->Equals(*rhs_it)) | 658 if (!(*lhs_it)->Equals(*rhs_it)) |
| 658 return false; | 659 return false; |
| 659 } | 660 } |
| 660 if (lhs_it != end() || rhs_it != other_list->end()) | 661 if (lhs_it != end() || rhs_it != other_list->end()) |
| 661 return false; | 662 return false; |
| 662 | 663 |
| 663 return true; | 664 return true; |
| 664 } | 665 } |
| OLD | NEW |