Index: extensions/common/extension_api.cc |
diff --git a/extensions/common/extension_api.cc b/extensions/common/extension_api.cc |
index 1e70cb7ed3b063feebfe55ed59e9de0d80d673b8..4b49a83f8e5f70492f0aee34901739c1b85f1ce7 100644 |
--- a/extensions/common/extension_api.cc |
+++ b/extensions/common/extension_api.cc |
@@ -55,24 +55,15 @@ |
NULL, // error code |
&error_message)); |
-#if DCHECK_IS_ON() |
- // |schema| comes from JSON hard-coded to the Chrome binary, so in principle |
- // failure to parse indicates we generated corrupted JSON, but in practice |
- // corruption of the Chrome binary (e.g. disk errors) can also break it. |
- // See http://crbug.com/121424. |
- if (!result || !result->IsType(base::Value::TYPE_LIST)) { |
- char buf[128]; |
- base::snprintf(buf, arraysize(buf), "%s: (%d) '%s'", name.c_str(), |
- result.get() ? result->GetType() : -1, |
- error_message.c_str()); |
- |
- DCHECK(result) << "JSON parse failed: " << buf; |
- DCHECK(result->IsType(base::Value::TYPE_LIST)) << "JSON wrong type: " |
- << buf; |
- } |
-#endif // DCHECK_IS_ON() |
- |
- // From() returns null if passed a null or non-list value. |
+ // Tracking down http://crbug.com/121424 |
+ char buf[128]; |
+ base::snprintf(buf, arraysize(buf), "%s: (%d) '%s'", |
+ name.c_str(), |
+ result.get() ? result->GetType() : -1, |
+ error_message.c_str()); |
+ |
+ CHECK(result.get()) << error_message << " for schema " << schema; |
+ CHECK(result->IsType(base::Value::TYPE_LIST)) << " for schema " << schema; |
return base::ListValue::From(std::move(result)); |
} |
@@ -223,9 +214,6 @@ |
void ExtensionAPI::LoadSchema(const std::string& name, |
const base::StringPiece& schema) { |
std::unique_ptr<base::ListValue> schema_list(LoadSchemaList(name, schema)); |
- if (!schema_list) |
- return; |
- |
std::string schema_namespace; |
extensions::ExtensionsClient* extensions_client = |
extensions::ExtensionsClient::Get(); |
@@ -343,12 +331,7 @@ |
} |
maybe_schema = schemas_.find(api_name); |
- // If the schema failed to load then return null for it, rather than |
- // crashing, so that the browser can be notified of the problem. |
- // See http://crbug.com/121424. |
- if (schemas_.end() == maybe_schema) |
- return NULL; |
- |
+ CHECK(schemas_.end() != maybe_schema); |
result = maybe_schema->second.get(); |
} |
@@ -407,9 +390,7 @@ |
api_name_candidate = api_name_candidate.substr(0, last_dot_index); |
} |
- if (child_name) |
- *child_name = ""; |
- |
+ *child_name = ""; |
return std::string(); |
} |