diff options
author | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-06 15:46:59 +0000 |
---|---|---|
committer | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-06 15:46:59 +0000 |
commit | abb9d0ca091ed62a1ff77efca594932b31dce975 (patch) | |
tree | 988fc455824d8870ed3eefc526b42987f20a0901 | |
parent | 294300a62be265e4b17eb9df0ee4ddfd543a1fb4 (diff) | |
download | chromium_src-abb9d0ca091ed62a1ff77efca594932b31dce975.zip chromium_src-abb9d0ca091ed62a1ff77efca594932b31dce975.tar.gz chromium_src-abb9d0ca091ed62a1ff77efca594932b31dce975.tar.bz2 |
Portability fix for Value. The MSVC CRT doesn't complain about memcpy_s unless _CRT_SECURE_DEPRECATE_MEMORY is defined (and it isn't); there are no other callers of memcpy_s in base. (And seriously, what's an extra count argument supposed to solve, anyway?) current_entry_type is dropped because it's unused. A virtual destructor is added to ValueSerializer to conform to the style guide and quiet gcc's helpful warning.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@434 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/values.cc | 3 | ||||
-rw-r--r-- | base/values.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/base/values.cc b/base/values.cc index 1cad628..00082d3 100644 --- a/base/values.cc +++ b/base/values.cc @@ -196,7 +196,7 @@ BinaryValue* BinaryValue::CreateWithCopiedBuffer(char* buffer, size_t size) { return NULL; char* buffer_copy = new char[size]; - memcpy_s(buffer_copy, size, buffer, size); + memcpy(buffer_copy, buffer, size); return new BinaryValue(buffer_copy, size); } @@ -277,7 +277,6 @@ bool DictionaryValue::Set(const std::wstring& path, Value* in_value) { // Assume that we're indexing into a dictionary. DictionaryValue* entry = NULL; - ValueType current_entry_type = TYPE_NULL; if (!HasKey(key) || (dictionary_[key]->GetType() != TYPE_DICTIONARY)) { entry = new DictionaryValue; SetInCurrentNode(key, entry); diff --git a/base/values.h b/base/values.h index 3a531a6..386f54c 100644 --- a/base/values.h +++ b/base/values.h @@ -369,6 +369,8 @@ class ListValue : public Value { // deserialize Value objects. class ValueSerializer { public: + virtual ~ValueSerializer() {} + virtual bool Serialize(const Value& root) = 0; // This method deserializes the subclass-specific format into a Value object. |