Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: dbus/values_util.cc

Issue 9863050: Checked the return values of function calls. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/values_util.cc
diff --git a/dbus/values_util.cc b/dbus/values_util.cc
index e341ac235ce5dae8d60612ff1b4eddee933f8922..96cc37b315281357fe7a7a49cf39e033594a3f39 100644
--- a/dbus/values_util.cc
+++ b/dbus/values_util.cc
@@ -207,25 +207,29 @@ void AppendBasicTypeValueData(MessageWriter* writer, const base::Value& value) {
switch (value.GetType()) {
case base::Value::TYPE_BOOLEAN: {
bool bool_value = false;
- value.GetAsBoolean(&bool_value);
+ bool success = value.GetAsBoolean(&bool_value);
+ DCHECK(success);
writer->AppendBool(bool_value);
break;
}
case base::Value::TYPE_INTEGER: {
int int_value = 0;
- value.GetAsInteger(&int_value);
+ bool success = value.GetAsInteger(&int_value);
+ DCHECK(success);
writer->AppendInt32(int_value);
break;
}
case base::Value::TYPE_DOUBLE: {
double double_value = 0;
- value.GetAsDouble(&double_value);
+ bool success = value.GetAsDouble(&double_value);
+ DCHECK(success);
writer->AppendDouble(double_value);
break;
}
case base::Value::TYPE_STRING: {
std::string string_value;
- value.GetAsString(&string_value);
+ bool success = value.GetAsString(&string_value);
+ DCHECK(success);
writer->AppendString(string_value);
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698