Index: ipc/ipc_message_utils.cc |
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc |
index 2420bdb1f1aac600b9937e025b364358c6b9702d..9edc3bbd4cd513eb92783ff8d12738c3c49aedf1 100644 |
--- a/ipc/ipc_message_utils.cc |
+++ b/ipc/ipc_message_utils.cc |
@@ -96,8 +96,15 @@ void GetValueSize(base::PickleSizer* sizer, |
case base::Value::TYPE_STRING: { |
const base::StringValue* result; |
value->GetAsString(&result); |
- DCHECK(result); |
- GetParamSize(sizer, result->GetString()); |
+ if (value->GetAsString(&result)) { |
+ DCHECK(result); |
+ GetParamSize(sizer, result->GetString()); |
+ } else { |
+ std::string str; |
+ bool as_string_result = value->GetAsString(&str); |
+ DCHECK(as_string_result); |
+ GetParamSize(sizer, str); |
+ } |
break; |
} |
case base::Value::TYPE_BINARY: { |