Index: base/values.cc |
diff --git a/base/values.cc b/base/values.cc |
index 78547a44991db0aef059a16eaed3e8bd1e24effb..2cb1a1d86da6c148f862b4a4f1d1c549db0d5d94 100644 |
--- a/base/values.cc |
+++ b/base/values.cc |
@@ -378,6 +378,7 @@ bool DictionaryValue::Equals(const Value* other) const { |
} |
bool DictionaryValue::HasKey(const std::string& key) const { |
+ DCHECK(IsStringUTF8(key)); |
ValueMap::const_iterator current_entry = dictionary_.find(key); |
DCHECK((current_entry == dictionary_.end()) || current_entry->second); |
return current_entry != dictionary_.end(); |
@@ -404,6 +405,7 @@ void DictionaryValue::Clear() { |
} |
void DictionaryValue::Set(const std::string& path, Value* in_value) { |
+ DCHECK(IsStringUTF8(path)); |
DCHECK(in_value); |
std::string current_path(path); |
@@ -507,6 +509,7 @@ void DictionaryValue::SetWithoutPathExpansion(const std::wstring& key, |
} |
bool DictionaryValue::Get(const std::string& path, Value** out_value) const { |
+ DCHECK(IsStringUTF8(path)); |
std::string current_path(path); |
const DictionaryValue* current_dictionary = this; |
for (size_t delimiter_position = current_path.find('.'); |
@@ -682,6 +685,7 @@ bool DictionaryValue::GetList(const std::wstring& path, |
bool DictionaryValue::GetWithoutPathExpansion(const std::string& key, |
Value** out_value) const { |
+ DCHECK(IsStringUTF8(key)); |
ValueMap::const_iterator entry_iterator = dictionary_.find(key); |
if (entry_iterator == dictionary_.end()) |
return false; |
@@ -792,6 +796,7 @@ bool DictionaryValue::GetListWithoutPathExpansion(const std::wstring& key, |
} |
bool DictionaryValue::Remove(const std::string& path, Value** out_value) { |
+ DCHECK(IsStringUTF8(path)); |
std::string current_path(path); |
DictionaryValue* current_dictionary = this; |
size_t delimiter_position = current_path.rfind('.'); |
@@ -813,6 +818,7 @@ bool DictionaryValue::Remove(const std::wstring& path, Value** out_value) { |
bool DictionaryValue::RemoveWithoutPathExpansion(const std::string& key, |
Value** out_value) { |
+ DCHECK(IsStringUTF8(key)); |
ValueMap::iterator entry_iterator = dictionary_.find(key); |
if (entry_iterator == dictionary_.end()) |
return false; |